X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=draft%2Fman2%2Fsetfsuid.2;h=0a395c2fb9feaf38924d22b77e69f386c49c8c1f;hb=dd489528aa994f27146acb2bde2db87452ba6e14;hp=4a331752443cf7544e38a8bf9ea004e65c4395a0;hpb=ce024239a1d8e74a7a44f7c24cee4375cb13b3ef;p=linuxjm%2FLDP_man-pages.git diff --git a/draft/man2/setfsuid.2 b/draft/man2/setfsuid.2 index 4a331752..0a395c2f 100644 --- a/draft/man2/setfsuid.2 +++ b/draft/man2/setfsuid.2 @@ -1,5 +1,6 @@ .\" Copyright (C) 1995, Thomas K. Dyas .\" +.\" %%%LICENSE_START(VERBATIM) .\" 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. @@ -19,6 +20,7 @@ .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END .\" .\" Created 1995-08-06 Thomas K. Dyas .\" Modified 2000-07-01 aeb @@ -26,6 +28,12 @@ .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated Sat Mar 1 00:55:10 JST 1997 @@ -34,146 +42,76 @@ .\" by HANATAKA Shinya .\" Modified 2002-09-24 by Akihiro MOTOKI .\" Modified 2005-02-24, Akihiro MOTOKI +.\" Updated 2012-04-30, Akihiro MOTOKI .\" -.\"WORD: identity ID -.\"WORD: kernel カーネル -.\"WORD: file system ファイル・システム -.\"WORD: effective user ID 実効ユーザID -.\"WORD: real user ID 実ユーザID -.\"WORD: signal シグナル -.\"WORD: security hole セキュリティ・ホール -.\"WORD: saved set-user-ID 保存セットユーザID -.\" -.TH SETFSUID 2 2008-12-05 "Linux" "Linux Programmer's Manual" -.\"O .SH NAME -.\"O setfsuid \- set user identity used for file system checks +.TH SETFSUID 2 2013\-08\-08 Linux "Linux Programmer's Manual" .SH 名前 -setfsuid \- ファイル・システムのチェックに用いられるユーザ ID を設定する -.\"O .SH SYNOPSIS +setfsuid \- ファイルシステムのチェックに用いられるユーザ ID を設定する .SH 書式 -.B #include -/* glibc では */ +\fB#include \fP .sp -.BI "int setfsuid(uid_t " fsuid ); -.\"O .SH DESCRIPTION +\fBint setfsuid(uid_t \fP\fIfsuid\fP\fB);\fP .SH 説明 -.\"O The system call -.\"O .BR setfsuid () -.\"O sets the user ID that the Linux kernel uses to check for all accesses -.\"O to the file system. -.\"O Normally, the value of -.\"O .I fsuid -.\"O will shadow the value of the effective user ID. -.\"O In fact, whenever the -.\"O effective user ID is changed, -.\"O .I fsuid -.\"O will also be changed to the new value of the effective user ID. -.BR setfsuid () -は Linux カーネルがファイル・システムに対する -全てのアクセスのチェックに使用するユーザID を設定する。通常は -.I fsuid -の値は実効 (effective) ユーザID と同じになる。実際、 -実効ユーザID が変更される度に -.I fsuid -もまた新しい実効ユーザID の値に変更される。 +The system call \fBsetfsuid\fP() changes the value of the caller's filesystem +user ID\(emthe user ID that the Linux kernel uses to check for all accesses +to the filesystem. Normally, the value of the filesystem user ID will +shadow the value of the effective user ID. In fact, whenever the effective +user ID is changed, the filesystem user ID will also be changed to the new +value of the effective user ID. -.\"O Explicit calls to -.\"O .BR setfsuid () -.\"O and -.\"O .BR setfsgid (2) -.\"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 を変更すると、 -プロセスを望まないシグナルにさらす可能性があり、 -セキュリティ・ホールになる。(下記参照) +通常、 \fBsetfsuid\fP() や \fBsetfsgid\fP() を明示的に呼び出すのは、Linux NFS サーバー のように、 +ファイルアクセスに用いるユーザID / グループID を変更しなければならないが、 対応する実(real)/実効(effective) ユーザID / +グループID は変更したくないような プログラムに限られる。 NFS サーバーのようなプログラムで、通常のユーザID を変更すると、 +プロセスを望まないシグナルにさらす可能性があり、 セキュリティホールになる。(下記参照) -.\"O .BR setfsuid () -.\"O will only succeed if the caller is the superuser or if -.\"O .I fsuid -.\"O matches either the real user ID, effective user ID, saved set-user-ID, or -.\"O the current value of -.\"O .IR fsuid . -.BR setfsuid () -は、スーパー・ユーザによって呼び出された場合か、 -.I fsuid -が実ユーザID、実効ユーザID、 -保存セットユーザID (saved set-user-ID)、現在の -.I fsuid -の値のいずれかに一致する場合にのみ成功する。 -.\"O .SH "RETURN VALUE" +\fBsetfsuid\fP() will succeed only if the caller is the superuser or if +\fIfsuid\fP matches either the caller's real user ID, effective user ID, saved +set\-user\-ID, or current filesystem user ID. .SH 返り値 -.\"O On success, the previous value of -.\"O .I fsuid -.\"O is returned. -.\"O On error, the current value of -.\"O .I fsuid -.\"O is returned. -成功した場合、 -.I fsuid -の以前の値を返す。エラーの場合は -.I fsuid -の現在の値を返す。 -.\"O .SH VERSIONS +On both success and failure, this call returns the previous filesystem user +ID of the caller. .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" +このシステムコールはバージョン 1.2 以降の Linux に存在する。 .SH 準拠 -.\"O .BR setfsuid () -.\"O is Linux-specific and should not be used in programs intended -.\"O to be portable. -.BR setfsuid () -は Linux 特有であり、移植を想定したプログラムで使用してはいけない。 -.\"O .SH NOTES +\fBsetfsuid\fP() は Linux 特有であり、移植を想定したプログラムで使用してはいけない。 .SH 注意 -.\"O When glibc determines that the argument is not a valid user 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 が返される。 +glibc が引き数がユーザID として不正だと判断した場合は、 システムコールを行わず \fIerrno\fP に \fBEINVAL\fP を設定して \-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 +At the time when this system call was introduced, one process could send a +signal to another process with the same effective user ID. This meant that +if a privilged process changed its effective user ID for the purpose of file +permission checking, then it could become vulnerable to receiving signals +sent by another (unprivileged) process with the same user ID. The +filesystem user ID attribute was thus added to allow a process to change its +user ID for the purposes of file permission checking without at the same +time becoming vulnerable to receiving unwanted signals. Since Linux 2.0, +signal permission handling is different (see \fBkill\fP(2)), with the result +that a process change can change its effective user ID without being +vulnerable to receiving signals from unwanted processes. Thus, +\fBsetfsuid\fP() is nowadays unneeded and should be avoided in new +applications (likewise for \fBsetfsgid\fP(2)). + +元々の Linux の \fBsetfsuid\fP() システムコールは +16 ビットのグループ ID だけに対応していた。 +その後、Linux 2.4 で、32 ビットの ID に対応した +\fBsetfsuid32\fP() が追加された。 +glibc の \fBsetfsuid\fP() のラッパー関数は +カーネルバージョンによるこの違いを吸収している。 .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_SETUID -.\"O capability). -いかなる種類のエラー・メッセージも呼び出し元に返さない。 -失敗した場合は (呼び出し元には -.B CAP_SETUID -ケーパビリティがなかったのだから) 最低でも -.B EPERM -くらいは返すべきである。 -.\"O .SH "SEE ALSO" +No error indications of any kind are returned to the caller, and the fact +that both successful and unsuccessful calls return the same value makes it +impossible to directly determine whether the call succeeded or failed. +Instead, the caller must resort to looking at the return value from a +further call such as \fIsetfsuid(\-1)\fP (which will always fail), in order to +determine if a preceding call to \fBsetfsuid\fP() changed the filesystem user +ID. At the very least, \fBEPERM\fP should be returned when the call fails +(because the caller lacks the \fBCAP_SETUID\fP capability). .SH 関連項目 -.BR kill (2), -.BR setfsgid (2), -.BR capabilities (7), -.BR credentials (7) +\fBkill\fP(2), \fBsetfsgid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7) +.SH この文書について +この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部 +である。プロジェクトの説明とバグ報告に関する情報は +http://www.kernel.org/doc/man\-pages/ に書かれている。