# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # bos720 src/bos/usr/sbin/snappd/scripts/SetPassword.pl 1.3 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2000,2002 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # # @(#)99 1.3 src/bos/usr/sbin/snappd/scripts/SetPassword.pl, snapp, bos720 5/31/02 07:51:22 #!/usr/bin/perl -T #--------------------------------------------------------- #-------- Name SetPassword.pl #--------------------------------------------------------- #-------- This script attempts to set the root password. #--------------------------------------------------------- #-------- Links to Pages: #-------- Home.pl #-------- SetPassword.pl #--------------------------------------------------------- $ENV{'PATH'} = '/bin:/usr/bin'; %hshObjectTags=@ARGV; $newPassword = $hshObjectTags{"NewPassword"}; open(OUTFILE,">/var/snapp/snapp.fres.tmp"); if ("$newPassword" ne "") { `/usr/sbin/snapp/set_passwd $newPassword`; $return = $?; $return = $return >> 8; if ("$return" == 0) { #print "password set successful\n"; print OUTFILE < Successful Password Set: 100 15 48 30 20 130 65 25 EOXML } else { # This is a fatal error. Retrying won't help, so # just return the user to home. print OUTFILE < Failure Setting Password: 100 15 48 30 20 130 65 25 EOXML } } else { # This is probably because they entered a null password. # Let the user re-enter to password or cancel this function. #print "password incorrect. Please try again\n"; print OUTFILE < Empty Password: 150 15 5 30 5 15 34 25 70 40 25 35 95 20 80 15 35 10 60 70 EOXML } close(OUTFILE); system("/bin/cp /var/snapp/snapp.fres.tmp /var/snapp/snapp.fres");