.\" Copyright (C) 1995, Thomas K. Dyas .\" .\" 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. .\" .\" Created 1995-08-06 Thomas K. Dyas .\" Modified 2000-07-01 aeb .\" Modified 2002-07-23 aeb .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Sat Mar 1 00:54:23 JST 1997 .\" by HANATAKA Shinya .\" Modified Mon Sep 23 21:21:54 JST 2000 .\" by HANATAKA Shinya .\" Modified 2002-09-24 by Akihiro MOTOKI .\" Modified 2005-02-24, Akihiro MOTOKI .\" .\"WORD: identity ID .\"WORD: kernel カーネル .\"WORD: file system ファイル・システム .\"WORD: effective group ID 実効グループID .\"WORD: real group ID 実グループID .\"WORD: signal シグナル .\"WORD: security hole セキュリティ・ホール .\"WORD: saved set-group-ID 保存セットグループID .\" .TH SETFSGID 2 2008-12-05 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .\"O setfsgid \- set group identity used for file system checks .SH 名前 setfsgid \- ファイル・システムのチェックに用いられるグループ ID を設定する .\"O .SH SYNOPSIS .SH 書式 .B #include /* glibc では */ .sp .BI "int setfsgid(uid_t " fsgid ); .\"O .SH DESCRIPTION .SH 説明 .\"O The system call .\"O .BR setfsgid () .\"O sets the group ID that the Linux kernel uses to check for all accesses .\"O to the file system. .\"O Normally, the value of .\"O .I fsgid .\"O will shadow the value of the effective group ID. .\"O In fact, whenever the .\"O effective group ID is changed, .\"O .I fsgid .\"O will also be changed to the new value of the effective group ID. システムコール .BR setfsgid () は Linux カーネルがファイル・システムに対する 全てのアクセスのチェックに使用するグループ IDを設定する。通常は .I fsgid の値は実効 (effective) グループID と同じになる。実際、 実効グループ ID が変更される度に .I fsgid もまた新しい実効グループID の値に変更される。 .\"O Explicit calls to .\"O .BR setfsuid (2) .\"O and .\"O .BR setfsgid () .\"O are usually only used by programs such as the Linux NFS server that .\"O need to change what user and group ID is used for file access without a .\"O corresponding change in the real and effective user and group IDs. .\"O A change in the normal user IDs for a program such as the NFS server .\"O is a security hole that can expose it to unwanted signals. .\"O (But see below.) 通常、 .BR setfsuid () や .BR setfsgid () が明示的に呼び出されるのは、Linux NFS サーバー のように、 ファイル・アクセスに用いるユーザID / グループID を変更しなければならないが、 対応する実(real)/実効(effective) ユーザID / グループID は変更したくないような プログラムに限られる。 NFS サーバーのようなプログラムで、通常のユーザID を変更すると、 プロセスを望まないシグナルにさらす可能性があり、 セキュリティ・ホールになる。(下記参照) .\"O .BR setfsgid () .\"O will only succeed if the caller is the superuser or if .\"O .I fsgid .\"O matches either the real group ID, effective group ID, .\"O saved set-group-ID, or the current value of .\"O .IR fsgid . .BR setfsgid () は、スーパー・ユーザによって呼び出された場合か、 .I fsgid が実グループID、実効グループID、 保存セットグループID (saved set-group-ID)、現在の .I fsgid の値のいずれかに一致する場合にのみ成功する。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, the previous value of .\"O .I fsgid .\"O is returned. .\"O On error, the current value of .\"O .I fsgid .\"O is returned. 成功した場合、 .I fsgid の以前の値を返す。エラーの場合は .I fsgid の現在の値を返す。 .\"O .SH VERSIONS .SH バージョン .\"O This system call is present in Linux since version 1.2. このシステムコールはバージョン 1.2 以降の Linux に存在する。 .\" This system call is present since Linux 1.1.44 .\" and in libc since libc 4.7.6. .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR setfsgid () .\"O is Linux-specific and should not be used in programs intended .\"O to be portable. .BR setfsgid () は Linux 特有であり、移植を想定したプログラムで使用してはいけない。 .\"O .SH NOTES .SH 注意 .\"O When glibc determines that the argument is not a valid group ID, .\"O it will return \-1 and set \fIerrno\fP to .\"O .B EINVAL .\"O without attempting .\"O the system call. glibc が引き数がグループID として不正だと判断した場合は、 システム・コールを行わず \fIerrno\fP に .B EINVAL を設定して \-1 が返される。 .LP .\"O Note that at the time this system call was introduced, a process .\"O could send a signal to a process with the same effective user ID. .\"O Today signal permission handling is slightly different. このシステムコールが導入された当時、プロセスは 同じ実効ユーザIDのプロセスへシグナルを送ることができた。 今日では、シグナル送信権限の扱いはかなり違うものになっている。 .\"O .SH BUGS .SH バグ .\"O No error messages of any kind are returned to the caller. .\"O At the very .\"O least, .\"O .B EPERM .\"O should be returned when the call fails (because the caller lacks the .\"O .B CAP_SETGID .\"O capability). いかなる種類のエラー・メッセージも返さない。 失敗した場合は (呼び出し元には .B CAP_SETGID ケーパビリティがなかったのだから) 最低でも .B EPERM くらいは返すべきである。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR kill (2), .BR setfsuid (2), .BR capabilities (7), .BR credentials (7)