view release on metacpan or search on metacpan
lib/Trash/Park.pm view on Meta::CPAN
my($self) = @_;
return sprintf "%s %s %10s %s",
scalar format_mode($self->{mode} & 07777),
nice_time($self->{move_time}),
getpwuid($self->{uid}) || $self->{uid},
$self->{file};
}
###########################################
sub nice_time {
view all matches for this distribution
view release on metacpan or search on metacpan
t/tree-lexicon.t view on Meta::CPAN
'b' => [ 'bind', 'binmode', 'bless', 'break' ],
'c' => [ 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'cmp', 'connect', 'continue', 'cos', 'crypt' ],
'd' => [ 'dbmclose', 'dbmopen', 'defined', 'delete', 'die', 'do', 'dump' ],
'e' => [ 'each', 'else', 'elsif', 'endgrent', 'endhostent', 'endnetent', 'endprotoent', 'endpwent', 'endservent', 'eof', 'eq', 'eval', 'exec', 'exists', 'exit', 'exp' ],
'f' => [ 'fcntl', 'fileno', 'flock', 'for', 'foreach', 'fork', 'format', 'formline' ],
'g' => [ 'ge', 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority', 'getprotobyname', 'getprot...
'h' => [ 'hex' ],
'i' => [ 'if', 'index', 'int', 'ioctl' ],
'j' => [ 'join' ],
'k' => [ 'keys', 'kill' ],
'l' => [ 'last', 'lc', 'lcfirst', 'le', 'length', 'link', 'listen', 'local', 'localtime', 'lock', 'log', 'lstat', 'lt' ],
view all matches for this distribution
view release on metacpan or search on metacpan
PseudoIncLib.pm view on Meta::CPAN
) = stat ($full_file_name);
# on this stage the sub-directory has some (fictive in my understanding) size...
$row->{size} = $size_2;
$row->{inode} = $ino;
$row->{owner} = getpwuid($uid) unless $self->{skip_owner};
$row->{group} = getgrgid($gid) unless $self->{skip_group};
if ($type eq 'd') {
# one directory might have multiple rpm-owners like:
# [slava@PBC110 slava]$ rpm -qf /usr/lib/perl5/5.6.1/i386-linux
PseudoIncLib.pm view on Meta::CPAN
unless ($self->{skip_mode}){
my $permissions = sprintf "%04o", $mode & 07777;
$lib_descr->{permissions_octal_text} = $permissions;
}
$lib_descr->{owner} = getpwuid($uid) unless $self->{skip_owner};
$lib_descr->{group} = getgrgid($gid) unless $self->{skip_group};
$lib_descr->{inode} = $ino;
$lib_descr->{child_dir_list} = $self->_dir_description (
root_dir => $dir,
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/Tripletail.pm view on Meta::CPAN
my $this = shift;
my $uid = $<;
my ($username, $home);
if( $^O ne 'MSWin32' )
{
$username = getpwuid($uid);
$home = (getpwuid($uid))[7];
}else
{
$username = 'anonymous';
$home = 'C:/';
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pod/Simple/Wiki/Twiki/Upload.pm view on Meta::CPAN
$twikiweb ||= 'Main';
my %files = make_file_list;
return unless %files;
my $user = $ENV{TWIKI_USER} || prompt("What is your twiki user id?", scalar(getpwuid($<)));
chomp($user);
$user =~ s/ $//;
system("stty -echo");
my $pass = $ENV{TWIKI_PASS} || prompt("What is your twiki password?", '');
chomp($pass);
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
lib/UI/Dialog/Backend/Nautilus.pm view on Meta::CPAN
}
sub _get_desktop_dir {
my $self = shift();
# Figure out the user's home directory
my @user = getpwuid($>);
my $home = undef;
if (@user > 7 && -d $user[7]) {
$home = $user[7];
}
# check for XDG paths to home directory
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/UR/Context/Process.pm view on Meta::CPAN
{
$real_user_name = 'WindowsUser';
}
else
{
$real_user_name = getpwuid($<) || getlogin || 'unknown';
}
}
return $real_user_name;
}
lib/UR/Context/Process.pm view on Meta::CPAN
{
my $class = shift;
if (!$effective_user_name)
{
$effective_user_name = getpwuid($>) || 'unknown';
}
return $effective_user_name;
}
=pod
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Eutf2.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/Ubic/Admin/Setup.pm view on Meta::CPAN
print_tty "Default user will be used in this case.\n";
$default_user = prompt_str("Default user?", $opt_default_user);
}
else {
print_tty "\n";
$default_user = getpwuid($>);
unless (defined $default_user) {
die "Can't get login (uid '$>')";
}
print_tty "You're using local installation, so default service user will be set to '$default_user'.\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
unqlite/unqlite.c view on Meta::CPAN
{
#ifndef JX9_UNIX_STATIC_BUILD
struct passwd *pwd;
uid_t uid;
uid = getuid();
pwd = getpwuid(uid); /* Try getting UID for username */
if (pwd == 0) {
return;
}
/* Return the username */
jx9_result_string(pCtx, pwd->pw_name, -1);
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
$registry_loaded=1;
1}
sub _getHomeDir {
$ENV{HOME}
|| eval ( '(getpwuid($<))[7]' ) # for systems not supporting getpwuid
|| "/";
}
sub _add_registry_entry {
my ($S, $name, $src, $map, $srcURL, $style, $aliasL, $info) = @_;
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/Unicorn/Manager/CLI/Proc.pm view on Meta::CPAN
my %user_table = %{ $self->process_table->ptable };
my @users = keys %user_table;
for (@users) {
my $username = getpwuid $_;
$user_table{$username} = $user_table{$_};
delete $user_table{$_};
}
return {%user_table};
view all matches for this distribution
view release on metacpan or search on metacpan
t/unprivileged.t view on Meta::CPAN
my @current_groups = split ' ', $);
shift @current_groups;
is_deeply {map { ($_ => 1) } getgroups}, {map { ($_ => 1) } @current_groups},
'Retrieved supplementary groups';
my $username = getpwuid $>;
my $gid = (getpwnam $username)[3];
SKIP: {
skip 'getgrouplist not implemented', 6 unless eval { Unix::Groups::FFI->import('getgrouplist'); 1 };
view all matches for this distribution
view release on metacpan or search on metacpan
for (my $i=0; $i < $conf{attempts}; $i++) {
print OUTPUT $banner; # /etc/issue
if ($conf{sameuser}) {
$logintry = getpwuid($<)
|| croak "Unidentifiable user running process";
} else {
do {
print OUTPUT $conf{login};
$logintry = <INPUT>;
module provides). Here are some specifics on the function provided:
=head2 login(option => value, option => value)
This prompts for the username and password and tries to validate
the login. On success, it returns the same thing that getpwuid()
does: the username in a scalar context, or the passwd struct as
an array in a list context. It returns undef on failure.
You can pass it an optional set of parameters. These will specify
options for that login prompt only. The parameters and their default
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unix/Mgt.pm view on Meta::CPAN
#
=head2 get
Unix::Mgt::User->get() retrieves user account information using C<getpwnam> or
C<getpwuid>. The single param for this method is either the name or the uid of
the user.
$user = Unix::Mgt::User->get('vera');
$user = Unix::Mgt::User->get('1010');
lib/Unix/Mgt.pm view on Meta::CPAN
# TESTING
# println subname(method=>1); ##i
# return
if ($name =~ m|^\d+$|s)
{ return getpwuid($name) }
else
{ return getpwnam($name) }
}
#
# fields
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unix/Passwd/File.pm view on Meta::CPAN
summary => 'Get user details by username or uid',
description => <<'_',
Either `user` OR `uid` must be specified.
The function is not dissimilar to Unix's `getpwnam()` or `getpwuid()`.
_
args_rels => {
'choose_one' => [qw/user uid/],
},
lib/Unix/Passwd/File.pm view on Meta::CPAN
Get user details by username or uid.
Either C<user> OR C<uid> must be specified.
The function is not dissimilar to Unix's C<getpwnam()> or C<getpwuid()>.
This function is not exported by default, but exportable.
Arguments ('*' denotes required arguments):
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unix/SetUser.pm view on Meta::CPAN
}
}
else {
# use user's primary group if no primary group specified
if ( !defined($group) ) {
$gid = (getpwuid($uid))[3];
if ( !defined($gid)) {
croak "Failed to get primary group ID for uid '$uid'";
}
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Unix/setuid.pm view on Meta::CPAN
}
{
package Unix::setuid::ruser;
sub TIESCALAR { bless [], $_[0] }
sub FETCH { my @pw = getpwuid($<); @pw ? $pw[0] : $< }
sub STORE {
if ($_[1] =~ /\A\d+\z/) {
$< = $_[1];
} else {
my @pw = getpwuid($_[1]);
die "No such user '$_[1]'" unless @pw;
$< = $pw[2];
}
}
}
{
package Unix::setuid::euser;
sub TIESCALAR { bless [], $_[0] }
sub FETCH { my @pw = getpwuid($>); @pw ? $pw[0] : $> }
sub STORE {
if ($_[1] =~ /\A\d+\z/) {
$> = $_[1];
} else {
my @pw = getpwnam($_[1]);
view all matches for this distribution
view release on metacpan or search on metacpan
if (!home)
{
struct passwd *pw;
if ((pw = getpwuid (getuid ())))
home = pw->pw_dir;
else
home = "/tmp";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/User/AccountChecker.pm view on Meta::CPAN
=cut
sub isuser {
my ($this, $name) = @_;
return ($name eq getpwuid($<)) ? 1 : 0;
}
=head2 isroot
C<$object-E<gt>isroot()>
view all matches for this distribution
view release on metacpan or search on metacpan
$loaded = 1;
print "ok 1\n";
######################### End of black magic.
$user = getlogin || getpwuid($<) || $ENV{USER};
$term = ttyname(undef);
$term =~ s|^/dev/||;
###############################################################################
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-getgrouplist-for-root.t view on Meta::CPAN
my $username = undef;
my $gid;
my @ent;
@ent = getpwuid(0); # Is this a unix/linuxish O/S (includes MacOS)?
if (@ent) {
$username = 'root';
$gid = 0;
} else { # Or is it Cygwin?
my @ent = getpwuid(500); # We expect the "Administrator" account to be uid 500
$username = $ent[0];
$gid = $ent[4];
}
note("Checking user $username to be in group $gid\n");
view all matches for this distribution
view release on metacpan or search on metacpan
return "";
}
sub Login {
return getlogin || getpwuid( $< ) || $ENV{ LOGNAME } || $ENV{ USER } ||
$ENV{ USERNAME } || 'unknown';
}
1;
__END__
greatly solicited.
=item Login
Returns login id of user on either Unix or NT by checking C<getlogin>,
C<getpwuid>, and various environment variables.
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Util/SelfDestruct.pm view on Meta::CPAN
use Cwd qw(abs_path);
use Fcntl qw(:DEFAULT :flock);
use constant DEBUG => $ENV{'DEBUG'} ? 1 : 0;
use constant PROGRAM_NAME => -e abs_path($0) ? abs_path($0) : undef;
use constant HOME => -d (getpwuid($>))[7] ? (getpwuid($>))[7] : $ENV{HOME};
use constant RC_FILE => HOME.'/.selfdestruct';
use vars qw($VERSION $PARAM);
$VERSION = '1.21' || sprintf('%d.%02d', q$Revision$ =~ /(\d+)/g);
$PARAM = {};
view all matches for this distribution
view release on metacpan or search on metacpan
"Environment variable \$VBHOME to an alternate location\n";
exit 1;
}
# See if we're running as the userid 'vbtk', and warn if not.
my ($uname) = getpwuid($<);
if($uname ne 'vbtk')
{
print STDOUT "\n" .
"It is recommended that you run all VB processes under a separate userid,\n" .
"such as 'vbtk'. You are currently running with the userid '$uname'.\n";
view all matches for this distribution