projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
report fixes and cruft removal
[freeside.git]
/
FS
/
FS
/
UID.pm
diff --git
a/FS/FS/UID.pm
b/FS/FS/UID.pm
index
f80156e
..
7891019
100644
(file)
--- a/
FS/FS/UID.pm
+++ b/
FS/FS/UID.pm
@@
-15,8
+15,8
@@
use DBI;
use FS::Conf;
@ISA = qw(Exporter);
use FS::Conf;
@ISA = qw(Exporter);
-@EXPORT_OK = qw(checkeuid checkruid cgisuidsetup
-
adminsuidsetup
getotaker dbh datasrc getsecrets driver_name );
+@EXPORT_OK = qw(checkeuid checkruid cgisuidsetup
adminsuidsetup forksuidsetup
+ getotaker dbh datasrc getsecrets driver_name );
$freeside_uid = scalar(getpwnam('freeside'));
$freeside_uid = scalar(getpwnam('freeside'));
@@
-65,10
+65,17
@@
Returns the DBI database handle (usually you don't need this).
=cut
sub adminsuidsetup {
=cut
sub adminsuidsetup {
+ $dbh->disconnect if $dbh;
+ &forksuidsetup(@_);
+}
+sub forksuidsetup {
$user = shift;
croak "fatal: adminsuidsetup called without arguements" unless $user;
$user = shift;
croak "fatal: adminsuidsetup called without arguements" unless $user;
+ $user =~ /^([\w\-\.]+)/ or croak "fatal: illegal user $user";
+ $user = $1;
+
$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
$ENV{'SHELL'} = '/bin/sh';
$ENV{'IFS'} = " \t\n";
$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
$ENV{'SHELL'} = '/bin/sh';
$ENV{'IFS'} = " \t\n";
@@
-78,7
+85,6
@@
sub adminsuidsetup {
croak "Not running uid freeside!" unless checkeuid();
getsecrets;
croak "Not running uid freeside!" unless checkeuid();
getsecrets;
- $dbh->disconnect if $dbh;
$dbh = DBI->connect($datasrc,$db_user,$db_pass, {
'AutoCommit' => 0,
'ChopBlanks' => 1,
$dbh = DBI->connect($datasrc,$db_user,$db_pass, {
'AutoCommit' => 0,
'ChopBlanks' => 1,
@@
-118,7
+124,7
@@
Returns the CGI (see L<CGI>) object.
=cut
sub cgi {
=cut
sub cgi {
-
#
carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
+ carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
$cgi;
}
$cgi;
}
@@
-185,7
+191,7
@@
sub cgisetotaker {
$user = lc ( $cgi->connection->user );
} else {
die "fatal: Can't get REMOTE_USER! for cgi $cgi - you need to setup ".
$user = lc ( $cgi->connection->user );
} else {
die "fatal: Can't get REMOTE_USER! for cgi $cgi - you need to setup ".
- "Apache user authentication as documented in ht
docs/docs/config
.html";
+ "Apache user authentication as documented in ht
template/docs/install
.html";
}
$user;
}
}
$user;
}
@@
-249,7
+255,7
@@
coderef into the hash %FS::UID::callback :
=head1 VERSION
=head1 VERSION
-$Id: UID.pm,v 1.
9 2001-09-06 20:41:59 ivan
Exp $
+$Id: UID.pm,v 1.
13 2002-02-23 02:14:25 jeff
Exp $
=head1 BUGS
=head1 BUGS