1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Shadow Password module
Copyright (C) 1998-1999 Takaaki Tateishi <ttate@jaist.ac.jp>
Modified at: <1999/8/19 06:48:01 by ttate>
License: See LICENSE
1.
linuxˤshadow passwordե
Υ⥸塼롣
2. ȡ
ruby extconf.rb
make
make install
*
shadow-1.3Ǥruby-1.3⤷ϤʹߤΥС
ɬפǤ
3. Shadow::Passwd⥸塼Υåã
getspent
getspnam(name)
setspent
endspent
fgetspent(file)
sgetspent(str)
putspent(entry,file)
lckpwdf,lock
ulckpwdf,unlock
lock?
4. Structure
Shadow::Passwd::Entry (Struct::PasswdEntry)
sp_namp - pointer to null-terminated user name.
sp_pwdp - pointer to null-terminated password.
sp_lstchg - days since Jan 1, 1970 password was last
changed.
sp_min - days before which password may not be changed.
sp_max - days after which password must be changed.
sp_warn - days before password is to expire that user is
warned of pending password expiration.
sp_inact - days after password expires that account is
considered inactive and disabled.
sp_expire - days since Jan 1, 1970 when account will be
5.
getspent, getspname, fgetspent, sgetspentShadow::Passwd::Entry
ȥ饯֤ޤgetspent ϥե뤫鼡Υѥ
ɥȥ֤fgetspent Ϳ줿IO鼡Υ
֤ޤsgetspentͿ줿ʸShadow::Passwd::Entry
ȥ饯֤ޤgetspnamϥ桼̾Ϳ/etc/shadow
餽Υ桼Shadow::Passwd::Entryȥ饯֤ޤ
եνüãnil֤ͤޤ
setspent,endspentϤ줾졢եؤΥΤϤ
˻Ȥޤ
lckpwdf(lock),ulckpwdf(unlock)/etc/shadowؤ¾Ū
¸뤿ˤޤ
lock˼ԤShadow::FileLockȤ㳰ȯޤ
lockƥ졼ȤƻȤȤˤäơƥ졼֥åȴ
Ȥ˼ưŪunlockԤʤޤ
6.
* man shadow
* /usr/include/shadow.h
ttate@jaist.ac.jp
|