diff options
author | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2012-01-27 18:11:52 -0800 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@omgwallhack.org> | 2012-01-27 18:11:52 -0800 |
commit | 8a4e3cedb5ec2975228faad597909037d3225950 (patch) | |
tree | e51d7ebc62f6d311ea688ddc374b919d2202bbbd /pinyadmin/sbin | |
parent | b980f3db18589ff1f02edb7737689194f5cb9b86 (diff) | |
download | piny-code-8a4e3cedb5ec2975228faad597909037d3225950.tar.gz piny-code-8a4e3cedb5ec2975228faad597909037d3225950.zip |
Initial shot at web-friendly (sadly PAM unfriendly...) password modification.
Diffstat (limited to 'pinyadmin/sbin')
-rw-r--r-- | pinyadmin/sbin/newpasshash | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pinyadmin/sbin/newpasshash b/pinyadmin/sbin/newpasshash new file mode 100644 index 0000000..bf55a76 --- /dev/null +++ b/pinyadmin/sbin/newpasshash @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +my ( $crypt ) = @ARGV; + +if ( $crypt eq "" ) { + print "You must enter a password!\n"; + exit 1; +}; + +my $ret = system( "/usr/sbin/usermod", "-P", $crypt, $ENV{'SUDO_USER'}); + +if ( $ret ) { + print "An error occured.\n"; + exit 2; +}; |