getresuid()和setresuid()会做什么? [英] What do getresuid() and setresuid() do?

查看:983
本文介绍了getresuid()和setresuid()会做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

What do the functions getresuid(&arg1,&arg2,&arg3) and setresuid(arg1,arg2,arg3) do?

如果能对这些功能给出真正的基本解释,那就太好了.

It would be great if a really basic explanation of these functions were given.

推荐答案

来自 credentials(7) man页(节略):

From the credentials(7) man page (abridged):

在Linux上,每个进程都有以下用户和组标识符:

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

  • 真实用户ID和真实组ID.这些ID确定谁是进程的所有者.

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

有效的用户ID和有效的组ID.内核使用这些ID来确定进程在访问共享资源(例如消息队列,共享内存和信号灯)时将拥有的权限.在大多数UNIX系统上,这些ID还会确定访问文件时的权限.但是,Linux使用文件系统ID来完成此任务.

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.

已保存的设置用户ID和已保存的设置组ID.这些ID在set-user-ID和set-group-ID程序中使用,以保存执行程序时设置的相应有效ID的副本.设置用户ID程序可以通过在其实际用户ID和已保存的设置用户ID的值之间来回切换其有效用户ID来获得和放弃特权.

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.和往常一样,请参阅完整的手册页以获取完整的详细信息.

Those functions get and set all three of those UIDs in one call. And as always, see the full man page for complete details.

这篇关于getresuid()和setresuid()会做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆