view release on metacpan or search on metacpan
lib/Elatin9.pm view on Meta::CPAN
### More-desperate methods
# Light desperation on any (Unixish) platform
else {
$home = CORE::eval q{ (getpwuid($<))[7] };
}
# On Unix in general, a non-existant home means "no home"
# For example, "nobody"-like users might use /nonexistant
if (defined $home and ! -d($home)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Manager/Cli.pm view on Meta::CPAN
my $conf =
$self->mgr->confAcc->getConf( { cfgNum => $previousCfg, raw => 1 } )
or die $Lemonldap::NG::Common::Conf::msg;
$conf->{cfgNum} = $lastCfg;
$conf->{cfgAuthor} = scalar( getpwuid $< ) . '(command-line-interface)';
chomp $conf->{cfgAuthor};
$conf->{cfgAuthorIP} = '127.0.0.1';
$conf->{cfgDate} = time;
$conf->{cfgVersion} = $Lemonldap::NG::Manager::VERSION;
$conf->{cfgLog} = $self->log // "Rolled back configuration $lastCfg";
lib/Lemonldap/NG/Manager/Cli.pm view on Meta::CPAN
$self->logger->debug( "CLI: cfgNum forced with " . $self->cfgNum );
print STDERR "cfgNum forced with ", $self->cfgNum;
$saveParams->{cfgNum} = $self->cfgNum;
$saveParams->{cfgNumFixed} = 1;
}
$new->{cfgAuthor} = scalar( getpwuid $< ) . '(command-line-interface)';
chomp $new->{cfgAuthor};
$new->{cfgAuthorIP} = '127.0.0.1';
$new->{cfgDate} = time;
$new->{cfgVersion} = $Lemonldap::NG::Manager::VERSION;
$new->{cfgLog} = $self->log // 'Modified with LL::NG CLI';
view all matches for this distribution
view release on metacpan or search on metacpan
bin/lim-agentd view on Meta::CPAN
my $user = $user;
my $gid = $gid;
my $putback;
unless (defined $user) {
unless (defined ($user = getpwuid($uid))) {
print STDERR 'Unable to get user name for id ', $uid, ': ', $!;
exit(3);
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
data/mkdb.pl view on Meta::CPAN
print "\n";
print "I'm going to write some wordlists as DB_Files into a subdirectory\n";
print "in your home directory, to decrease start-up time.\n";
#my $dir = ((getpwuid $<)[7]). "/.namedentity";
#if (-d $dir) {
# print "Except I see you'd already got some. Carry on, then!\n";
# return 1;
#}
view all matches for this distribution
view release on metacpan or search on metacpan
share/count_1w.txt view on Meta::CPAN
overprints 33204
lpans 33204
susun 33203
praetoria 33203
hsql 33203
getpwuid 33203
dobry 33203
yeild 33202
bico 33202
reznick 33201
kuxo 33201
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/GA/Gramadoir.pm view on Meta::CPAN
}
push @PUREMORPH, $rule if ($rule->{'level'} == -1);
}
if ($self->{'use_ignore_file'}) {
my $homedir = $ENV{HOME} || $ENV{LOGDIR}; # || (getpwuid($>))[7];
if (open (DATAFILE, File::Spec->catfile( $homedir, '.neamhshuim' ))) {
while (<DATAFILE>) {
chomp;
carp gettext('%s: `%s\' corrupted at %s\n',
gettext('An Gramadoir'), ".neamhshuim", $.) if /^$/;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/Sinica/PerlYuYan.pm view on Meta::CPAN
msgctl msgget msgrcv msgsnd semctl semget semop shmctl shmget shmread shmwrite
endgrent endhostent endnetent endpwent getgrent getgrgid getgrnam
endgrent endhostent endnetent endpwent getgrent getgrgid getgrnam
getlogin getpwent getpwnam getpwuid setgrent setpwent
getlogin getpwent getpwnam getpwuid setgrent setpwent
endprotoent endservent gethostbyaddr gethostbyname
endprotoent endservent gethostbyaddr gethostbyname
gethostent getnetbyaddr getnetbyname getnetent
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/DVB/DVBT/Advert/Config.pm view on Meta::CPAN
}
elsif ( $^O eq 'darwin')
{
if (!$home)
{
$home = (getpwuid($<))[7];
}
$DEFAULT_CONFIG_PATH = [] ;
if ($home && -d $home)
{
lib/Linux/DVB/DVBT/Advert/Config.pm view on Meta::CPAN
}
elsif ( $^O eq 'MacOS' )
{
if (!$home)
{
# On some platforms getpwuid dies if called at all
local $SIG{'__DIE__'} = '';
$home = (getpwuid($<))[7];
}
$DEFAULT_CONFIG_PATH = [] ;
if ($home && -d $home)
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/ppport.h view on Meta::CPAN
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
lib/Linux/ppport.h view on Meta::CPAN
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/ppport.h view on Meta::CPAN
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
lib/Linux/ppport.h view on Meta::CPAN
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Fuser.pm view on Meta::CPAN
my ( $class, $pid, $fd_data ) = @_;
my $fd = $fd_data->[0];
my $fd_no = $fd_data->[1];
my $user = getpwuid( ( lstat($fd) )[4] );
my @cmd = ('');
if ( open CMD, "/proc/$pid/cmdline" )
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Info/Processes.pm view on Meta::CPAN
open my $fh, '<', "$file->{path}/$pid/$file->{status}"
or return;
while ( my $line = <$fh> ) {
if ( $line =~ /^Uid:(?:\s+|\t+)(\d+)/ ) {
$owner = getpwuid($1) || "N/a";
last;
}
}
close($fh);
lib/Linux/Info/Processes.pm view on Meta::CPAN
my $stat = $lxs->get;
=head1 PROCESS STATISTICS
Generated by F</proc/E<lt>pidE<gt>/stat>, F</proc/E<lt>pidE<gt>/status>,
F</proc/E<lt>pidE<gt>/cmdline> and F<getpwuid()>.
Note that if F</etc/passwd> isn't readable, the key owner is set to F<N/a>.
ppid - The parent process ID of the process.
nlwp - The number of light weight processes that runs by this process.
lib/Linux/Info/Processes.pm view on Meta::CPAN
B<proc(5)>
=item *
B<perldoc -f getpwuid>
=item *
L<Linux::Info>
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
easyxs/ppport.h view on Meta::CPAN
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Shadow.pm view on Meta::CPAN
)
],
'getpw' => [
qw(
getpwnam
getpwuid
getpwent
)
]
);
lib/Linux/Shadow.pm view on Meta::CPAN
my @pwent = CORE::getpwnam($name);
return set_pwent_expire(@pwent);
}
sub getpwuid {
my ($uid) = @_;
my @pwent = CORE::getpwuid($uid);
return set_pwent_expire(@pwent);
}
sub getpwent {
lib/Linux/Shadow.pm view on Meta::CPAN
setspent();
endspent();
use Linux::Shadow qw(:getpw);
($name,$passwd,$uid,$gid, $quota,$comment,$gcos,$dir,$shell,$expire) = getpwnam('user');
($name,$passwd,$uid,$gid, $quota,$comment,$gcos,$dir,$shell,$expire) = getpwuid(0);
($name,$passwd,$uid,$gid, $quota,$comment,$gcos,$dir,$shell,$expire) = getpwent();
=head1 DESCRIPTION
Perl gives access to the user's shadow password itself via getpw*, but the
lib/Linux/Shadow.pm view on Meta::CPAN
=over
=item getpwnam(NAME)
=item getpwuid(UID)
=item getpwent
These functions work exactly like the identically named functions documented
in L<perlfunc/perlfunc>, except that if they return the userinfo and can
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
GETPWENT_R_PROTO|5.008000|5.008000|Vn
getpwnam|5.009000||Viu
GETPWNAM_R_HAS_BUFFER|5.008000||Viu
GETPWNAM_R_HAS_PTR|5.008000||Viu
GETPWNAM_R_PROTO|5.008000|5.008000|Vn
getpwuid|5.009000||Viu
GETPWUID_R_HAS_PTR|5.008000||Viu
GETPWUID_R_PROTO|5.008000|5.008000|Vn
get_quantifier_value|5.033006||Viu
get_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031011||Viu
easyxs/ppport.h view on Meta::CPAN
KEY_getprotobyname|5.003007||Viu
KEY_getprotobynumber|5.003007||Viu
KEY_getprotoent|5.003007||Viu
KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
bin/realtimed view on Meta::CPAN
info "detected current realtimed absolute path as: $myfullpath";
info "detected program name as: $programname";
my $euid = geteuid;
my $uid = getuid;
my $user = getpwuid($uid);
my $euser = getpwuid($euid);
my $rootuser = getpwuid(0);
unless ($euid == $uid){
my $msg = "you ($user) are executing this program with setuid to $euser credentials, exiting";
emerg $msg;
say $msg;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/List/Gen/Lazy/Builtins.pm view on Meta::CPAN
default defined die do endgrent endhostent endnetent endprotoent
endpwent endservent eof eval exec exit exp fcntl fileno flock fork
formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname
gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername
getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent
getpwent getpwnam getpwuid getservbyname getservbyport getservent
getsockname getsockopt glob gmtime goto hex index int ioctl join
kill lc lcfirst length link listen localtime lock log lstat mkdir
msgctl msgget msgrcv msgsnd oct open opendir ord pack pipe pop pos
print printf prototype push quotemeta rand read readdir readline
readlink readpipe recv ref rename require reset reverse rewinddir
lib/List/Gen/Lazy/Builtins.pm view on Meta::CPAN
chown chr chroot close closedir connect cos crypt dbmclose dbmopen default
defined die do endgrent endhostent endnetent endprotoent endpwent
endservent eof eval exec exit exp fcntl fileno flock fork formline getc
getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin
getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority
getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid
getservbyname getservbyport getservent getsockname getsockopt glob gmtime
goto hex index int ioctl join keys kill lc lcfirst length link listen
localtime lock log lstat mkdir msgctl msgget msgrcv msgsnd oct open opendir
ord pack pipe pop pos print printf prototype push quotemeta rand read
readdir readline readlink readpipe recv ref rename require reset reverse
view all matches for this distribution
view release on metacpan or search on metacpan
Agent/Driver/Mail.pm view on Meta::CPAN
# make -- driver constructor
#
sub make {
my $self = bless {
prefix => '',
to => (getpwuid $<)[0],
cc => '',
bcc => '',
subject => '',
from => '',
priority => '',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Fine/Formatter/Template.pm view on Meta::CPAN
return $self->{_userName};
} elsif ($self->{use_effective_id}) {
$self->{_userName} =
($^O eq "MSWin32")
? $ENV{EUID} || 0
: getpwuid($>) || "nobody";
} else {
$self->{_userName} = getlogin() || getpwuid($<) || "nobody";
}
return $self->{_userName};
} # _userName()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Handler/Pattern.pm view on Meta::CPAN
sub _get_c_pkg { (caller(2+$Log::Handler::CALLER_LEVEL))[0] }
sub _get_c_file { (caller(2+$Log::Handler::CALLER_LEVEL))[1] }
sub _get_c_line { (caller(2+$Log::Handler::CALLER_LEVEL))[2] }
sub _get_c_sub { (caller(3+$Log::Handler::CALLER_LEVEL))[3]||"" }
sub _get_runtime { return sprintf('%.6f', Time::HiRes::gettimeofday - START_TIME) }
sub _get_user { getpwuid($<) || $< }
sub _get_group { getgrgid($(+0) || $(+0 }
sub _get_hires {
my $self = shift;
if (!$self->{timeofday}) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Log4perl/Appender/SMTP.pm view on Meta::CPAN
sub new {
my($class, @options) = @_;
my $hname = hostfqdn() || '<unknown>';
my $user = getlogin || getpwuid($<) || 'log4perl';
return bless {
from => $user.'@'.$hname,
to => 'postmaster',
subject => "Subject: Log4perl from $hname\n",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/Log4perl.pm view on Meta::CPAN
my $config = <<'END';
log4perl.logger = INFO, Main
log4perl.appender.Main = Log::Log4perl::Appender::File
log4perl.appender.Main.filename = \
sub { "example" . getpwuid($<) . ".log" }
log4perl.appender.Main.layout = Log::Log4perl::Layout::SimpleLayout
END
$Log::Log4perl::Config->allow_code('restrictive');
Log::Log4perl->init( \$config ); # will fail
$Log::Log4perl::Config->allow_code('safe');
Log::Log4perl->init( \$config ); # will succeed
The reason that the first call to -E<gt>init() fails is because the
'restrictive' name maps to an opcode mask of ':default'. getpwuid() is not
part of ':default', so -E<gt>init() fails. The 'safe' name maps to an opcode
mask of ':browse', which allows getpwuid() to run, so -E<gt>init() succeeds.
allowed_code_ops_convenience_map() can be invoked in several ways:
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Log/ProgramInfo.pm view on Meta::CPAN
BEGIN {
$progbase = $FindBin::Script;
$starttime = DateTime->from_epoch(epoch => time);
$valid_dates{$_} = 1 for qw( date time datetime none );
$uid = getpwuid $<;
my $euid = getpwuid $>;
$gid = groupmap $(;
my $egid = groupmap $);
$uid = "$euid($uid)" if $uid ne $euid;
$gid = "$egid // $gid" if $egid ne $gid;
view all matches for this distribution
view release on metacpan or search on metacpan
devel/bin/smoke.pl view on Meta::CPAN
my $config = {
src => canonpath( catdir( $FindBin::Bin, '../../' ) ),
verbose => 0,
email_to => undef,
email_from => getpwuid($<) . '@' . hostname(),
email_subject => 'Lucy Smoke Test Report ' . localtime(),
mailhost => 'localhost',
test_target => 'test', # could also be 'test_valgrind' if on Linux
};
view all matches for this distribution
view release on metacpan or search on metacpan
SoundFont.pm view on Meta::CPAN
return %sf;
}
sub new_sf { my $inam = $_[$[] || 'Name of this SoundFont';
my ($name,$passwd,$uid,$gid, $quota,$comment,$gcos,$dir,$shell,$expire)
= getpwuid($>);
$gcos =~ s/,+$//;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
my $y = sprintf ("%4.4d", $year+1900);
my @abbr = qw( January February March April May June
July August September October November December );
view all matches for this distribution
view release on metacpan or search on metacpan
bin/scripts/moby-s-caching.pl view on Meta::CPAN
sub check_root {
# assume that windows has no security preventing the copying of files
return if (MSWIN);
unless ( getpwuid($<) eq 'root' ) {
print STDOUT <<EOT;
Hmmm - you are not running this as root. If you indicate any
system directories for the installation, such as '/usr/local/apache/', then
you may not have permission to install files there. If so, you should
view all matches for this distribution
view release on metacpan or search on metacpan
bin/fetch_pods.PLS view on Meta::CPAN
1;
}
sub find_config_file {
my $self = shift;
my $home = (getpwuid($<))[7] || $ENV{HOME};
my @paths = ("$home/.fetchpods",
"/usr/local/etc/fetchpods.conf",
"/usr/etc/fetchpods.conf",
"/etc/fetchpods.conf",
"$Bin/../etc/fetchpods.conf",
bin/fetch_pods.PLS view on Meta::CPAN
}
sub interpolate {
my $ref = shift;
return unless defined $ref;
$ref =~ s/^~([^\/]*)/($1 ? getpwnam($1):getpwuid($<))[7] || "~$1"/eg;
$ref =~ s/\$(\w+)/$ENV{$1}/g;
$ref;
}
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
examples/request-reply/request_permdyn.pl view on Meta::CPAN
#
# The dynamic queue name contains the userid. For real applications,
# you'd use an application instance specific name, whether that's the
# host, the product, the tarde engine, or whatever.
#
my $userid = ($^O =~ /^MSWin/ ? $ENV{USERNAME} : getpwuid($<));
my $reply_qname = $dynamic_qname;
$reply_qname =~ s/\.\*$/.\U$userid/;
print "Have dynamic reply queue name [$reply_qname]\n";
my $reply_queue = MQSeries::Queue::->
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MYDan/Agent/Query.pm view on Meta::CPAN
my ( $code, $sudo, $env ) = @$query{ qw( code sudo env ) };
idie( "already running $code\n" ) if ( $code =~ /\.mx$/ ) && !
MYDan::Util::ProcLock->new( File::Spec->join( $path{run}, $code ) )->lock();
if ( $code ne 'proxy' && ! $< && $sudo && $sudo ne ( getpwuid $< )[0] )
{
idie( "invalid sudo $sudo\n" ) unless my @pw = getpwnam $sudo;
@pw = map { 0 + sprintf '%d', $_ } @pw[2,3];
POSIX::setgid( $pw[1] ); ## setgid must preceed setuid
POSIX::setuid( $pw[0] );
view all matches for this distribution