File permissions

Interesting. I checked on one of my setups and noticed something similar. The Rock-on had modified (I believe) the ownership of that directory, however in the UI the original setup was still present:

Now, when I changed the owner (chown) via the UI, the terminal and UI output were in sync:
image

image

as for the permissions, those apparently remained the same as originally set:

server:/mnt2 # stat -c '%A %a %n' minecraft
drwxr-xr-x 755 minecraft

vs. UI

now, changing the permissions via terminal to a different value, say:
drwxrwxr-x 775 minecraft

the value remains the same as before in the UI (755) - as you have observed.

Now, when I change the permissions via the UI to, say, this:

now, via terminal you can see the change:
drwxr--r-- 744 minecraft

Without photographic proof I can also confirm that all sub-directories and files have that permission change applied.

So, I think, this means that during the initial setup of a share or changes of the attributes, that information is stored on the Rockstor database and applies to the root directory of the share. If no terminal-level meddling occurs, those would remain in sync.
However, if those owners and permissions are changed without going through the UI, they will go out of sync.

Looking at the code (without understanding everything) it seems that during creation a default owner/permission piece is set up (during initial share setup one cannot assign a owner/permission set).

After the initial creation of the share, one can go back in and make a change to the owner/permissions.

(overriding the previous default values)

Those will be recursively applied to the share (both ownership and permissions).

So, obviously in the UI, the display of that information comes from the database under which those UI values were saved. Terminal-based changes on the root share or sub-directories and files are not comprehended or queried. Here is the model, storing that information:

So, in summary, you are right, the UI view and what you have in the share can be out of sync, once the terminal becomes involved. I also believe, that the forced recursion of any changes via the UI (Owner and/or Permissions) can time out when it needs to be applied to a large set of directories/files that already exist on that share…
So, for better or worse, whatever you do with the terminal is the one the system honors. How to get the UI entries realigned or whether that’s even a desirable functionality, since the terminal use is not a standard use case, is worth a discussion.

2 Likes