Module: Process::Sys
- Defined in:
- process.c
Class Method Summary collapse
-
.getegid ⇒ Object
Returns the effective group ID for this process.
-
.geteuid ⇒ Object
Returns the effective user ID for this process.
-
.getgid ⇒ Object
Returns the (real) group ID for this process.
-
.getuid ⇒ Object
Returns the (real) user ID of this process.
-
.Process::Sys.issetugid ⇒ Boolean
Returns
true
if the process was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privileges were given as a result) or if it has changed any of its real, effective or saved user or group IDs since it began execution. -
.Process::Sys.setegid(group) ⇒ nil
Set the effective group ID of the calling process to group.
-
.Process::Sys.seteuid(user) ⇒ nil
Set the effective user ID of the calling process to user.
-
.Process::Sys.setgid(group) ⇒ nil
Set the group ID of the current process to group.
-
.Process::Sys.setregid(rid, eid) ⇒ nil
Sets the (group) real and/or effective group IDs of the current process to rid and eid, respectively.
-
.Process::Sys.setresgid(rid, eid, sid) ⇒ nil
Sets the (group) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively.
-
.Process::Sys.setresuid(rid, eid, sid) ⇒ nil
Sets the (user) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively.
-
.Process::Sys.setreuid(rid, eid) ⇒ nil
Sets the (user) real and/or effective user IDs of the current process to rid and eid, respectively.
-
.Process::Sys.setrgid(group) ⇒ nil
Set the real group ID of the calling process to group.
-
.Process::Sys.setruid(user) ⇒ nil
Set the real user ID of the calling process to user.
-
.Process::Sys.setuid(user) ⇒ nil
Set the user ID of the current process to user.
Instance Method Summary collapse
-
#getegid ⇒ Fixnum
private
Returns the effective group ID for this process.
-
#geteuid ⇒ Fixnum
private
Returns the effective user ID for this process.
-
#getgid ⇒ Fixnum
private
Returns the (real) group ID for this process.
-
#getuid ⇒ Fixnum
private
Returns the (real) user ID of this process.
-
#Process::Sys.issetugid ⇒ Boolean
private
Returns
true
if the process was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privileges were given as a result) or if it has changed any of its real, effective or saved user or group IDs since it began execution. -
#Process::Sys.setegid(group) ⇒ nil
private
Set the effective group ID of the calling process to group.
-
#Process::Sys.seteuid(user) ⇒ nil
private
Set the effective user ID of the calling process to user.
-
#Process::Sys.setgid(group) ⇒ nil
private
Set the group ID of the current process to group.
-
#Process::Sys.setregid(rid, eid) ⇒ nil
private
Sets the (group) real and/or effective group IDs of the current process to rid and eid, respectively.
-
#Process::Sys.setresgid(rid, eid, sid) ⇒ nil
private
Sets the (group) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively.
-
#Process::Sys.setresuid(rid, eid, sid) ⇒ nil
private
Sets the (user) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively.
-
#Process::Sys.setreuid(rid, eid) ⇒ nil
private
Sets the (user) real and/or effective user IDs of the current process to rid and eid, respectively.
-
#Process::Sys.setrgid(group) ⇒ nil
private
Set the real group ID of the calling process to group.
-
#Process::Sys.setruid(user) ⇒ nil
private
Set the real user ID of the calling process to user.
-
#Process::Sys.setuid(user) ⇒ nil
private
Set the user ID of the current process to user.
Class Method Details
.egid ⇒ Fixnum .Process::GID.eid ⇒ Fixnum .Process::Sys.geteid ⇒ Fixnum
6051 6052 6053 6054 6055 6056 6057 |
# File 'process.c', line 6051
static VALUE
proc_getegid(VALUE obj)
{
rb_gid_t egid = getegid();
return GIDT2NUM(egid);
}
|
.euid ⇒ Fixnum .Process::UID.eid ⇒ Fixnum .Process::Sys.geteuid ⇒ Fixnum
5925 5926 5927 5928 5929 5930 |
# File 'process.c', line 5925
static VALUE
proc_geteuid(VALUE obj)
{
rb_uid_t euid = geteuid();
return UIDT2NUM(euid);
}
|
.gid ⇒ Fixnum .Process::GID.rid ⇒ Fixnum .Process::Sys.getgid ⇒ Fixnum
5366 5367 5368 5369 5370 5371 |
# File 'process.c', line 5366
static VALUE
proc_getgid(VALUE obj)
{
rb_gid_t gid = getgid();
return GIDT2NUM(gid);
}
|
.uid ⇒ Fixnum .Process::UID.rid ⇒ Fixnum .Process::Sys.getuid ⇒ Fixnum
4958 4959 4960 4961 4962 4963 |
# File 'process.c', line 4958
static VALUE
proc_getuid(VALUE obj)
{
rb_uid_t uid = getuid();
return UIDT2NUM(uid);
}
|
.Process::Sys.issetugid ⇒ Boolean
Returns true
if the process was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privileges were given as a result) or if it has changed any of its real, effective or saved user or group IDs since it began execution.
5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 |
# File 'process.c', line 5339
static VALUE
p_sys_issetugid(VALUE obj)
{
rb_secure(2);
if (issetugid()) {
return Qtrue;
}
else {
return Qfalse;
}
}
|
.Process::Sys.setegid(group) ⇒ nil
Set the effective group ID of the calling process to group. Not available on all platforms.
5264 5265 5266 5267 5268 5269 5270 5271 |
# File 'process.c', line 5264
static VALUE
p_sys_setegid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setegid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.seteuid(user) ⇒ nil
Set the effective user ID of the calling process to user. Not available on all platforms.
4884 4885 4886 4887 4888 4889 4890 4891 |
# File 'process.c', line 4884
static VALUE
p_sys_seteuid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (seteuid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setgid(group) ⇒ nil
Set the group ID of the current process to group. Not available on all platforms.
5218 5219 5220 5221 5222 5223 5224 5225 |
# File 'process.c', line 5218
static VALUE
p_sys_setgid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setgid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setregid(rid, eid) ⇒ nil
Sets the (group) real and/or effective group IDs of the current process to rid and eid, respectively. A value of -1
for either means to leave that ID unchanged. Not available on all platforms.
5289 5290 5291 5292 5293 5294 5295 5296 |
# File 'process.c', line 5289
static VALUE
p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setregid(OBJ2GID(rid), OBJ2GID(eid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setresgid(rid, eid, sid) ⇒ nil
Sets the (group) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all platforms.
5313 5314 5315 5316 5317 5318 5319 5320 |
# File 'process.c', line 5313
static VALUE
p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setresgid(OBJ2GID(rid), OBJ2GID(eid), OBJ2GID(sid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setresuid(rid, eid, sid) ⇒ nil
Sets the (user) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all platforms.
4934 4935 4936 4937 4938 4939 4940 4941 |
# File 'process.c', line 4934
static VALUE
p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setresuid(OBJ2UID(rid), OBJ2UID(eid), OBJ2UID(sid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setreuid(rid, eid) ⇒ nil
Sets the (user) real and/or effective user IDs of the current process to rid and eid, respectively. A value of -1
for either means to leave that ID unchanged. Not available on all platforms.
4909 4910 4911 4912 4913 4914 4915 4916 |
# File 'process.c', line 4909
static VALUE
p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setreuid(OBJ2UID(rid), OBJ2UID(eid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setrgid(group) ⇒ nil
Set the real group ID of the calling process to group. Not available on all platforms.
5241 5242 5243 5244 5245 5246 5247 5248 |
# File 'process.c', line 5241
static VALUE
p_sys_setrgid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setrgid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setruid(user) ⇒ nil
Set the real user ID of the calling process to user. Not available on all platforms.
4861 4862 4863 4864 4865 4866 4867 4868 |
# File 'process.c', line 4861
static VALUE
p_sys_setruid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setruid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
.Process::Sys.setuid(user) ⇒ nil
Set the user ID of the current process to user. Not available on all platforms.
4838 4839 4840 4841 4842 4843 4844 4845 |
# File 'process.c', line 4838
static VALUE
p_sys_setuid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setuid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
Instance Method Details
#egid ⇒ Fixnum (private) #Process::GID.eid ⇒ Fixnum (private) #Process::Sys.geteid ⇒ Fixnum (private)
6051 6052 6053 6054 6055 6056 6057 |
# File 'process.c', line 6051
static VALUE
proc_getegid(VALUE obj)
{
rb_gid_t egid = getegid();
return GIDT2NUM(egid);
}
|
#euid ⇒ Fixnum (private) #Process::UID.eid ⇒ Fixnum (private) #Process::Sys.geteuid ⇒ Fixnum (private)
5925 5926 5927 5928 5929 5930 |
# File 'process.c', line 5925
static VALUE
proc_geteuid(VALUE obj)
{
rb_uid_t euid = geteuid();
return UIDT2NUM(euid);
}
|
#gid ⇒ Fixnum (private) #Process::GID.rid ⇒ Fixnum (private) #Process::Sys.getgid ⇒ Fixnum (private)
5366 5367 5368 5369 5370 5371 |
# File 'process.c', line 5366
static VALUE
proc_getgid(VALUE obj)
{
rb_gid_t gid = getgid();
return GIDT2NUM(gid);
}
|
#uid ⇒ Fixnum (private) #Process::UID.rid ⇒ Fixnum (private) #Process::Sys.getuid ⇒ Fixnum (private)
4958 4959 4960 4961 4962 4963 |
# File 'process.c', line 4958
static VALUE
proc_getuid(VALUE obj)
{
rb_uid_t uid = getuid();
return UIDT2NUM(uid);
}
|
#Process::Sys.issetugid ⇒ Boolean (private)
Returns true
if the process was created as a result of an execve(2) system call which had either of the setuid or setgid bits set (and extra privileges were given as a result) or if it has changed any of its real, effective or saved user or group IDs since it began execution.
5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 |
# File 'process.c', line 5339
static VALUE
p_sys_issetugid(VALUE obj)
{
rb_secure(2);
if (issetugid()) {
return Qtrue;
}
else {
return Qfalse;
}
}
|
#Process::Sys.setegid(group) ⇒ nil (private)
Set the effective group ID of the calling process to group. Not available on all platforms.
5264 5265 5266 5267 5268 5269 5270 5271 |
# File 'process.c', line 5264
static VALUE
p_sys_setegid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setegid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.seteuid(user) ⇒ nil (private)
Set the effective user ID of the calling process to user. Not available on all platforms.
4884 4885 4886 4887 4888 4889 4890 4891 |
# File 'process.c', line 4884
static VALUE
p_sys_seteuid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (seteuid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setgid(group) ⇒ nil (private)
Set the group ID of the current process to group. Not available on all platforms.
5218 5219 5220 5221 5222 5223 5224 5225 |
# File 'process.c', line 5218
static VALUE
p_sys_setgid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setgid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setregid(rid, eid) ⇒ nil (private)
Sets the (group) real and/or effective group IDs of the current process to rid and eid, respectively. A value of -1
for either means to leave that ID unchanged. Not available on all platforms.
5289 5290 5291 5292 5293 5294 5295 5296 |
# File 'process.c', line 5289
static VALUE
p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setregid(OBJ2GID(rid), OBJ2GID(eid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setresgid(rid, eid, sid) ⇒ nil (private)
Sets the (group) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all platforms.
5313 5314 5315 5316 5317 5318 5319 5320 |
# File 'process.c', line 5313
static VALUE
p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setresgid(OBJ2GID(rid), OBJ2GID(eid), OBJ2GID(sid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setresuid(rid, eid, sid) ⇒ nil (private)
Sets the (user) real, effective, and saved user IDs of the current process to rid, eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all platforms.
4934 4935 4936 4937 4938 4939 4940 4941 |
# File 'process.c', line 4934
static VALUE
p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setresuid(OBJ2UID(rid), OBJ2UID(eid), OBJ2UID(sid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setreuid(rid, eid) ⇒ nil (private)
Sets the (user) real and/or effective user IDs of the current process to rid and eid, respectively. A value of -1
for either means to leave that ID unchanged. Not available on all platforms.
4909 4910 4911 4912 4913 4914 4915 4916 |
# File 'process.c', line 4909
static VALUE
p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setreuid(OBJ2UID(rid), OBJ2UID(eid)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setrgid(group) ⇒ nil (private)
Set the real group ID of the calling process to group. Not available on all platforms.
5241 5242 5243 5244 5245 5246 5247 5248 |
# File 'process.c', line 5241
static VALUE
p_sys_setrgid(VALUE obj, VALUE id)
{
PREPARE_GETGRNAM;
check_gid_switch();
if (setrgid(OBJ2GID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setruid(user) ⇒ nil (private)
Set the real user ID of the calling process to user. Not available on all platforms.
4861 4862 4863 4864 4865 4866 4867 4868 |
# File 'process.c', line 4861
static VALUE
p_sys_setruid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setruid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|
#Process::Sys.setuid(user) ⇒ nil (private)
Set the user ID of the current process to user. Not available on all platforms.
4838 4839 4840 4841 4842 4843 4844 4845 |
# File 'process.c', line 4838
static VALUE
p_sys_setuid(VALUE obj, VALUE id)
{
PREPARE_GETPWNAM;
check_uid_switch();
if (setuid(OBJ2UID(id)) != 0) rb_sys_fail(0);
return Qnil;
}
|