diff options
author | ivan <ivan> | 2002-04-17 01:14:32 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-17 01:14:32 +0000 |
commit | 77fd19d72b3a974a05ae17be832c6433b53c5d25 (patch) | |
tree | adee4d7a3b3e6bcdc18f4ae0d519ab5fcb2c99bd /fs_passwd | |
parent | 644260c472b6aaf40ab4cea714bed5e6bfe708c1 (diff) |
kill off ssh kid on exit...
Diffstat (limited to 'fs_passwd')
-rwxr-xr-x | fs_passwd/fs_passwd_server | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs_passwd/fs_passwd_server b/fs_passwd/fs_passwd_server index f4b67ae98..a29b2c738 100755 --- a/fs_passwd/fs_passwd_server +++ b/fs_passwd/fs_passwd_server @@ -11,6 +11,8 @@ # crypt-aware, s/password/_password/; ivan@sisd.com 98-aug-23 use strict; +use vars qw($pid); +use subs qw(killssh); use IO::Handle; use Net::SSH qw(sshopen2); use FS::UID qw(adminsuidsetup); @@ -25,12 +27,20 @@ my($shellmachine)=shift or die &usage; #causing trouble for some folks #$SIG{CHLD} = sub { wait() }; +$SIG{HUP} = \&killssh; +$SIG{INT} = \&killssh; +$SIG{QUIT} = \&killssh; +$SIG{TERM} = \&killssh; +$SIG{PIPE} = \&killssh; + +sub killssh { kill 'TERM', $pid if $pid; exit; }; + my($fs_passwdd)="/usr/local/sbin/fs_passwdd"; while (1) { my($reader,$writer)=(new IO::Handle, new IO::Handle); $writer->autoflush(1); - sshopen2($shellmachine,$reader,$writer,$fs_passwdd); + $pid = sshopen2($shellmachine,$reader,$writer,$fs_passwdd); while (1) { my($username,$old_password,$new_password,$new_gecos,$new_shell); defined($username=<$reader>) or last; |