OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / getpass.3
1 .\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\"*******************************************************************
24 .\"
25 .\" This file was generated with po4a. Translate the source file.
26 .\"
27 .\"*******************************************************************
28 .TH GETPASS 3 2010\-09\-20 Linux "Linux Programmer's Manual"
29 .SH 名前
30 getpass \- パスワードを取得する
31 .SH 書式
32 \fB#include <unistd.h>\fP
33 .sp
34 \fBchar *getpass( const char *\fP\fIprompt\fP\fB);\fP
35 .sp
36 .in -4n
37 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
38 .in
39 .sp
40 \fBgetpass\fP():
41 .ad l
42 .RS 4
43 .PD 0
44 .TP  4
45 glibc 2.2.2 以降:
46 .nf
47 _BSD_SOURCE ||
48     (_XOPEN_SOURCE\ >=\ 500 ||
49         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
50     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
51 .TP  4
52 .fi
53 glibc 2.2.2 より前: なし
54 .PD
55 .RE
56 .ad b
57 .SH 説明
58 この関数は obsolete である。用いないこと。
59 .PP
60 \fBgetpass\fP()  関数は \fI/dev/tty\fP (プロセスの制御端末) をオープンし、文字列 \fIprompt\fP を出力する。そして
61 echo をオフにし、一行 (「パスワード」)  を読み込み、端末の状態を元に戻して、再び \fI/dev/tty\fP をクローズする。
62 .SH 返り値
63 \fBgetpass\fP()  関数は入力されたパスワード (の最初の \fBPASS_MAX\fP バイトまで) が書きこまれた、
64 スタティックなバッファーへのポインターを返す。 末尾の改行は含まれない。この文字列は NULL バイト (\(aq\e0\(aq) で終端される。
65 このバッファーは、以降の関数コールで上書きされるかもしれない。 エラーが起こると、端末の状態を復元し、 \fIerrno\fP を適切な値に設定して、NULL
66 を返す。
67 .SH エラー
68 この関数は以下のような場合に失敗しうる。
69 .TP 
70 \fBENXIO\fP
71 プロセスが制御端末を持っていない。
72 .SH ファイル
73 .\" .SH HISTORY
74 .\" A
75 .\" .BR getpass ()
76 .\" function appeared in Version 7 AT&T UNIX.
77 \fI/dev/tty\fP
78 .SH 準拠
79 SUSv2 には存在するが、過去の名残 (LEGACY) と位置付けられている。 POSIX.1\-2001 で削除された。
80 .SH 注意
81 libc4 と libc5 では、 \fIprompt\fP は \fI/dev/tty\fP にではなく \fIstderr\fP に出力された。さらに、
82 \fI/dev/tty\fP がオープンできない場合は、パスワードは \fIstdin\fP から読み込まれた。 スタティックなバッファーの長さは 128
83 バイトだったので、 パスワードの最初の 127 文字だけが返された。 パスワードを読んでいる途中には、シグナルの発行 (\fBSIGINT\fP,
84 \fBSIGQUIT\fP, \fBSIGSTOP\fP, \fBSIGSTOP\fP)  は無効にされ、 それぞれに対応する文字 (通常は Ctrl\-C,
85 Ctrl\-\e, Ctrl\-Z, Ctrl\-Y)  はそのままパスワードの一部として渡された。 libc 5.4.19 からは行編集が無効にされ、
86 したがってバックスペースなどもパスワードの一部とみなされるようになった。
87 .PP
88 glibc2 では、 \fI/dev/tty\fP がオープンできない場合は \fIprompt\fP は \fIstderr\fP に書き出され、パスワードは
89 \fIstdin\fP から読み込まれた。 パスワードの長さには制限はなく、 行編集も無効にはされなかった。
90 .PP
91 SUSv2 によれば、 \fBPASS_MAX\fP の値が 8 以下の場合は、この値は \fI<limits.h>\fP
92 で定義されていなければならない。 いずれの場合でもこの値は \fIsysconf(_SC_PASS_MAX)\fP によって取得できる。
93 しかし、POSIX.2 は定数 \fBPASS_MAX\fP, \fB_SC_PASS_MAX\fP と関数 \fBgetpass\fP()  を取り下げた。 libc4
94 と libc5 では、 \fBPASS_MAX\fP と \fB_SC_PASS_MAX\fP は一度もサポートされたことはない。 glibc2 は
95 \fB_SC_PASS_MAX\fP を受付け、 \fBBUFSIZE\fP (例えば 8192) を返す。
96 .SH バグ
97 この関数を呼び出したプロセスは、 できる限り早くそのパスワードを消去 (ゼロクリア) し、 クリアテキストのパスワードが
98 そのプロセスのアドレス空間で見えないようにすべきである。
99 .SH 関連項目
100 \fBcrypt\fP(3)