view release on metacpan or search on metacpan
lib/App/DBICx/Backend/Move.pm view on Meta::CPAN
use warnings;
use base qw(App::Cmd::Simple);
use DBI;
use Module::Load 'load';
my $user = getlogin || getpwuid($<) || "unknown";
sub opt_spec {
return (
[ "schema|s=s", "Name of the database schema", { required => 1 } ],
[ "from_dsn|f=s", "DSN for source database", { required => 1 } ],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Connector/Pool.pm view on Meta::CPAN
$args{initial} //= 1;
$args{tid_func} //= sub {1};
$args{wait_func} //= sub {croak "real waiting function must be supplied"};
$args{max_size} ||= -1;
$args{keep_alive} //= -1;
$args{user} //= ((getpwuid $>)[0]);
$args{password} //= '';
$args{attrs} //= {};
$args{dsn} //= 'dbi:Pg:dbname=' . $args{user};
$args{connector_mode} //= 'fixup';
if ($args{max_size} > 0 && $args{initial} != 0 && $args{initial} > $args{max_size}) {
view all matches for this distribution
view release on metacpan or search on metacpan
# we may try to get password from DBMS specific
# configuration file
unless (defined $self->{PASS}) {
unless (defined $self->{'USER'}
&& $self->{'USER'} ne getpwuid($<)) {
$self->passwd();
}
}
return ($self);
# determine home directory
if (exists $ENV{'HOME'} && $ENV{'HOME'} =~ /\S/ && -d $ENV{'HOME'}) {
$mycnf = $ENV{'HOME'};
} else {
$mycnf = (getpwuid($>)) [7];
}
$mycnf .= '/.my.cnf';
# just give up if file is not accessible
open (CNF, $mycnf) || return;
view all matches for this distribution
view release on metacpan or search on metacpan
$test_opts{Pg} =
$build->y_n("Do you want to run the PostgreSQL tests? (y/n)", "n");
}
if($test_opts{Pg}) {
my $user = scalar getpwuid($<);
$test_opts{Pg_host} = $build->prompt(
" Postgres server hostname (leave blank to use local socket):"
);
if($test_opts{Pg_host}) {
"Do you want to run the MySQL tests? (y/n)", "n"
);
}
if($test_opts{mysql}) {
my $user = scalar getpwuid($<);
$test_opts{mysql_host} = $build->prompt(
" MySQL server hostname (leave blank to use local socket):"
);
if($test_opts{mysql_host}) {
$test_opts{mysql_port} = $build->prompt(
view all matches for this distribution
view release on metacpan or search on metacpan
if ($^O =~ /Win32/) {
$testdsn .= ';host=localhost';
} else {
$testdsn .= ";host=$testdir/data/socket";
}
$testuser = ((getpwuid $>)[0]);
die "not connected $testdsn/$testuser: " . DBI::errstr()
unless DBI->connect($testdsn, $testuser, '', {RaiseError => 0, PrintError => 0, AutoCommit => 1});
1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/SimpleQuery.pm view on Meta::CPAN
my @available_drivers = DBI->available_drivers();
@available_drivers = grep { /^(?:Oracle|Pg|mysql)$/ } @available_drivers;
my @data_sources = DBI->data_sources(shift @available_drivers);
$self->{"dsn"} = shift(@data_sources);
$self->{"user"} = getpwuid($>);
$self->{"password"} = "";
}
return bless $self, $class;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
print "Please supply a DBI database source name (DSN) to connect with for the unit tests.\n";
print "Note that if your database is not fully transactional (such as older versions of MySQL ",
"these tests may fail.\n";
print "If this left blank, unit tests which depend on having a live database will be skipped.\n";
my $u = scalar getpwuid($<);
$test_opts{dsn} = prompt(qq{What DSN should we use for our unit tests? (eg; "DBI:Pg:dbname=$u")\n [$test_opts{dsn}]}, $test_opts{dsn});
if($test_opts{dsn} && $test_opts{dsn} !~ /^DBI:SQLITE2:/i) {
$test_opts{dsn_user} = prompt(" Username to connect to the database with:");
$test_opts{dsn_pass} = prompt(" Password to connect to the database with:");
view all matches for this distribution
view release on metacpan or search on metacpan
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
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
t/login/login.t view on Meta::CPAN
use DCE::test;
use DCE::Login;
($pname, $password) = ("cell_admin", "");
$pname ||= (getpwuid($<))[0];
$password ||= $ENV{DCE_PERL_TEST_PW};
unless ($password) {
warn "Skipping tests: no password to certify identity";
print "1..1\nok 1\n";
view all matches for this distribution
view release on metacpan or search on metacpan
# heading => 0,
# prompt => 0,
);
my $user = getlogin
|| scalar getpwuid($REAL_USER_ID)
|| undef;
print STDERR "Enter Action [CREATE]: ";
chomp( my $action = <STDIN> );
$action = "create" unless $action;
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
CAB/Server/HTTP/UNIX.pm view on Meta::CPAN
? $srv->{socketGroup}
: getgrnam($srv->{socketGroup}//''));
if (defined($sockuid) || defined($sockgid)) {
$sockuid //= $>;
$sockgid //= $);
$srv->vlog('info', "setting socket ownership (".scalar(getpwuid $sockuid).".".scalar(getgrgid $sockgid).") on $sockpath");
chown($sockuid, $sockgid, $sockpath)
or $srv->logconfess("prepareLocal(): failed to set ownership for socket '$sockpath': $!");
foreach my $dir (reverse @{$srv->{_socketDirs}||[]}) {
$srv->vlog('info', "setting directory ownership (".scalar(getpwuid $sockuid).".".scalar(getgrgid $sockgid).") on $dir");
chown($sockuid, $sockgid, $dir)
or $srv->logconfess("prepareLocal(): failed to set ownership for directory '$dir': $!");
}
}
CAB/Server/HTTP/UNIX.pm view on Meta::CPAN
## + returns stringified unix peer credentials: "${USER}.${GROUP}[${PID}]"
sub peerstr {
my ($sock,$pid,$uid,$gid) = @_;
($pid,$uid,$gid) = $sock->peercred() if (@_ < 4);
return (
(defined($uid) ? (getpwuid($uid)//'?') : '?')
.'.'
.(defined($gid) ? (getgrgid($gid)//'?') : '?')
.':'
.(defined($pid) ? (basename(pid_cmd($pid)//'?')."[$pid]") : '?[?]')
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Daemon/Control.pm view on Meta::CPAN
sub _set_gid_from_name {
my ( $self ) = @_;
# Grab the GID if we have a UID but no GID.
if ( !defined $self->group && defined $self->uid ) {
my ( $gid ) = ( (getpwuid( $self->uid ))[3] );
$self->gid( $gid );
$self->trace( "Implicit GID => $gid" );
return $gid;
}
lib/Daemon/Control.pm view on Meta::CPAN
}
if ( $self->uid ) {
setuid( $self->uid );
$ENV{USER} = $self->user || getpwuid($self->uid);
$ENV{HOME} = ((getpwuid($self->uid))[7]);
$self->trace( "setuid(" . $self->uid . ")" );
$self->trace( "\$ENV{USER} => " . $ENV{USER} );
$self->trace( "\$ENV{HOME} => " . $ENV{HOME} );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Daemon/Device.pm view on Meta::CPAN
on_message
data
) );
if ( not $self->{_daemon}{user} ) {
my $user = getlogin || getpwuid($<) || 'root';
$self->{_daemon}{user} ||= $user;
}
$self->{_daemon}{group} ||= ( getgrgid( (getpwnam( $self->{_daemon}{user} ) )[3] ) )[0];
croak 'new() called without "daemon" parameter as a hashref' unless ( ref( $self->{_daemon} ) eq 'HASH' );
view all matches for this distribution
view release on metacpan or search on metacpan
_Deparsed_XSubs.pm view on Meta::CPAN
sub getpayload;
sub getpgrp;
sub getpid;
sub getppid;
sub getpwnam;
sub getpwuid;
sub gets;
sub getuid;
sub gmtime;
sub hypot;
sub ilogb;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/WebService.pm view on Meta::CPAN
# If the Authorization method is an external script
if ($plg->auth_method ne 'INTERNAL') {
unless (exists $method->{Command}) {warn "The active Authentication method \"".$plg->auth_method."\" does not know what to do\n"; exit 1}
$method->{Command} =~s/^MODULE_INSTALL_DIR/$module_dir/;
unless (-f $method->{Command}) {warn "Sorry, could not found the external authorization utility $method->{Command}\n"; exit 1}
unless (-x $method->{Command}) {warn "Sorry, the external authorization utility $method->{Command} is not executable from user ". getpwuid($>) ."\n"; exit 1}
if ((exists $method->{'Use sudo'}) && ($method->{'Use sudo'}=~/(?i)[y1t]/)) {
my $sudo = undef;
foreach (qw[/usr/bin /bin /usr/sbin /sbin]) { if ((-f "$_/sudo") && -x ("$_/sudo")) { $sudo="$_/sudo"; last } }
unless (defined $sudo) {warn "Could not found sudo command\n"; exit 1}
lib/Dancer2/Plugin/WebService.pm view on Meta::CPAN
}
print STDOUT "\n";
print STDOUT "Application name : ", $plg->dsl->config->{appname} ,"\n";
print STDOUT 'Start time : ', scalar localtime $^T ,"\n";
print STDOUT 'Run as user : ', (getpwuid($>))[0] ,"\n";
print STDOUT "Command : $0\n";
print STDOUT "PID parent : ", getppid() ,"\n";
print STDOUT "PID Main : $$\n";
print STDOUT 'Authorization method : ', ( $plg->auth_method ? $plg->auth_method :'UNDEFINED' ) ,"\n";
print STDOUT "Authorization scripts : $module_dir/\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/AnyXfer/Elastic/Utils.pm view on Meta::CPAN
my ( $self, $name, $hostname, $user, $package ) = @_;
croak "name not supplied" unless $name;
$hostname //= Sys::Hostname::hostname;
$user //= getpwuid($>) || $>;
$package //= $self->_find_test_package_name;
my $safe_name
= join( '_', grep {$_} ( $user, $hostname, $package, $name ) );
view all matches for this distribution
view release on metacpan or search on metacpan
CTable/Listing.pm view on Meta::CPAN
File Filename component of Path (= Base + Ext)
Type File or directory
Perms Permissions (from Mode), specified as an octal string
Owner Unix owner name: getpwuid(UID) (empty on Win)
Group Unix owner name: getgrgid(GID) (empty on Win)
Mon TMon + 1 (range 1 to 12)
Year TYear + 1900 (range 1900 to 2038)
CTable/Listing.pm view on Meta::CPAN
$t->col(Perms => [map {sprintf("%04o", $_ & 0777)} @{$t->col('Mode')}]);
## Add columns translating the UID and GID into their string form.
$t->col(Owner => [map {((eval{getpwuid($_)})[0]) } @{$t->col('UID' )}]);
$t->col(Group => [map {((eval{getgrgid($_)})[0]) } @{$t->col('GID' )}]);
## Add a column showing the full file name.
$t->col(Mon => $t->calc(sub{$main::TMon + 1}));
$t->col(Year => $t->calc(sub{$main::TYear + 1900}));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Dump/PHP.pm view on Meta::CPAN
endprotoent endpwent endservent eof eq eval exec exists exit exp fcntl
fileno flock for foreach fork format formline ge 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 grep gt hex if index int ioctl join keys
kill last lc lcfirst le length link listen local localtime lock log
lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct
open opendir or ord pack package pipe pop pos print printf prototype
push q qq qr quotemeta qw qx rand read readdir readline readlink
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Dump/Ruby.pm view on Meta::CPAN
endprotoent endpwent endservent eof eq eval exec exists exit exp fcntl
fileno flock for foreach fork format formline ge 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 grep gt hex if index int ioctl join keys
kill last lc lcfirst le length link listen local localtime lock log
lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct
open opendir or ord pack package pipe pop pos print printf prototype
push q qq qr quotemeta qw qx rand read readdir readline readlink
view all matches for this distribution
view release on metacpan or search on metacpan
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_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031010||Viu
get_regclass_nonbitmap_data|5.031010||Viu
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
eg/processes.psgi view on Meta::CPAN
# Only show processes for this user
next unless $p->{'uid'} == $>;
$datatable->add_rows({
pid => $p->{'pid'},
uid => { v => $p->{'uid'}, f => (getpwuid( $p->{'uid'} ))[0] },
size => { v => $p->{'size'}, f => format_bytes( $p->{'size'} ) },
cmd => $p->{'cmndline'},
since => { v => $p->{'start'}, f => ago( time - $p->{'start'} ) }
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
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
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/Data/Printer/Config.pm view on Meta::CPAN
}
if (not $home and exists $ENV{HOME} and $ENV{HOME}) {
$home = $ENV{HOME};
}
# Light desperation on any (Unixish) platform
SCOPE: { $home = (getpwuid($<))[7] if not defined $home }
if (defined $home and ! -d $home ) {
$home = undef;
}
return $home;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/encoders/dbi.t view on Meta::CPAN
if ( defined $dbd{dbname} ) {
push @DBDs, \%dbd;
$dbd{user} //= getpwuid( $< )->name;
shift @DBDs if $ENV{TEST_DRSE_ALTERNATE_ONLY};
}
else {
bail_out "No dbname set; specify it via the TEST_DRSE_DBNAME env variable" ;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Rlist.pm view on Meta::CPAN
}
# Build file header. Compile $data to file $fh, return undef.
my $host = eval { use Sys::Hostname; hostname; } || 'some unknown machine';
my $uid = getlogin || getpwuid($<);
my $tm = localtime;
my $prec; $prec = $options->{precision} if ref $options and defined $options->{precision};
my $eol = $/; $eol = $options->{eol_space} if ref $options and defined $options->{eol_space};
my @header =
map { (length) ? "# $_\n" : "#\n" }
view all matches for this distribution
view release on metacpan or search on metacpan
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
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
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
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/DataStore/CAS/FS/Importer.pm view on Meta::CPAN
if ($self->{flags}{collect_unix_perm}) {
$attrs{unix_mode}= ($stat->[2] & ~Fcntl::S_IFMT());
my $uid= $attrs{unix_uid}= $stat->[4];
if (my $cache= $self->unix_uid_cache) {
if (!exists $cache->{$uid}) {
my $name= getpwuid($uid);
if (!defined $name) {
$self->_handle_metadata_error("No username for UID $uid");
} elsif ($self->utf8_filenames) {
$name= DataStore::CAS::FS::InvalidUTF8->decode_utf8($name);
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Manip/DM5.pm view on Meta::CPAN
my($user,$home)=();
# ~aaa/bbb= ~ aaa /bbb
if ($file =~ s|^~([^/]*)||) {
$user=$1;
# Single user operating systems (Mac, MSWindows) don't have the getpwnam
# and getpwuid routines defined. Try to catch various different ways
# of knowing we are on one of these systems:
return "" if ($OS eq "Windows" or
$OS eq "Mac" or
$OS eq "Netware" or
$OS eq "MPE");
$user="" if (! defined $user);
if ($user) {
$home= (getpwnam($user))[7];
} else {
$home= (getpwuid($<))[7];
}
$home = VMS::Filespec::unixpath($home) if ($OS eq "VMS");
return "" if (! defined $home);
$file="$home/$file";
}
view all matches for this distribution