summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-03-09 16:50:04 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-03-09 16:50:04 (GMT)
commit0186a646f0bad0a47209aaea9febf17d4fbd16d7 (patch)
tree5a80a483d820f259996bcfe151ec229439f878c1
parent251534965c8fe8d3942e22b23b30de577f5c8297 (diff)
using /usr/bin/id instead of environment (more secure!)
git-svn-id: https://svn.helsinki.at/rhimport/trunk@22 7c65635b-ec39-4f67-a626-873dbafdd612
-rwxr-xr-xrhimport6
1 files changed, 3 insertions, 3 deletions
diff --git a/rhimport b/rhimport
index 46794b6..c8cfd47 100755
--- a/rhimport
+++ b/rhimport
@@ -65,10 +65,10 @@ EOF
exit;
}
-my $user = $ENV{'USER'};
-$user or die "Username not found in environment";
+my $user = `/usr/bin/id -un`;
+$user =~ s/\n//;
-my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr";
+my $dbh = DBI->connect("DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr";
my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;};
my $sth = $dbh->prepare($sql);
$sth->execute();