没有了vfork()的孩子拥有什么权限? [英] What Privileges does vfork() child possess ?
问题描述
用vfork()创建的进程是否具有与创建者进程(即父进程)相同级别的特权?
Does the process created with vfork() has same the same level of privileges that of a creator process i.e parent process ?
例如:如果我运行一个过程作为根确实的vfork()子具有相同的执行特权?
example : If I run a process as root does vfork() child possess the same execution privileges?
推荐答案
在
功能必须创建一个新的过程.新进程(子 过程)应调用进程的精确副本(父 过程)除以下详述的:
The
fork()
function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:
由于该文本下方未提及UID/GID,因此您可以推断出这些属性是继承的.
As there is no mention of UIDs/GIDs below that text, you can deduce that these properties are inherited.
这些性质最终通过改变函数的调用来适当属性改变(
These properties are eventually changed by calls to appropriate property changing functions (setuid
, etc) or exec
.
在旧(POSIX 2004或更早)的
The old (POSIX 2004 or earlier) specification of vfork()
is similar:
在
函数应当相当于 ,不同之处在于,如果处理由所创建的行为是未定义 任一修改比类型的变量之外的任何数据 用于从存储返回值 ,或从其中 叫,或成功地调用之前调用的任何其他功能的功能返回 或功能的 家族中的一个.
The
vfork()
function shall be equivalent tofork()
, except that the behavior is undefined if the process created byvfork()
either modifies any data other than a variable of typepid_t
used to store the return value fromvfork()
, or returns from the function in whichvfork()
was called, or calls any other function before successfully calling_exit()
or one of theexec
family of functions.
的规格
The specification of vfork()
was removed from POSIX 2008 (aka POSIX 2016).
这篇关于没有了vfork()的孩子拥有什么权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!