1

This is a theoretical question. I'm using a linux system with two users: root and nonRoot. I'm debugging an application as nonRoot, that uses a file placed in the following path:

/home/nonRootFolder/fileUsed.xml

If I execute ls -las command in home directory, I see:

 0 drw-------    4 root     root           496 Oct  3 21:45 ./
 0 drwxr-xr-x    4 root     root           688 Oct  3 21:45 ../
     ...
 0 drwxr-x---    2 nonRoot  nonRoot        432 Oct  3 21:45 nonRootFolder/ 
     ...

The same command in / directory shows the next output:

 0 drw-------    4 root     root           496 Oct  3 21:45 ./
 0 drwxr-xr-x    4 root     root           688 Oct  3 21:45 ../
     ...
 0 drwxr-x---    4 root     root           688 Oct  3 21:45 home/
     ...

So, the application is executed by nonRoot and uses a file in nonRootFolder. However, this file and folder is placed home with root as proprietary and nonRoot has not root privileges in the system.

Can the application use the file in this case?

  • getfacl might be more clear. It depends on what path is the program accessing, it doesn't have to go through /home. – 炸鱼薯条德里克 Oct 4 '18 at 23:09
  • 1
    Actually I think the system is going to be hosed. Since even root doesn't even have execute permission on /, so root can't use any file within it either. Of course root have the permission to change folder permission back to a sane value, but since /usr/bin/chmod is under /, recovery will be tricky unless you boot to another system. – Lie Ryan Oct 5 '18 at 2:42
1

User nonRoot cannot access /home/nonRootFolder because the permissions on /home do not allow that user to traverse (x) into it. You would need at least o+x on /home.

Here, I'm assuming that nonRoot does not belong to the root group; I wouldn't suggest adding a non-root user to the root group.

  • 1
    What if nonRoot belongs to the root group? – RudiC Oct 4 '18 at 16:20
  • @RudiC Still doesn't help you since group permissions are set to no access. – doneal24 Oct 4 '18 at 23:02

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.