OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / getpw.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 19:23:25 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de)
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH GETPW 3 2010\-10\-21 GNU "Linux Programmer's Manual"
36 .SH 名前
37 getpw \- パスワード行エントリを取得する
38 .SH 書式
39 .nf
40 \fB#define _GNU_SOURCE\fP             /* feature_test_macros(7) 参照 */
41 \fB#include <sys/types.h>\fP
42 \fB#include <pwd.h>\fP
43 .sp
44 \fBint getpw(uid_t \fP\fIuid\fP\fB, char *\fP\fIbuf\fP\fB);\fP
45 .fi
46 .SH 説明
47 \fBgetpw\fP()  関数は、バッファ \fIbuf\fP に指定ユーザ ID \fIuid\fP の パスワード行エントリを取得する。
48 返されるバッファは、以下の形式の行を含む。
49 .sp
50 .RS
51 \fBname:passwd:uid:gid:gecos:dir:shell\fP
52 .RE
53 .PP
54 \fIpasswd\fP 構造体は、\fI<pwd.h>\fP で以下のように定義されている:
55 .sp
56 .in +4n
57 .nf
58 struct passwd {
59     char   *pw_name;       /* ユーザ名 */
60     char   *pw_passwd;     /* ユーザのパスワード */
61     uid_t   pw_uid;        /* ユーザ ID */
62     gid_t   pw_gid;        /* グループ ID */
63     char   *pw_gecos;      /* ユーザ情報 */
64     char   *pw_dir;        /* ホームディレクトリ */
65     char   *pw_shell;      /* シェルプログラム */
66 };
67 .fi
68 .in
69 .PP
70 この構造体のフィールドの詳細は \fBpasswd\fP(5)  を参照のこと。
71 .SH 返り値
72 \fBgetpw\fP()  関数は、成功した場合 0 を返す; エラーが発生した場合 \-1 を返し、エラーを 示すために \fIerror\fP がセットされる。
73 .SH エラー
74 .TP 
75 \fBEINVAL\fP
76 \fIbuf\fP が NULL。
77 .TP 
78 \fBENOENT\fP
79 \fIuid\fP に対応するユーザがいない。
80 .TP 
81 \fBENOMEM\fP
82 \fIpasswd\fP 構造体に割り当てるメモリが十分なかった。
83 .SH ファイル
84 .TP 
85 \fI/etc/passwd\fP
86 パスワードデータベースファイル
87 .SH 準拠
88 SVr2
89 .SH バグ
90 \fBgetpw\fP()  関数は、与えられたバッファ \fIbuf\fP がオーバーフローするかもしれないので危険である。 この関数は
91 \fBgetpwuid\fP(3)  によって古いものとなった。
92 .SH 関連項目
93 \fBendpwent\fP(3), \fBfgetpwent\fP(3), \fBgetpwent\fP(3), \fBgetpwnam\fP(3),
94 \fBgetpwuid\fP(3), \fBputpwent\fP(3), \fBsetpwent\fP(3), \fBpasswd\fP(5)