Standard user cannot access directory with ownership and mod 777, but root can

0

I have the weird issue of a directory being visible and viewable by root, but not by average users (even a sudoer). I run the command ls -alF at the directory containing the folder in question, and I get this out of the root user (and by sudo ls -alF):

...
drwxrwxrwx+   1 root root 12288 Mar 22 22:13 os/
...

I also get this out of the same command run by a non-root user:

...
d?????????   ? ?    ?        ?            ? os/
...

I go to check the ACLs of the directory in question using getfacl os , and I get this:

# file: os
# owner: root
# group: root
user::rwx
group::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx

This is the mount point of an NTFS partition mounted with ntfs-3g with the following /etc/fstab entry (it was mounted using it):

UUID=<uuid>  /os  ntfs-3g  hide_hid_files,hide_dot_files,windows_names,no_def_opts,big_writes  0  0

Isiah Meadows

Posted 2014-06-24T00:31:59.817

Reputation: 163

Did you try chown -R root:root os and chown -R user:user os and then chmod -R 0777 os? – arielnmz – 2014-06-24T01:18:38.213

Problem solved...had to add permissions to my fstab options. – Isiah Meadows – 2014-06-24T01:53:07.460

Answers

1

How I solved my problem was by this: adding permissions to my options, making my /etc/fstab entry like this:

UUID=<uuid>  /os  ntfs-3g  hide_hid_files,hide_dot_files,windows_names,no_def_opts,big_writes,permissions  0  0

For those of you who are curious, here's my reasoning. The permissions option uses standard access control, while the acl option allows POSIX ACLs to be set (Windows has no clue what these are). The former is better in that it doesn't try to take into account Windows ACLs, which can lead into incompatibility issues with permissions compared to the POSIX ones. Some builds do not have the acl option, but at least the ones that come with Ubuntu binaries do.

If you want maximum compatibility with Windows and Linux without as much risk for problems to arise, you may want to use the following options:

  • permissions - allows for better permissions handling shared between Windows and Linux. It is listed as a default option, but is overridden by default by acl when it is not passed. So, in maintaining compatibility with other builds, it is safer to explicitly pass this.
  • windows_names - makes sure that file/folder names are limited to what Windows natively supports. For example: Windows cannot support the character : because it signifies named data streams, and the character / is standard usage for command-line options on Windows.
  • big_writes - makes the writes not have to be split up into 4kB sections, enabling applications to write in one whole step. Although not set by default, this is virtually always better performance-wise.

If I missed something, this is marked as a community wiki.

Isiah Meadows

Posted 2014-06-24T00:31:59.817

Reputation: 163