X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_passwd%2Ffs_passwd;h=feddb462ce83369ffc8035af52d2ca595c417f5b;hp=0b467aefcd3e99c13f6e29d0470510ff0319e59f;hb=HEAD;hpb=2093701338cf6d4531a33466cd64ad48bbf88856 diff --git a/fs_passwd/fs_passwd b/fs_passwd/fs_passwd index 0b467aefc..feddb462c 100755 --- a/fs_passwd/fs_passwd +++ b/fs_passwd/fs_passwd @@ -10,14 +10,14 @@ # # password lengths 0,255 instead of 6,8 - we'll let the server process # check the data ivan@sisd.com 98-jul-17 +# +# updated for the exciting new world of self-service 2004-mar-10 use strict; use Getopt::Std; -use Socket; -use IO::Handle; +use FS::SelfService qw(passwd); use vars qw($opt_f $opt_s); -my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket"; my($freeside_uid)=scalar(getpwnam('freeside')); $ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; @@ -114,13 +114,15 @@ print "\n"; system '/bin/stty', 'echo'; -socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!"; -connect(SOCK, sockaddr_un($fs_passwdd_socket)) or die "connect: $!"; -print SOCK join("\n",$me,$old_password,$new_password,$new_gecos,$new_shell),"\n"; -SOCK->flush; -my($error); -$error = ; -chop $error; +my $rv = passwd( + 'username' => $me, + 'old_password' => $old_password, + 'new_password' => $new_password, + 'new_gecos' => $new_gecos, + 'new_shell' => $new_shell, +); + +my $error = $rv->{error}; if ($error) { print "\nUpdate error: $error\n";