系统相关
首页 > 系统相关> > linux – getresuid()和setresuid()有什么作用?

linux – getresuid()和setresuid()有什么作用?

作者:互联网

函数getresuid(& arg1,& arg2,& arg3)和setresuid(arg1,arg2,arg3)有什么作用?

如果给出这些函数的真正基本解释,那将是很好的.

解决方法:

credentials(7) man page(删节):

On Linux, each process has the following user and group identifiers:

  • Real user ID and real group ID. These IDs determine who owns the process.

  • Effective user ID and effective group ID. These IDs are used by the kernel to determine the permissions that the process will have when accessing shared resources such as message queues, shared memory, and semaphores. On most UNIX systems, these IDs also determine the permissions when accessing files. However, Linux uses the file system IDs for this task.

  • Saved set-user-ID and saved set-group-ID. These IDs are used in set-user-ID and set-group-ID programs to save a copy of the corresponding effective IDs that were set when the program was executed. A set-user-ID program can assume and drop privileges by switching its effective user ID back and forth between the values in its real user ID and saved set-user-ID.

这些函数在一次调用中获取并设置所有这三个UID.和往常一样,请参阅完整的手册页以获取完整的详细信息.

标签:setuid,linux,unix
来源: https://codeday.me/bug/20190824/1706794.html