view release on metacpan or search on metacpan
lib/Archive/Libarchive/FFI/Function.pod view on Meta::CPAN
=head2 archive_read_disk_set_standard_lookup
my $status = archive_read_disk_set_standard_lookup($archive);
This convenience function installs a standard set of user and group name lookup functions.
These functions use C<getpwuid> and C<getgrgid> to convert ids to names, defaulting to C<undef>.
if the names cannot be looked up. These functions also implement a simple memory cache to
reduce the number of calls to C<getpwuid> and C<getgrgid>.
=head2 archive_read_disk_set_symlink_hybrid
my $status = archive_read_disk_set_symlink_hybrid($archive);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Libarchive/XS.xs view on Meta::CPAN
=head2 archive_read_disk_set_standard_lookup
my $status = archive_read_disk_set_standard_lookup($archive);
This convenience function installs a standard set of user and group name lookup functions.
These functions use C<getpwuid> and C<getgrgid> to convert ids to names, defaulting to C<undef>.
if the names cannot be looked up. These functions also implement a simple memory cache to
reduce the number of calls to C<getpwuid> and C<getgrgid>.
=cut
#if HAS_archive_read_disk_set_standard_lookup
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Tar/Builder/UserCache.pm view on Meta::CPAN
sub lookup {
my ( $self, $uid, $gid ) = @_;
unless ( exists $self->{'users'}->{$uid} ) {
if ( my @pwent = getpwuid($uid) ) {
$self->{'users'}->{$uid} = $pwent[0];
}
else {
$self->{'users'}->{$uid} = undef;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/Tar/Constant.pm view on Meta::CPAN
use constant READ_ONLY => sub { shift() ? 'rb' : 'r' };
use constant WRITE_ONLY => sub { $_[0] ? 'wb' . shift : 'w' };
use constant MODE_READ => sub { $_[0] =~ /^r/ ? 1 : 0 };
# Pointless assignment to make -w shut up
my $getpwuid; $getpwuid = 'unknown' unless eval { my $f = getpwuid (0); };
my $getgrgid; $getgrgid = 'unknown' unless eval { my $f = getgrgid (0); };
use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) || '' };
use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) || '' };
use constant UID => $>;
use constant GID => (split ' ', $) )[0];
use constant MODE => do { 0666 & (0777 & ~umask) };
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/Astro/App/Satpass2.pm view on Meta::CPAN
suspect the latter, but will welcome evidence of the former.
Any unquoted token or redirection file name which begins with a tilde
(C<~>) has tilde expansion performed on everything up to the first slash
(C</>), or the end of the token, B<provided> the operating system
supports this. The empty username is expanded using C<getpwuid()> if
this is supported, or various possibly-OS-specific environment variables
if not. Non-empty user names are expanded if C<getpwnam()> is supported
B<and> the user actually exists; otherwise an exception is raised. Tilde
expansion is not done inside quotes (either single or double), even if
the tilde is the first character. This is consistent with C<bash(1)>.
view all matches for this distribution
view release on metacpan or search on metacpan
my $found = 0;
use Env qw(USER HOME);
my $username = getlogin() || getpwuid($<) || $USER || `whoami`;
foreach ($HOME,"$HOME/iraf","/home/$username/iraf","/home/$username") {
if (-e "$_/login.cl" && -d "$_/uparm/"){
$startdir = $_;
/home/$username
=back
the script uses the first directory where it finds the file F<login.cl> and the directory F<uparm>. $HOME is the environment variable of that name. The variable $username is found by the script using getlogin(3C), getpwuid(3C), the environment variab...
=head2 Loading/Unloading IRAF packages
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
Data/Makefile.PL view on Meta::CPAN
$ver = $Config{'gccversion'};
if ($ver ge "2.8")
{
eval
{
if ((getpwuid($<))[6] =~ /Nick\s+Ing-Simmons/)
{
# This is the author - catch as many bugs as possible
$gccopt .= "-Wall -W -Wsign-compare";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
10 hours.
If successful, sets the USER, HOME, and SHELL environment variables,
the current uid and gid, and chdirs to HOME.
In an array context, returns an array ref to the result from getpwuid($afs_uid).
In a scalar context, returns error strings in a hash like
$err->{pass} = "unknown user or wrong password";
=back
view all matches for this distribution
view release on metacpan or search on metacpan
print "Enter the PIN+token for ${testuser}'s SecurID card. ";
($result, $shell) = $ace->Auth($testuser);
printok($testno++, $result == ACM_OK, "failed Authen::ACE::Auth for $testuser");
$username = (getpwuid($<))[0];
print "Wait for your SecurID card's token to change; press Enter to continue "; <>;
print "Re-enter the PIN+token for your SecurID card: ";
ReadMode(2);
$pass = <>;
ReadMode(0);
print ": ";
$ans = <>; chomp $ans;
$pinuser = $ans unless $ans eq "";
$pinuser = "" if $ans eq "NONE";
$testuser = ($pinuser eq "")? (getpwuid($>))[0] : $pinuser;
print "Enter the username to use for the named user tests";
print " [$testuser]" if $testuser ne "";
print ": ";
$ans = <>; chomp $ans;
$testuser = $ans unless $ans eq "";
view all matches for this distribution
view release on metacpan or search on metacpan
Here is an example of using PAM for changing the password of the current
user:
use Authen::PAM;
$login_name = getpwuid($<);
pam_start("passwd", $login_name, $pamh);
pam_chauthtok($pamh);
pam_end($pamh);
view all matches for this distribution
view release on metacpan or search on metacpan
SimplePam.pm view on Meta::CPAN
#returns the EUID that is running this module
sub _get_username {
#we use the EFECTIVE USER ID (EUID),
#not the REAL USER ID ( UID )
my $name = getpwuid($<);
return $name;
}
#checks the meaning os a message
#Returns the state of a message:
view all matches for this distribution
view release on metacpan or search on metacpan
ramblings/remark.js view on Meta::CPAN
require=function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t)...
this.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[this.BACKSLASH_ESCAPE]};this.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)...
SUBST.contains=EXPRESSIONS;return{aliases:["coffee","cson","iced"],keywords:KEYWORDS,contains:EXPRESSIONS.concat([{className:"comment",begin:"###",end:"###"},hljs.HASH_COMMENT_MODE,{className:"function",begin:"("+JS_IDENT_RE+"\\s*=\\s*)?(\\(.*\\))?\\...
}()},{}],8:[function(require,module,exports){exports.addClass=function(element,className){element.className=exports.getClasses(element).concat([className]).join(" ")};exports.removeClass=function(element,className){element.className=exports.getClasse...
events.on("slideChanged",updateHash);navigateByHash()}function navigateByHash(){var slideNoOrName=(dom.getLocationHash()||"").substr(1);events.emit("gotoSlide",slideNoOrName)}function updateHash(slideNoOrName){dom.setLocationHash("#"+slideNoOrName)}}...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/B/DeparseTree/PP_OPtable.pm view on Meta::CPAN
'gpbyname' => ['unop', "getprotobyname"],
'gpbynumber' => ['listop', 'getprotobynumber'],
'gprotoent' => ['baseop', "getprotoent"],
'gpwent' => ['baseop', "getpwent"],
'gpwnam' => ['unop', "getpwnam"],
'gpwuid' => ['unop', "getpwuid"],
'grepstart' => ['baseop', "grep"],
'grepwhile' => ['mapop', 'grep'],
'gsbyname' => ['listop', 'getservbyname'],
'gsbyport' => ['listop', 'getservbyport'],
'gservent' => ['baseop', "getservent"],
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/B/Keywords.pm view on Meta::CPAN
getprotobyname
getprotobynumber
getprotoent
getpwent
getpwnam
getpwuid
getservbyname
getservbyport
getservent
getsockname
getsockopt ),
view all matches for this distribution
view release on metacpan or search on metacpan
bin/bgpmon_analytics_db_report view on Meta::CPAN
our $VERSION = '1.07';
#Variables to hold the database name and login name
#The default value for both values is just the user's name
my $dbname = getlogin || getpwuid($<);
my $dblogin = getlogin || getpwuid($<);
my $ret = GetOptions( "dbname=s" => \$dbname,
"dblogin=s" => \$dblogin);
`psql -c "SELECT PREFIXES,VANTAGES,MOST_ACTIVE FROM (SELECT COUNT(pref) FROM pph.prefixes) AS PREFIXES, (SELECT COUNT(DISTINCT(addr,collector)) FROM pph.peers) AS VANTAGES, (SELECT pph.find_most_active_prefix()) AS MOST_ACTIVE;" -d $dbname -U $dblogi...
view all matches for this distribution
view release on metacpan or search on metacpan
struct passwd *pw;
size_t flen;
size_t len;
flen = strlen(field);
if (!(pw = getpwuid(uid))) {
/* shouldn't ever happen... */
hv_store(h, field, flen, newSViv(uid), 0);
}
else {
len = strlen(pw->pw_name);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Beam/Runnable/AllowUsers.pm view on Meta::CPAN
#pod to run the command, and there are other ways to prevent access to
#pod a file/command.
#pod
#pod =head1 SEE ALSO
#pod
#pod L<Beam::Runnable>, L<perlfunc/getpwuid>, L<< perlvar/$> >>
#pod
#pod =cut
use strict;
use warnings;
lib/Beam/Runnable/AllowUsers.pm view on Meta::CPAN
#pod
#pod =cut
before run => sub {
my ( $self, @args ) = @_;
my $user = getpwuid( $> );
die "Unauthorized user: $user\n"
unless any { $_ eq $user } @{ $self->allow_users };
};
1;
lib/Beam/Runnable/AllowUsers.pm view on Meta::CPAN
This role wraps the C<run> method of your runnable class to check that
the user is authorized.
=head1 SEE ALSO
L<Beam::Runnable>, L<perlfunc/getpwuid>, L<< perlvar/$> >>
=head1 AUTHOR
Doug Bell <preaction@cpan.org>
view all matches for this distribution
view release on metacpan or search on metacpan
examples/chat/lib/MyApp/Client.pm view on Meta::CPAN
exit;
}
$self->{hdl} = AnyEvent::Handle->new( fh => $self->{fh} );
$self->{auth}->login( username => getpwuid($>), password => '123' );
$self->read_line;
$self->{quit_cv} = AnyEvent->condvar;
$self->{quit_cv}->recv;
view all matches for this distribution
view release on metacpan or search on metacpan
share/PerlCritic/Critic/Utils.pm view on Meta::CPAN
getpeername
getpgrp
getprotobyname
getprotobynumber
getpwnam
getpwuid
getsockname
goto
keys
local
prototype
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/Ebig5.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 ! Ebig5::d($home)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ebig5hkscs.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 ! Ebig5hkscs::d($home)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bigtop/Parser.pm view on Meta::CPAN
}
else { # fall back on password file or local equivalent
my $retval = [];
# this eval was stolen from h2xs, but has been reformatted
eval {
my ( $username, $author_gcos ) = ( getpwuid($>) )[0,6];
if ( defined $username && defined $author_gcos ) {
$author_gcos =~ s/,.*$//; # in case of sub fields
view all matches for this distribution
view release on metacpan or search on metacpan
BikePower.pm view on Meta::CPAN
}
};
}
if (!defined $home) {
$home = eval { local $SIG{__DIE__};
(getpwuid($<))[7];
} || $ENV{'HOME'} || '';
$home .= ($^O eq 'MSWin32' ? "/bikepwr.rc" : "/.bikepowerrc");
}
$home;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/BigFile.pm view on Meta::CPAN
}
my $path = Bio::DB::BigFile->udcGetDefaultDir();
return if -w $path;
my $tmp = File::Spec->tmpdir();
my ($user) = getpwuid($<);
$user ||= $<;
$path = File::Spec->catfile($tmp,"udcCache_$user");
Bio::DB::BigFile->udcSetDefaultDir($path);
}
view all matches for this distribution
view release on metacpan or search on metacpan
Das/Segment.pm view on Meta::CPAN
sub get_cached_stylesheet {
my $self = shift;
my $tmpdir = File::Spec->tmpdir;
my $program = basename($0);
my $user = (getpwuid($>))[0];
my $url = $self->das->name.'/stylesheet';
foreach ($program,$user,$url) {
tr/a-zA-Z0-9_-/_/c;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/EnsEMBL/Analysis/Programs.pm view on Meta::CPAN
if ($program =~ m|/|) {
_go_home( $H );
my $path = $program;
# Deal with tildes
$path =~ s{^~([^/]*)}{ $1 ? (getpwnam($1))[7]
: (getpwuid($>))[7] }e;
if (my $real = _is_prog( $H, $path )) {
$Program_Paths{ $program } = $real;
}
}
# Or search through all paths
lib/Bio/EnsEMBL/Analysis/Programs.pm view on Meta::CPAN
push( @missing, $program ) unless $Program_Paths{ $program };
}
# Give informative death message if programs weren't found
if (@missing) {
throw("Unable to locate the following programs as '". (getpwuid($<))[0]. "' on host '". hostname(). "' :\t".
join ( " --> " , @missing )) ;
}
}
# Recursive function which follows links, or tests final destination
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
return $path unless $path =~ m!^~([^/]*)!;
eval {
if ($to_expand = $1) {
$homedir = (getpwnam($to_expand))[7];
} else {
$homedir = (getpwuid($<))[7];
}
return $path unless $homedir;
$path =~ s!^~[^/]*!$homedir!;
};
return $path;
view all matches for this distribution