#!/usr/bin/expect # version 0.5 for Mac OSX Server 10.5.x # # Free Software by Matt Richard # # This script converts a user's password on an Open Directory master from # using a Crypt password to using an Open Directory password. It is intended # to be called by a web front-end. # # This should only be readable and executable by the root user. # Protect this file and don't allow users to view the contents. # # uncomment to turn on verbose output # log_user 1 set timeout 30; set admin "diradmin"; set adminpass "-changeme-"; # make sure we were called with two arguments if {$argc==2} { set uid "[lindex $argv 0]" set pass "[lindex $argv 1]" eval spawn slapconfig -settopasswordserver $uid $admin $pass $adminpass expect eof exit } if {$argc!=2} { send_user "
error!\n
" }