diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-03-09 16:50:04 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-03-09 16:50:04 (GMT) |
commit | f52380b976948ec2f3776d63baaf2549f4a81b49 (patch) | |
tree | 5a80a483d820f259996bcfe151ec229439f878c1 | |
parent | 68a72fc9a29c31d9dee577d8b317b10904371429 (diff) |
using /usr/bin/id instead of environment (more secure!)
-rwxr-xr-x | rhimport | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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(); |