support for linux

This commit is contained in:
eknauel 2004-11-12 13:13:58 +00:00
parent d016ba79d9
commit 08b2fa0f6f
1 changed files with 24 additions and 12 deletions

View File

@ -96,7 +96,7 @@ Please choose a password with at least 2 character classes.")
(cond (cond
((string=? systype "sun4x_59") 'solaris) ((string=? systype "sun4x_59") 'solaris)
((string=? systype "i386_fbsd52") 'freebsd) ((string=? systype "i386_fbsd52") 'freebsd)
((string=? systype "i386_linux24") 'linux) ((string=? systype "i386_rh90") 'linux)
(else (raise-unsupported-machine))))) (else (raise-unsupported-machine)))))
;; *** general password interface ************************************ ;; *** general password interface ************************************
@ -226,17 +226,22 @@ Please choose a password with at least 2 character classes.")
"Password incorrect while getting initial ticket" "Password incorrect while getting initial ticket"
"Password mismatch while reading password" "Password mismatch while reading password"
"Password changed.")) "Password changed."))
;; ((linux) (define-passwd "/afs/wsi/i386_rh90/heimdal-0.6/bin/kpasswd" ((linux) (define-passwd "/afs/wsi/i386_rh90/heimdal-0.6/bin/kpasswd"
;; ;; TODO "Password: "
;; )) "New password: "
)) "Verifying - New password: "
"kpasswd: Password incorrect"
"Verify failure"
"Success"))))
(define kerbv-programs (define kerbv-programs
(case system-type (case system-type
((freebsd) (cons "/afs/wsi/i386_fbsd52/heimdal-1.6/bin/klist" ((freebsd) (cons "/afs/wsi/i386_fbsd52/heimdal-1.6/bin/klist"
"/afs/wsi/i386_fbsd52/heimdal-1.6/bin/kinit")) "/afs/wsi/i386_fbsd52/heimdal-1.6/bin/kinit"))
((solaris) (cons "/afs/wsi/sun4x_58/heimdal-0.6/bin/klist" ((solaris) (cons "/afs/wsi/sun4x_58/heimdal-0.6/bin/klist"
"/afs/wsi/sun4x_58/heimdal-0.6/bin/kinit")))) "/afs/wsi/sun4x_58/heimdal-0.6/bin/kinit"))
((linux) (cons "/afs/wsi/i386_rh90/heimdal-0.6/bin/klist"
"/afs/wsi/i386_rh90/heimdal-0.6/bin/kinit"))))
(define (verify-kerbv-password password) (define (verify-kerbv-password password)
(verify-password kerberos-v password)) (verify-password kerberos-v password))
@ -284,6 +289,7 @@ Please choose a password with at least 2 character classes.")
"Retype new password: " "Retype new password: "
;; Attention: the old password is checked AFTER the ;; Attention: the old password is checked AFTER the
;; new password is entered! So verify will not work! ;; new password is entered! So verify will not work!
;; However: changing old-pw to old-pw works fine
"kpasswd: Incorrect old password." "kpasswd: Incorrect old password."
"Mismatch" "Mismatch"
"Password changed.")) "Password changed."))
@ -294,10 +300,16 @@ Please choose a password with at least 2 character classes.")
"kpasswd: Incorrect old password." "kpasswd: Incorrect old password."
"Mismatch" "Mismatch"
"Password changed.")) "Password changed."))
;; ((linux) (define-passwd "/usr/bin/kpasswd" ((linux) (define-passwd "/afs/wsi/i386_rh90/openafs-1.2.11/bin/kpasswd"
;; ;; TODO "Old password: "
;; )) (rx "New password (RETURN to abort): ")
)) "Retype new password: "
;; Attention: the old password is checked AFTER the
;; new password is entered! So verify will not work!
;; However: changing old-pw to old-pw works fine
"kpasswd: Incorrect old password."
"Mismatch"
"Password changed."))))
(define (change-afs-password old-pw new-pw) (define (change-afs-password old-pw new-pw)
(change-password afs old-pw new-pw)) (change-password afs old-pw new-pw))
@ -389,7 +401,7 @@ Please choose a password with at least 2 character classes.")
(define (display-usage) (define (display-usage)
(display "Usage: passwd-wrapper.scm\n") (display "Usage: passwd-wrapper.scm\n")
(display "Change NIS, Kerberos IV and Kerberos V passwords at once.\n") (display "Change NIS, Kerberos IV and Kerberos V passwords at once.\n")
(display "Written by David Frese.\n")) (display "Written by Eric Knauel and David Frese.\n"))
(define (main args) (define (main args)
(set-interrupt-handler interrupt/int (lambda a (values))) (set-interrupt-handler interrupt/int (lambda a (values)))
@ -397,7 +409,7 @@ Please choose a password with at least 2 character classes.")
(set-interrupt-handler interrupt/quit (lambda a (values))) (set-interrupt-handler interrupt/quit (lambda a (values)))
(if (null? (cdr args)) (if (null? (cdr args))
(case system-type (case system-type
((freebsd solaris) ((freebsd solaris linux)
(let ((old-pw (ask/check-old-password)) (let ((old-pw (ask/check-old-password))
(new-pw (ask-new-password))) (new-pw (ask-new-password)))
(if (not (ensure-kerbv-ticket old-pw)) (if (not (ensure-kerbv-ticket old-pw))