On a Linux (ubuntu) machine, an automated script running as a normal user is creating a subdirectory under its home directory. For some reason, the directory is created with Access: (0000/d---------). umask is 0022. This obviously means the script can't create any files in that directory. Can anyone think of anything?

Apparently this only happens with the non-superuser account.

Update: The problem was actually a bug. mkdir was called as a system command from C code, not as the command-line utility. And the programmer who called it used mode=0...

Anyway - the reason it DID work when running as root, is that root can create files in directories even when the permissions don't allow it.

  • wow, cool problem. Thanks for updating with the solution – Matt Simmons Jun 16 '09 at 13:11

What is the umask of that users login session set to?

Also you can always chmod the directory after you create it. "man chmod" for details.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.