I came across a linux kernel tutorial and there they talked about 4 pairs of identifiers and one of them was file system uid and gid.
Could someone explain me what it is and how it is different from uid and gid?
filesystemslinuxusers
I came across a linux kernel tutorial and there they talked about 4 pairs of identifiers and one of them was file system uid and gid.
Could someone explain me what it is and how it is different from uid and gid?
Best Answer
Who would have thought that this question would drag out such a collection of overconfident and underinformed responses!
The file system uid or fsuid is a Linux feature designed to help the NFS server implementation. It is an extra (non-POSIX) uid which is used only for file permission checks. For any process that doesn't call
setfsuid
(basically any process that's not trying to be an NFS server), the fsuid is the same as the effective uid.There's even a man page for it, so excuse for claiming it doesn't exist.
Update: I was inspired to go find the origin of fsuid. When it was added in Linux 1.1.44, this comment was put above the new
sys_setfsuid
function:and this change was made in the comment above
sys_access
:So NFS was one of the original two purposes. The other was making access() work correctly. access() is used by setuid programs to determine whether the real user would have access to a file without the additional privileges of the setuid. Before 1.1.44 it was buggy. Since then, it's been using a temporary change of fsuid to do the work. Since the fsuid is restored before the access() system call returns, you'll never actually see the change from userspace.