PHP 和 file_exists - 文档注释的澄清
我正在检查 file_exists()
< 的文档/a> PHP 函数。
该文档在某个时候写道:
检查是使用真实的UID/GID而不是有效的UID/GID来完成的。
这意味着什么?我不知道。
有人可以向我解释一下吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是 unix 的事情:
UID = UserID
GID = GroupID
真正的UID/GID是创建进程的用户/进程的UID/GID。
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.
Linux 系统中的所有文件都具有所有权和权限,这些权限描述了系统用户对该文件或目录的访问权限。基本权限为读、写和执行,并分配给三类用户;文件的所有者、属于特定组的进程以及系统中的所有进程。
您可以在下面找到详细报告
http://www.linux-tutorial.info/modules。 php?name=MContent&pageid=321
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
有效UID/GID是软件当前正在使用的UID/GID(例如,root执行的软件可以将其UID/GID更改为daemon:daemon,因此有效UID/GID也会更改。真实UID/GID是进程所有者的UID/GID在进程启动后不会改变,
因此,file_exists调用是在进程所有者的权限下执行的。
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