X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=fs_passwd%2Ffs_passwd;h=feddb462ce83369ffc8035af52d2ca595c417f5b;hp=bcf09f1febaf5b1a799dfe313842c8aa1b836b89;hb=29d80a8582103ead0b5910391cabc45cb85fa836;hpb=a7ef58103f100935a0ed6a922183d6b26e0df437 diff --git a/fs_passwd/fs_passwd b/fs_passwd/fs_passwd index bcf09f1fe..feddb462c 100755 --- a/fs_passwd/fs_passwd +++ b/fs_passwd/fs_passwd @@ -10,17 +10,17 @@ # # 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/bin:/usr/ucb:/bin'; +$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; $ENV{'SHELL'} = '/bin/sh'; $ENV{'IFS'} = " \t\n"; $ENV{'CDPATH'} = ''; @@ -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";