aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man2/setresuid.2
blob: 594ecde9a633310cd0d6600e677083fd76df645a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.\" Copyright (c) 2000
.\"      Sheldon Hearn.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES
.\"
.\" %FreeBSD: src/lib/libc/sys/setresuid.2,v 1.14 2002/12/18 09:22:31 ru Exp %
.\"
.\" $FreeBSD$
.Dd April 13, 2001
.Dt SETRESUID 2
.Os
.Sh 名称
.Nm getresgid ,
.Nm getresuid ,
.Nm setresgid ,
.Nm setresuid
.Nd ユーザまたはグループの実 ID、実効 ID、退避 ID を取得もしくは設定する
.Sh ライブラリ
.Lb libc
.Sh 書式
.In sys/types.h
.In unistd.h
.Ft int
.Fn getresgid "gid_t *rgid" "gid_t *egid" "gid_t *sgid"
.Ft int
.Fn getresuid "uid_t *ruid" "uid_t *euid" "uid_t *suid"
.Ft int
.Fn setresgid "gid_t rgid" "gid_t egid" "gid_t sgid"
.Ft int
.Fn setresuid "uid_t ruid" "uid_t euid" "uid_t suid"
.Sh 解説
.Fn setresuid
システムコールは、
現在のプロセスのユーザの実 ID、実効 ID、退避 ID をセットします。
同様に
.Fn setresgid
はグループの実 ID、実効 ID、退避 ID をセットします。
.Pp
特権を持つプロセスは、これらの ID を任意の値にセットできます。
特権を持たないプロセスは、新しい ID のそれぞれが現在の ID のうちの
いずれかと一致しなければならないという制限を受けます。
.Pp
値を変更したくない場合は、対応する引数に -1 を渡します。
.Pp
.Fn getresgid
呼び出しと
.Fn getresuid
呼び出しは、それぞれ現在のプロセスのユーザもしくはグループの
実 ID、実効 ID、退避 ID を取得します。
.Sh 戻り値
.Rv -std
.Sh エラー
.Bl -tag -width Er
.It Bq Er EPERM
呼び出し元プロセスが特権を持っておらず、1 つ以上の ID を
現在の実 ID、実効 ID、退避 ID 以外の値に変更しようとしました。
.It Bq Er EFAULT
.Fn getresgid
もしくは
.Fn getresuid
に渡されたアドレスは不正です。
.El
.Sh 関連項目
.Xr getegid 2 ,
.Xr geteuid 2 ,
.Xr getgid 2 ,
.Xr getuid 2 ,
.Xr issetugid 2 ,
.Xr setgid 2 ,
.Xr setregid 2 ,
.Xr setreuid 2 ,
.Xr setuid 2
.Sh 規格
これらのシステムコールを持たないプラットホームはたくさんあります。
これらは GNU libc2 とリンクされた Linux バイナリを
.Fx
でサポートするために用意されています。
.Sh 歴史
これらの関数は HP-UX ではじめて登場しました。