One thing that's odd to me right now is I am playing around with permissions. The way umask works to my knowledge is it basically tells what permissions u g o don't have using octal representation (subtracting from 6 on files and 7 in directories). So I thought that 007 should leave u=rwx g=rwx o= for directories and u=rw g=rw o= for files

However that is not what's happening on my vm (Fedora29). Here is what I do and what I get

$ umask 007
$ mkdir test-d
$ touch test-f
$ ls -l

drwxrwxr-x. 1 vagrant vagrant 4096 Feb 18 16:35 test-d
-rw-rw----. 1 vagrant vagrant    0 Feb 18 16:35 test-f

So the file works as expected but there's still r-x on the directory for "other". Any idea why that is?

This behaviour only happens in the folder I synced with my host machine (which is also running on Fedora29) but it does not seem to just use the umask from the host machine. If I change my host machine to 007 o will still receive r-x.

  • one think I found out is this. My default umask is 002 before changing it which would add to be rwxrwxr-x for folders. however my folder is definately created in 007 and i still get o=rx – relief.melone Feb 18 at 16:48
  • What does ls -Zd . return in the directory where you did these things? There seems to be an SELinux security context on the current folder (the . at the end of the permission string). – Kusalananda Feb 18 at 16:49
  • 1
    unconfined_u:object_r:user_home_t:s0 . I just found out something I didn't mention before. The folder I tried this is mounted to my host machine (also fedora29) when I do this in another folder it works as expected. Didn't think it would make a difference before. Will add it to the question – relief.melone Feb 18 at 16:51
  • is mkdir wrapped? what is the output of type -a mkdir ? (suspecting a mkdir -m 775 ...) – Jeff Schaller Feb 18 at 17:53
  • sorry for the late reply. just returned. type -a mkdir -> mkdir is /usr/bin/mkdir – relief.melone Feb 24 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.