summaryrefslogtreecommitdiff
path: root/utils/rhrd-ws-login
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rhrd-ws-login')
-rwxr-xr-xutils/rhrd-ws-login5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/rhrd-ws-login b/utils/rhrd-ws-login
index 44e4eea..c7a8d00 100755
--- a/utils/rhrd-ws-login
+++ b/utils/rhrd-ws-login
@@ -29,7 +29,7 @@ if($num_args != 1 || ($ARGV[0] ne "login" && $ARGV[0] ne "logout")) {
exit 1;
}
-my $username = getpwuid($>);
+my $username = $ENV{'USER'};
my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
if(defined $dbh) {
@@ -40,7 +40,7 @@ if(defined $dbh) {
(my $token, undef, $errorstring) = RHRD::rddb::get_token($dbh, $username);
unless($token) {
print STDERR "$errorstring\n";
- exit 1;
+ exit 0;
}
$token =~ s/([ !'"\\])/\\$1/g;
$macro = "LO $username $token!"
@@ -49,7 +49,6 @@ if(defined $dbh) {
system('/usr/bin/rmlsend', $macro) == 0 or die "system(/usr/bin/rmlsend, $macro) failed: $?";
} else {
print STDERR "$errorstring\n";
- exit 1;
}
exit 0