6.0.0-RC7
6/27/26

[#1460] kpasswd expect driver
Summary kpasswd expect driver
Queue Passwd
Queue Version 2.2.1
Type Enhancement
State Resolved
Priority 1. Low
Owners
Requester didopalauzov (at) aegee (dot) org
Created 3/1/05 (7788 days ago)
Due
Updated 3/1/05 (7788 days ago)
Assigned
Resolved 3/1/05 (7788 days ago)
Milestone expect script
Patch No

History
259 Jan Schneider Comment #2
State ⇒ Resolved
Reply to this comment
Added to CVS HEAD, thanks.
111 didopalauzov (at) aegee (dot) org Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ kpasswd expect driver
Queue ⇒ Passwd
Reply to this comment
The following expect scribt enables the password change over krberos 
kpasswd. Feel free to integrate it in the cvs.

*****************

#   #!/usr/bin/expect

#  Dilyan Palauzov, 2005

gets stdin user

gets stdin oldpw

gets stdin newpw

set log [lindex $argv 1]

set err [open $log "w" "0600"]

set pid [spawn /usr/bin/kpasswd $user]

set timeout 1

expect {

     "Password for *: "

     {

         send $oldpw\r

     }

     eof {

         puts $err $expect_out(buffer)

         close $err

         exit 1

     }

}



expect {

     "Enter new password: : "

     {

         send $newpw\r

     }

     eof {

         puts $err $expect_out(buffer)

         close $err

         exit 1

     }

}

expect {

     eof {exit 1}

     "Enter it again: : "

     {

         send $newpw\r

     }

}

expect {

     eof {

         puts $err $expect_out(buffer)

         close err

         exit 1

     }

     "Password changed."

     {

         close err

         exit 0

     }

}



close err

exit 0

Saved Queries