summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-07-30 18:50:31 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-07-30 18:50:31 (GMT)
commit87fb8084746994dcc8f1b70a780e4538ec36b8ef (patch)
treef136c6449e9d4d4a56fe6367daf25e70e68b9a5b /utils
parent49cdb636dccdf995124675ee357f568bc8535ef6 (diff)
the calling environment of lightdm is a little weird
Diffstat (limited to 'utils')
-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