File Manager not observing symlinks

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Webmin version 2.013
Usermin version 1.861
Virtualmin version 7.5
Theme version 20.13
Package updates All installed packages are up to date

@staff
User Case :
User has a symlinked directory outside of the user home
Problem :

as you can see from the image file manager appears to only respect files that are in the user that are within the user’s ‘home’ directory and not symlinks to directories/files that the user has access to that are actually outside of the user’s home. I would have thought as file manager has read the directory(s)
and set the directories/files to symlinks it would, on reading the directories/files check the permissions and allow the user to edit/delete etc files the user has permissions to rather than throwing an error. That said … this may be some work to rework file manager, is there a work around ?

A work-around to do what?

so the user can edit/view files he has access to

current work around is to user the terminal & nano and or mc but this is not ideal

A user is not allowed to have access to files outside of home directory in File Manager by default. This can be changed though in Webmin Users module but I would recommend to be very careful about it.

The other solution (probably) would be is to use bind mount directories that should be accessed outside of the user’s home into the user’s home.

current work around is to user the terminal & nano and or mc but this is not ideal

Correct. But Webmin File Manager permissions controls don’t work the same way.

I understand that, but I don’t quite get why file manager could not be coded to respect symlinks … if it’s 'a won’t fix ’ I’ll advise the user to use terminal ->nano/mc … this may open on windows systems may have the key binding (ctl-w) for other tasks

There are solutions. Please check my previous comment.

that doesn’t look good … I don’t need careful

I will reiterate I just don’t get why a user that has permission to a file/directory can not edit the content, file manager is aware of the directories/files so should allow this … unless there is a good case against this.
so therefore remove the symlinks from file manager that the user can not access

I will reiterate I just don’t get why a user that has permission to a file/directory can not edit the content

Because most system administrators don’t want users to see files outside of their homes!

This actually could be an improvement.

even if the can access them ?
the admin must have allowed this in the first place

This is why an admin can change ACLs for File Manager module in Webmin Users module.

So I have to do this for every user that has accessible files out of their home …
so where do I edit that within the module ?
I see

didn’t work
did what you said no edit


but oddly you can download the file

if this helps
image

We will look into fixing this. I don’t think a user should have access to symbolic links which are outside of home directory, unless additional path is allowed in Allow access to directories in Webmin ⇾ Webmin Users: username / File Manager – Module Access Control page.

didn’t work

I currently found a bug which didn’t change the link on the Virtualmin navigation menu when additional allowed paths are set for the user. We will fix this on the next Virtualmin release. Thanks for the heads-up!

did what you said no edit

Under any circumstances a virtual server owner will not be able to edit files which he doesn’t own (by default), even though additional paths can be extended in mentioned above section, i.e. Webmin Users module.

If you have a pool of files that you want to share across all users on the system you should put those files in a specific directory on your system, e.g. /mnt/shared and give users access to it (mentioned above) or mount bind this directory to each user home.

The imaginary /mnt/shared directory and all the files in it, should have proper permissions set for other users to be able to read/write those files. If you want those files to be writable, it is also possible by changing files group and adding this group to each user in Users and Groups module.

This is all doable!

Did you miss the word “NOT” in there?

You’re right. Fixed.

That is exactly what I did & it didn’t work, however if you create a symlink to a file in another directory within the users home you still can not edit it from the symlink, you have to navigate to the other file and edit it there … does that not remove the idea behind a symlink ? i.e fast access to a file

What exactly didn’t work? Can you provide a screenshot of what you did in Webmin Users module to make sure we’re on the same page?

screen shot #1

screen shot #2


notice no ability to edit

screen shot #3


right click the actual file shows the edit option …I’m going to go through this slowly … given up (for the time being on files outside of home) the screen shots allude to a file and a symlink within the users home you can not edit the underlying file from a symlink.