OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / release / man3 / getpass.3
1 .\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya
31 .\"         all rights reserved.
32 .\" Translated Mon Sep 21 20:47:50 JST 1998 by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
33 .\" Updated&Modified Fri 9 Feb 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
34 .\" Updated 2013-03-26, Akihiro MOTOKI <amotoki@gmail.com>
35 .\" Updated 2013-07-22, Akihiro MOTOKI <amotoki@gmail.com>
36 .\"
37 .TH GETPASS 3 2014\-08\-19 Linux "Linux Programmer's Manual"
38 .SH 名前
39 getpass \- パスワードを取得する
40 .SH 書式
41 \fB#include <unistd.h>\fP
42 .sp
43 \fBchar *getpass(const char *\fP\fIprompt\fP\fB);\fP
44 .sp
45 .in -4n
46 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
47 .in
48 .sp
49 \fBgetpass\fP():
50 .ad l
51 .RS 4
52 .PD 0
53 .TP  4
54 glibc 2.2.2 以降:
55 .nf
56 _BSD_SOURCE ||
57     (_XOPEN_SOURCE\ >=\ 500 ||
58         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
59     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
60 .fi
61 .TP  4
62 glibc 2.2.2 より前:
63 なし
64 .PD
65 .RE
66 .ad b
67 .SH 説明
68 この関数は時代遅れ (obsolete) である。使用しないこと。端末のエコーを有効にせずに入力の読み込みを行いたい場合は、 \fBtermios\fP(3)
69 の \fIECHO\fP フラグの説明を参照のこと。
70 .PP
71 \fBgetpass\fP()  関数は \fI/dev/tty\fP (プロセスの制御端末) をオープンし、文字列 \fIprompt\fP を出力する。そして
72 echo をオフにし、一行 (「パスワード」)  を読み込み、端末の状態を元に戻して、再び \fI/dev/tty\fP をクローズする。
73 .SH 返り値
74 \fBgetpass\fP()  関数は入力されたパスワード (の最初の \fBPASS_MAX\fP バイトまで) が書きこまれた、
75 スタティックなバッファーへのポインターを返す。 末尾の改行は含まれない。この文字列はヌルバイト (\(aq\e0\(aq) で終端される。
76 このバッファーは、以降の関数コールで上書きされるかもしれない。 エラーが起こると、端末の状態を復元し、 \fIerrno\fP を適切な値に設定して、NULL
77 を返す。
78 .SH エラー
79 この関数は以下のような場合に失敗しうる。
80 .TP 
81 \fBENXIO\fP
82 プロセスが制御端末を持っていない。
83 .SH ファイル
84 .\" .SH HISTORY
85 .\" A
86 .\" .BR getpass ()
87 .\" function appeared in Version 7 AT&T UNIX.
88 \fI/dev/tty\fP
89 .SH 属性
90 .SS "マルチスレッディング (pthreads(7) 参照)"
91 \fBgetpass\fP() 関数はスレッドセーフではない。
92 .SH 準拠
93 SUSv2 には存在するが、過去の名残 (LEGACY) と位置付けられている。 POSIX.1\-2001 で削除された。
94 .SH 注意
95 .\" For libc4 and libc5, the prompt is not written to
96 .\" .I /dev/tty
97 .\" but to
98 .\" .IR stderr .
99 .\" Moreover, if
100 .\" .I /dev/tty
101 .\" cannot be opened, the password is read from
102 .\" .IR stdin .
103 .\" The static buffer has length 128 so that only the first 127
104 .\" bytes of the password are returned.
105 .\" While reading the password, signal generation
106 .\" .RB ( SIGINT ,
107 .\" .BR SIGQUIT ,
108 .\" .BR SIGSTOP ,
109 .\" .BR SIGTSTP )
110 .\" is disabled and the corresponding characters
111 .\" (usually control-C, control-\e, control-Z and control-Y)
112 .\" are transmitted as part of the password.
113 .\" Since libc 5.4.19 also line editing is disabled, so that also
114 .\" backspace and the like will be seen as part of the password.
115 .PP
116 GNU C ライブラリの実装では、 \fI/dev/tty\fP がオープンできない場合は \fIprompt\fP は \fIstderr\fP
117 に書き出され、パスワードは \fIstdin\fP から読み込まれた。 パスワードの長さには制限はなく、 行編集も無効にはされなかった。
118 .PP
119 .\" Libc4 and libc5 have never supported
120 .\" .B PASS_MAX
121 .\" or
122 .\" .BR _SC_PASS_MAX .
123 SUSv2 によれば、 \fBPASS_MAX\fP の値が 8 以下の場合は、この値は \fI<limits.h>\fP
124 で定義されていなければならない。 いずれの場合でもこの値は \fIsysconf(_SC_PASS_MAX)\fP によって取得できる。
125 しかし、POSIX.2 は定数 \fBPASS_MAX\fP, \fB_SC_PASS_MAX\fP と関数 \fBgetpass\fP()  を取り下げた。 glibc
126 版は \fB_SC_PASS_MAX\fP を受け付け、 \fBBUFSIZE\fP (例えば 8192) を返す。
127 .SH バグ
128 この関数を呼び出したプロセスは、 できる限り早くそのパスワードを消去 (ゼロクリア) し、 クリアテキストのパスワードが
129 そのプロセスのアドレス空間で見えないようにすべきである。
130 .SH 関連項目
131 \fBcrypt\fP(3)
132 .SH この文書について
133 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
134 である。プロジェクトの説明とバグ報告に関する情報は
135 http://www.kernel.org/doc/man\-pages/ に書かれている。