* [LEMONLDAP-491] Don't import all POSIX functions

This commit is contained in:
Sandro Cazzaniga 2012-07-10 13:36:10 +00:00
parent 333f7d6750
commit b9a20c3995
4 changed files with 16 additions and 16 deletions

View File

@ -4,12 +4,12 @@
package Lemonldap::NG::Handler::Status;
use strict;
use POSIX;
use POSIX qw(setuid setgid);
use Data::Dumper;
#inherits Cache::Cache
our $VERSION = '1.2.0';
our $VERSION = '1.2.2';
our $status = {};
our $activity = [];
@ -99,8 +99,8 @@ sub portalTab {
}
eval {
POSIX::setgid( ( getgrnam( $ENV{APACHE_RUN_GROUP} ) )[2] );
POSIX::setuid( ( getpwnam( $ENV{APACHE_RUN_USER} ) )[2] );
setgid( ( getgrnam( $ENV{APACHE_RUN_GROUP} ) )[2] );
setuid( ( getpwnam( $ENV{APACHE_RUN_USER} ) )[2] );
};
## @rfn void run(string localStorage, hashRef localStorageOptions)

View File

@ -3,12 +3,12 @@
use Lemonldap::NG::Common::Conf;
use Lemonldap::NG::Common::Conf::Constants;
use Data::Dumper;
use POSIX;
use POSIX qw(setuid setgid);
use strict;
eval {
POSIX::setgid( ( getgrnam('__APACHEGROUP__') )[2] );
POSIX::setuid( ( getpwnam('__APACHEUSER__') )[2] );
setgid( ( getgrnam('__APACHEGROUP__') )[2] );
setuid( ( getpwnam('__APACHEUSER__') )[2] );
print STDERR "Running as uid $> and gid $)\n";
};

View File

@ -8,13 +8,13 @@ package Lemonldap::NG::Portal::MailReset;
use strict;
use warnings;
our $VERSION = '1.2.1';
our $VERSION = '1.2.2';
use Lemonldap::NG::Portal::Simple qw(:all);
use base qw(Lemonldap::NG::Portal::SharedConf Exporter);
use HTML::Template;
use Encode;
use POSIX;
use POSIX qw(strftime);
#inherits Lemonldap::NG::Portal::_SMTP
@ -225,8 +225,8 @@ sub sendConfirmationMail {
$self->lmLog( "Mail expiration timestamp: $expTimestamp", 'debug' );
$self->{expMailDate} =
&POSIX::strftime( "%d/%m/%Y", localtime $expTimestamp );
$self->{expMailTime} = &POSIX::strftime( "%H:%M", localtime $expTimestamp );
strftime( "%d/%m/%Y", localtime $expTimestamp );
$self->{expMailTime} = strftime( "%H:%M", localtime $expTimestamp );
# Mail session start date
my $startTimestamp = $self->{mailSessionStartTimestamp};
@ -234,9 +234,9 @@ sub sendConfirmationMail {
$self->lmLog( "Mail start timestamp: $startTimestamp", 'debug' );
$self->{startMailDate} =
&POSIX::strftime( "%d/%m/%Y", localtime $startTimestamp );
strftime( "%d/%m/%Y", localtime $startTimestamp );
$self->{startMailTime} =
&POSIX::strftime( "%H:%M", localtime $startTimestamp );
strftime( "%H:%M", localtime $startTimestamp );
# Ask if user want another confirmation email
if ( $self->{mail_already_sent} and !$self->param('resendconfirmation') ) {

View File

@ -12,7 +12,7 @@ use MIME::Base64;
use String::Random;
use LWP::UserAgent; # SOAP call
use HTTP::Request; # SOAP call
use POSIX; # Convert SAML2 date into timestamp
use POSIX qw(strftime); # Convert SAML2 date into timestamp
use Time::Local; # Convert SAML2 date into timestamp
use Encode; # Encode attribute values
use URI; # Get metadata URL path
@ -20,7 +20,7 @@ use URI; # Get metadata URL path
# Special comments for doxygen
#inherits Lemonldap::NG::Common::Conf::SAML::Metadata protected service_metadata
our $VERSION = '1.2.0';
our $VERSION = '1.2.2';
our $samlCache;
our $initGlibDone;
@ -2272,7 +2272,7 @@ sub timestamp2samldate {
my ( $self, $timestamp ) = splice @_;
my @t = gmtime($timestamp);
my $samldate = POSIX::strftime( "%Y-%m-%dT%TZ", @t );
my $samldate = strftime( "%Y-%m-%dT%TZ", @t );
$self->lmLog( "Convert timestamp $timestamp in SAML2 date: $samldate",
'debug' );