added check: password stored in NIS passwd?
This commit is contained in:
parent
c68b9d1ec2
commit
09f27ea9f3
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
exec scsh -lel expect/load.scm -o threads -o expect -o let-opt -e main -s "$0" "$@"
|
||||
exec scsh -lel expect/load.scm -lel yp/load.scm -o yp -o threads -o expect -o let-opt -e main -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;; TODO:
|
||||
|
@ -165,6 +165,16 @@ Please choose a password with at least 2 character classes.")
|
|||
|
||||
;; *** interface to yppasswd *****************************************
|
||||
|
||||
(define (password-stored-in-yp-passwd? user . args)
|
||||
(let-optionals args
|
||||
((domain (yp-get-default-domain)))
|
||||
(let ((splitter (infix-splitter (rx ":"))))
|
||||
(cond
|
||||
((yp-match "passwd.byname" user domain)
|
||||
=> (lambda (entry)
|
||||
(not (string=? "x" (cadr (splitter entry))))))
|
||||
(else #f)))))
|
||||
|
||||
(define yppasswd
|
||||
(let ((program "/usr/bin/yppasswd"))
|
||||
(case system-type
|
||||
|
@ -192,10 +202,14 @@ Please choose a password with at least 2 character classes.")
|
|||
)))))
|
||||
|
||||
(define (verify-yp-password password)
|
||||
(verify-password yppasswd password))
|
||||
(if (password-stored-in-yp-passwd? (user-login-name))
|
||||
(verify-password yppasswd password)
|
||||
#t))
|
||||
|
||||
(define (change-yp-password old-pw new-pw)
|
||||
(change-password yppasswd old-pw new-pw))
|
||||
(if (password-stored-in-yp-passwd? (user-login-name))
|
||||
(change-password yppasswd old-pw new-pw)
|
||||
#t))
|
||||
|
||||
;; *** Kerberos V interface ******************************************
|
||||
|
||||
|
|
Loading…
Reference in New Issue