diff options
Diffstat (limited to 'fs_passwd')
-rwxr-xr-x | fs_passwd/fs_passwd_server | 19 | ||||
-rwxr-xr-x | fs_passwd/fs_passwdd | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/fs_passwd/fs_passwd_server b/fs_passwd/fs_passwd_server index 99e7c4351..f4b67ae98 100755 --- a/fs_passwd/fs_passwd_server +++ b/fs_passwd/fs_passwd_server @@ -12,19 +12,20 @@ use strict; use IO::Handle; -use FS::SSH qw(sshopen2); +use Net::SSH qw(sshopen2); use FS::UID qw(adminsuidsetup); use FS::Record qw(qsearchs); use FS::svc_acct; -$SIG{CHLD} = sub { wait() }; +my $user = shift or die &usage; +adminsuidsetup $user; -&adminsuidsetup; +my($shellmachine)=shift or die &usage; -my($fs_passwdd)="/usr/local/sbin/fs_passwdd"; +#causing trouble for some folks +#$SIG{CHLD} = sub { wait() }; -my($shellmachine)=shift; -die "Usage: fs_passwd_server shellmachine\n" unless $shellmachine; +my($fs_passwdd)="/usr/local/sbin/fs_passwdd"; while (1) { my($reader,$writer)=(new IO::Handle, new IO::Handle); @@ -57,7 +58,7 @@ while (1) { unless ( $svc_acct ) { print $writer "Incorrect password.\n"; next; } my(%hash)=$svc_acct->hash; - my($new_svc_acct) = create FS::svc_acct ( \%hash ); + my($new_svc_acct) = new FS::svc_acct ( \%hash ); $new_svc_acct->setfield('_password',$new_password) if $new_password && $new_password ne $old_password; $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos; @@ -71,3 +72,7 @@ while (1) { warn "Connection to $shellmachine lost! Reconnecting...\n"; } +sub usage { + die "Usage:\n\n fs_passwd_server user shellmachine\n"; +} + diff --git a/fs_passwd/fs_passwdd b/fs_passwd/fs_passwdd index 582e13ccd..be7539984 100755 --- a/fs_passwd/fs_passwdd +++ b/fs_passwd/fs_passwdd @@ -11,7 +11,7 @@ use Socket; my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket"; -$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin'; +$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; $ENV{'SHELL'} = '/bin/sh'; $ENV{'IFS'} = " \t\n"; $ENV{'CDPATH'} = ''; |