jpman project specific RCS keyword (jpman %Id) is obsolete, after manual entries are stored in freefall CVS repository. This old Id is useless and more worse it confuses users and bug reporters. So, this old Id is removed. Submitted by:jpman project <man-jp@jp.FreeBSD.org>
80 lines
2.5 KiB
Groff
80 lines
2.5 KiB
Groff
.\" 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.2.2.4 2000/12/29 14:44:53 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd January 17, 2000
|
|
.Dt SETRESUID 2
|
|
.Os
|
|
.Sh 名称
|
|
.Nm setresgid ,
|
|
.Nm setresuid
|
|
.Nd ユーザまたはグループの実 ID、実効 ID、退避 ID をセットする
|
|
.Sh ライブラリ
|
|
.Lb libc
|
|
.Sh 書式
|
|
.Fd #include <sys/types.h>
|
|
.Fd #include <unistd.h>
|
|
.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 解説
|
|
.Nm setresuid
|
|
システムコールは、
|
|
現在のプロセスのユーザの実 ID、実効 ID、退避 ID をセットします。
|
|
同様に
|
|
.Nm setresgid
|
|
はグループの実 ID、実効 ID、退避 ID をセットします。
|
|
.Pp
|
|
特権を持つプロセスはこれらの ID を任意の値にセットできます。
|
|
特権を持たないプロセスは、新しい ID のそれぞれが現在の ID のうちの
|
|
いずれかと一致しなければならないという制限を受けます。
|
|
.Pp
|
|
値を変更したくない場合は対応する引数に -1 を渡します。
|
|
.Sh 戻り値
|
|
これらの関数は正常に完了すると値 0 を返します。
|
|
そうでない場合は値 -1 が返され、
|
|
エラーを示すためにグローバル変数
|
|
.Va errno
|
|
が設定されます。
|
|
.Sh エラー
|
|
.Bl -tag -width Er
|
|
.It Er EPERM
|
|
呼び出し元プロセスが特権を持っておらず、
|
|
1 つ以上の ID を現在の実 ID、実効 ID、退避 ID 以外の値に変更しようとしました。
|
|
.El
|
|
.Sh 関連項目
|
|
.Xr getegid 2 ,
|
|
.Xr geteuid 2 ,
|
|
.Xr getgid 2 ,
|
|
.Xr getuid 2 ,
|
|
.Xr isssetugid 2 ,
|
|
.Xr setgid 2 ,
|
|
.Xr setregid 2 ,
|
|
.Xr setreuid 2 ,
|
|
.Xr setuid 2 ,
|
|
.Sh 規格
|
|
これらのシステムコールを持たないプラットホームはたくさんあります。
|
|
これらは GNU libc2 とリンクされた Linux バイナリを
|
|
.Fx
|
|
でサポートするために用意されています。
|
|
.Sh 歴史
|
|
これらのシステムコールは HP-UX で登場しました。
|