.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Fri Jul 29th 12:56:44 BST 1994 Wilf. .\" Modified 1997-01-31 by Eric S. Raymond .\" Modified 2002-03-09 by aeb .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Sat Mar 1 16:31:56 JST 1997 .\" by HANATAKA Shinya .\" Updated Fri Feb 7 JST 2003 by Kentaro Shirakata .\" .\"WORD: identity 識別 .\"WORD: effective group ID 実効グループID .\"WORD: real group ID 実グループID .\"WORD: saved set-group-ID 保存セットグループID .\"WORD: implement 実装 .\"WORD: superuser スーパー・ユーザー .\" .TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O setgid \- set group identity setgid \- グループ識別(identity)を設定する .\"O .SH SYNOPSIS .SH 書式 .B #include .br .B #include .sp .BI "int setgid(gid_t " gid ); .\"O .SH DESCRIPTION .SH 説明 .\"O .BR setgid () .\"O sets the effective group ID of the calling process. .\"O If the caller is the .\"O superuser, the real GID and saved set-group-ID are also set. .BR setgid () は呼び出し元のプロセスの実効 (effective) グループID を設定する。 もしスーパー・ユーザーによって呼び出された場合は、 実 (real) グループID と保存 (saved) set-group-ID も設定される。 .\"O Under Linux, .\"O .BR setgid () .\"O is implemented like the POSIX version with the .\"O .B _POSIX_SAVED_IDS .\"O feature. .\"O This allows a set-group-ID program that is not set-user-ID-root .\"O to drop all of its group .\"O privileges, do some un-privileged work, and then reengage the original .\"O effective group ID in a secure manner. Linux において、 .BR setgid () は .B _POSIX_SAVED_IDS をもった POSIX 版のように実装されている。 これは set-user-ID-root でない set-group-ID プログラムにそのグループの 特権の全て落とし、特権の必要ない仕事をし、本来の実効グループID に 安全な方法で再び戻すことを許す。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned, and .\"O .I errno .\"O is set appropriately. 成功した場合はゼロが返される。エラーの場合は \-1 が返され、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EPERM .\"O The calling process is not privileged (does not have the .\"O \fBCAP_SETGID\fP capability), and .\"O .I gid .\"O does not match the real group ID or saved set-group-ID of .\"O the calling process. 呼び出し元のプロセスに権限がなく (\fBCAP_SETGID\fP ケーパビリティがなく)、かつ .I gid が呼び出し元のプロセスの実グループID と保存セットグループID のどちらとも一致しない。 .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, POSIX.1-2001. .\"O .SH "SEE ALSO" .SH 関連項目 .BR getgid (2), .BR setegid (2), .BR setregid (2), .BR capabilities (7), .BR credentials (7)