gpt4 book ai didi

linux - 标识符 PID、PPID、SID、PGID、UID、EUID 是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 00:04:33 47 4
gpt4 key购买 nike

我被分配到

Write a C program that prints the following identifiers PID, PPID, SID, PGID, UID, EUID.

作业接着问

What represents each identifier?

我已经完成了程序,但没有找到对标识符的充分解释。

  • 它们真正代表什么?
  • 特别是 SID 和 PGID 标识符的用途是什么?

最佳答案

他们是这样的

看看this SO Post以及对它们的用途进行健康解释的第一个答案。

来自他们发布的推荐定义页面
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html

3.270 父进程 ID

An attribute of a new process identifying the parent of the process. The parent process ID of a process is the process ID of its creator, for the lifetime of the creator. After the creator's lifetime has ended, the parent process ID is the process ID of an implementation-defined system process.

3.343 session

A collection of process groups established for job control purposes. Each process group is a member of a session. A process is considered to be a member of the session of which its process group is a member. A newly created process joins the session of its creator. A process can alter its session membership; see setsid(). There can be multiple process groups in the same session.

3.296 进程组

A collection of processes that permits the signaling of related processes. Each process in the system is a member of a process group that is identified by a process group ID. A newly created process joins the process group of its creator.

3.297 进程组ID

The unique positive integer identifier representing a process group during its lifetime.

3.142有效用户ID

An attribute of a process that is used in determining various permissions, including file access permissions; see also User ID.


请注意,EUID 和 EGID(效果组 ID)在 Linux 下不用于文件系统权限,而是分别采用文件系统的 FSUID 和 FSGID 字段。

RedHat 6.x 文档中的

Linux 安全功能摘要对这些功能在 Linux 下的行为进行了简洁明了的解释:
http://www.mit.edu/afs.new/athena/system/rhlinux/redhat-6.2-docs/HOWTOS/other-formats/html/Secure-Programs-HOWTO-html/Secure-Programs-HOWTO-3.html

关于linux - 标识符 PID、PPID、SID、PGID、UID、EUID 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41498383/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com