5 # This is run REMOTELY over ssh by fs_passwd_server.
7 # ivan@sisd.com 98-mar-9
12 my $fs_passwdd_socket = "/usr/local/freeside/fs_passwdd_socket";
13 my $pid_file = "$fs_passwdd_socket.pid";
15 $ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
16 $ENV{'SHELL'} = '/bin/sh';
17 $ENV{'IFS'} = " \t\n";
20 $ENV{'BASH_ENV'} = '';
24 my $uaddr = sockaddr_un($fs_passwdd_socket);
25 my $proto = getprotobyname('tcp');
27 socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
28 unlink($fs_passwdd_socket);
29 bind(Server, $uaddr) or die "bind: $!";
30 listen(Server,SOMAXCONN) or die "listen: $!";
33 open(PIDFILE,"<$pid_file");
34 #chomp( my $old_pid = <PIDFILE> );
35 my $old_pid = <PIDFILE>;
37 $old_pid =~ /^(\d+)$/;
40 open(PIDFILE,">$pid_file");
45 for ( ; $paddr = accept(Client,Server); close Client) {
46 my($me,$old_password,$new_password,$new_gecos,$new_shell);
49 $old_password=<Client>;
50 $new_password=<Client>;
54 print $me,$old_password,$new_password,$new_gecos,$new_shell;