views:

40

answers:

3

Hi all.

I was checking the documentation for the file_exists() PHP function.

The documentation at some point reads:

The check is done using the real UID/GID instead of the effective one.

What does that mean? I have no idea.

Can somebody please explain that to me?

Thanks, Daniele

+1  A: 

The effective UID/GID is the UID/GID the software is using right now (for example, software, executed by root can change it's UID/GID to daemon:daemon, so effective UID/GID is also changed. Real UID/GID is the UID/GID of the process owner and it never changes after the process is started.

So, file_exists call is executed with the permissions of the process owner

FractalizeR
I'm just slow typing today. This is the second time someone got the answer out before me.Further reference: http://en.wikipedia.org/wiki/Setuid
Codeacula
@Codeacula I am sorry for that ;)
FractalizeR
Better to get beaten by someone with a good answer than beat someone and have a bad one.
Codeacula
A: 

It's a unix thing:

UID = UserID GID = GroupID

The real UID/GID is the UID/GID of the user/process that created the process.

Kwastie
+1  A: 

All of the files in a Linux system have ownerships and permissions, these permissions describe what access the system's users have to that file or directory. Basic permissions are read, write and execute and are assigned to three classes of user; the owner of the file, processes belonging to a particular group and all of the processes in the system.

You can find detailed report below http://www.linux-tutorial.info/modules.php?name=MContent&pageid=321

Maulik Vora