Initial commit for Tizen
[profile/extras/shadow-utils.git] / man / ja / shadow.3
1 .\" $Id: shadow.3 1342 2007-11-10 23:46:11Z nekral-guest $
2 .\" Copyright 1989 - 1993, Julianne Frances Haugh
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
14 .\"    may be used to endorse or promote products derived from this software
15 .\"    without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\" Japanese Version Copyright (c) 1997 Kazuyoshi Furutaka
30 .\"         all rights reserved.
31 .\" Translated Fri Feb 14 23:06:00 JST 1997
32 .\"         by Kazuyoshi Furutaka <furutaka@Flux.tokai.jaeri.go.jp>
33 .\" updated Tue 17 Sep 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
34 .\"
35 .TH SHADOW 3
36 .SH 名前
37 shadow \- 暗号化されたパスワードファイル用ルーチン
38 .SH 書式
39 .B #include <shadow.h>
40 .PP
41 .B struct spwd *getspent();
42 .PP
43 .B struct spwd *getspnam(char
44 .IB *name );
45 .PP
46 .B void setspent();
47 .PP
48 .B void endspent();
49 .PP
50 .B struct spwd *fgetspent(FILE
51 .IB *fp );
52 .PP
53 .B struct spwd *sgetspent(char
54 .IB *cp );
55 .PP
56 .B int putspent(struct spwd
57 .I *p,
58 .B FILE
59 .IB *fp );
60 .PP
61 .B int lckpwdf();
62 .PP
63 .B int ulckpwdf();
64 .SH 説明
65 .I shadow
66 は shadow パスワードファイル
67 \fI/etc/shadow\fR の内容を操作するルーチンである。
68 \fI#include\fR ファイルに与えられている構造体は以下の通り。
69 .sp
70 struct spwd {
71 .in +.5i
72 .br
73         char    *sp_namp; /* user login name */
74 .br
75         char    *sp_pwdp; /* encrypted password */
76 .br
77         long    sp_lstchg; /* last password change */
78 .br
79         int     sp_min; /* days until change allowed. */
80 .br
81         int     sp_max; /* days before change required */
82 .br
83         int     sp_warn; /* days warning for expiration */
84 .br
85         int     sp_inact; /* days before account inactive */
86 .br
87         int     sp_expire; /* date when account expires */
88 .br
89         int     sp_flag; /* reserved for future use */
90 .br
91 .in \-.5i
92 }
93 .PP
94 各フィールドの意味は:
95 .sp
96 sp_namp \- ヌル終端されたユーザ名文字列へのポインタ
97 .br
98 sp_pwdp \- ヌル終端されたパスワード文字列へのポインタ
99 .br
100 sp_lstchg \- 1970年1月1日からパスワード最終変更日時迄の日数
101 .br
102 sp_min \- パスワード変更が出来るようになるまでの日数
103 .br
104 sp_max \- パスワードを変更しなくても良い日数
105 .br
106 sp_warn \- パスワードが期限切れになる前に、
107 期限切れが近づいている旨の警告をユーザに出す期間の日数
108 .br
109 sp_inact \- パスワードが期限切れになってから、
110 アカウントが不能となり使用できなくなるまでの日数
111 .br
112 sp_expire \- 1970年1月1からアカウントが使用不能となる日迄の日数
113 .br
114 sp_flag \- 将来使うときに向けて予約
115 .SH 説明
116 \fBgetspent\fR, \fBgetspname\fR, \fBfgetspent\fR, \fBsgetspent\fR
117 は、それぞれ \fBstruct spwd\fR へのポインタを返す。
118 \fBgetspent\fR はファイルから次のエントリを、
119 \fBfgetspent\fR は指定されたストリーム
120 (正しい書式のファイルとみなされる)
121 から次のエントリを返す。
122 \fBsgetspent\fR は入力として与えられた文字列を用いて
123 \fBstruct spwd\fR へのポインタを返す。
124 \fBgetspnam\fR はファイル中の現在の位置から
125 \fBname\fR にマッチするエントリを探す。
126 .PP
127 \fBsetspent\fR は
128 shadow パスワードファイルへのアクセスを開始するために、
129 \fBendspent\fR は終了するために用いられる。
130 .PP
131 \fI/etc/shadow\fR ファイルに対する排他的なアクセスを保証したい場合には、
132 \fBlckpwdf\fR ルーチンと \fBulckpwdf\fR ルーチンを用いる。
133 \fBlckpwdf\fR は \fBpw_lock\fR を用いて最大 15 秒間ロックを取得しようとする。
134 そして最初の 15 秒の残りの間、
135 \fBspw_lock\fR によって二度目のロックをしようと試み続ける。
136 計 15 秒間の間にいずれかの試みが失敗した場合は、
137 \fBlckpwdf\fR は \-1 を返す。
138 いずれのロックも成功した場合は 0 が返される。
139 .SH 返り値
140 これらのルーチンは、エントリが残っていない場合や、
141 処理の過程でエラーが発生した場合には NULL を返す。
142 返り値が \fBint\fR であるルーチンは、
143 成功したら 0 を、失敗したら \-1 を返す。
144 .SH 警告
145 shadowされたパスワードファイルへのアクセスは制限されているので、
146 これらのルーチンはスーパーユーザだけが利用できる。
147 .SH ファイル
148 \fI/etc/shadow\fR \- 暗号化されたユーザパスワード
149 .SH 関連項目
150 .BR getpwent (3),
151 .BR shadow (5)
152 .SH 著者
153 Julianne Frances Haugh (jockgrrl@ix.netcom.com)