0

Here is the output of a sample /proc/pid/status file.

From the procfs(5) Man page, found that those are Real, Effective, Saved and FileSystem UIDs

Uid:    998     998     998     998
Gid:    996     996     996     996

Here all are showing same values.

So, in any chance those four columns will show different UIDs. Especially among Real, Effective and Filesystem UIDs.

  • You say in your own question that these are the Real, Effective, Saved and FileSystem UIDs. You've only got a question in your title, not the actual question, but you'll have to look at OS-specific references fro that, this doesn't seem to be a programming question. – Thomas Jager Feb 26 '21 at 13:53
  • @ThomasJager Thanks for pointing the correction needed. I just rephrased the question. – renga_in_stack Feb 26 '21 at 13:58

1 Answers1

1

Taking this as a question:

So, in any chance those four columns will show different UIDs.

Yes. Subject to various limitations, processes can change their effective and saved UIDs and GIDs. This is what the setuid(), setgid(), seteuid(), and setegid() functions do.

The filesystem uid and gid are Linux-specific features that are used mainly, if not entirely, in the context of NFS (see filesystem uid and gid in linux). These can be manipulated with setfsuid() and setfsgid(), subject, again, to limitations.

For most processes, all the UIDs will the same and all the GIDs will be the same, but it is conceivable that they would all be different. It is a function of the behavior of the process.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157