I'm confused about what effect the uid or gid has on the ability of a process to execute a file. I read the section I could find on them in APUE, but I must have missed the part where Stevens explains this. I know that the superuser has an id of 0 and can execute any file, but I am lost what happens with specific uid or gid numbers. I am also not particularly sure if uid or gid is relevant, or if euid and egid are the only things that matter?
For example, this is a question we got in class:
Assume a process with effective user id 4 and effective group id 7 tries to execute a file with user id 4, group id 9, and permissions rw-r-x--x. What will happen (and why)?
So I suppose since user write permission is not granted the process should not be able to execute the file? Or since the uid and euid are the same the process can execute the file? Where does the egid and gid come into this?