view release on metacpan or search on metacpan
lib/Padre/Wx/Scintilla.pm view on Meta::CPAN
endhostent endnetent 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 map mkdir msgctl msgget msgrcv
msgsnd my ne next no not oct open opendir or ord our pack package
pipe pop pos print printf prototype push quotemeta qu
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
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
@ISA = qw(Exporter AutoLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(getpwnam getpwuid);
@EXPORT_OK = qw(mgetpwnam setpwinfo rmpwnam init_db modpwinfo);
$VERSION = '1.05';
}
untie %dbm;
return;
}
sub getpwuid ($) {
my ($self, $uid) = @_;
my (%dbm, @info, $key, $db);
if (ref($self)) {
$db = $self->{'Database'};
use Passwd::DB;
$db = Passwd::DB->new("/usr/local/databases/db_ftp_users");
$db = Passwd::DB->new("/usr/local/databases/db_ftp_users", 'create');
@info = $db->getpwnam('bob');
@info = $db->getpwuid('100');
@minfo = $db->mgetpwnam('bob');
$err = $db->modpwinfo(@minfo);
$err = $db->setpwinfo(@minfo);
$err = $db->rmpwnam('bob');
use Passwd::DB qw(init_db getpwnam getpwuid mgetpwnam modpwinfo setpwinfo rmpwnam);
Passwd::DB->init_db("/usr/local/databases/db_ftp_users");
Passwd::DB->init_db("/usr/local/databases/db_ftp_users", 1);
init_db("/usr/local/db_bob",1);
@info = getpwnam('bob');
@info = getpwuid('100');
@minfo = mgetpwnam('bob');
$err = modpwinfo(@minfo);
$err = setpwinfo(@minfo);
$err = rmpwnam('bob');
=head1 DESCRIPTION
Passwd::DB provides basic password routines. It augments getpwnam and getpwuid functions with setpwinfo, modpwinfo, rmpwnam, mgetpwnam. The routines can be used both in object context or straight. When used in non-object context a call to init_db ...
new and init_db can be called with an optional second argument. If it is set to 1 or 'create' the database will be created if it doesn't already exist.
getpwnam and getpwuid are the same as their respective core counterparts.
setpwinfo and modpwinfo are called with arrays containing (in order):
name, crypted_password, uid, gid, gecos, home_directory, shell
rmpwnam is called with a scalar containing the login name.
=head1 Exported functions on the OK basis
getpwnam
getpwuid
mgetpwnam
modpwinfo
setpwinfo
rmpwnam
init_db
view all matches for this distribution
view release on metacpan or search on metacpan
t/eg/type-here view on Meta::CPAN
use Term::ReadKey;
$|=1;
print "$0\n";
my $user = scalar getpwuid $>;
ReadMode 2;
print "type here:";
my $pw1 = <STDIN>;
ReadMode 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Path/Class/File/Lockable.pm view on Meta::CPAN
if ( $^O eq 'MSWin32' ) {
require Win32;
$owner = Win32::LoginName();
}
else {
$owner = shift || getlogin() || ( getpwuid($<) )[0] || 'anonymous';
}
# we have to lock our lock file first, to avoid
# NFS and race condition badness.
# so obtain a lock on our lock file, write our lock
view all matches for this distribution
view release on metacpan or search on metacpan
use Test::More;
is abs_path(expand_tilde('~')), abs_path($home), '~ expands to home dir';
my $username = eval { getpwuid $> };
$username = getlogin unless defined $username;
SKIP: {
skip 'username not found', 1 unless defined $username;
my $user_home = expand_tilde("~$username");
skip 'user home directory not found', 1 unless defined $user_home and $user_home ne "~$username";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pcore.pm view on Meta::CPAN
if ( defined $ENV->{UID} && !defined $ENV->{GID} ) {
my $uid = $ENV->{UID} =~ /\A\d+\z/sm ? $ENV->{UID} : getpwnam $ENV->{UID};
die qq[Can't find uid "$ENV->{UID}"] if !defined $uid;
$ENV->{GID} = [ getpwuid $uid ]->[2];
}
# change priv
Pcore->sys->change_priv( gid => $ENV->{GID}, uid => $ENV->{UID} );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perinci/CmdLine/Base.pm view on Meta::CPAN
=head2 config_dirs => array of str
Which directories to look for configuration file. The default is to look at the
user's home and then system location. On Unix, it's C<< [ "$ENV{HOME}/.config",
$ENV{HOME}, "/etc"] >>. If $ENV{HOME} is empty, getpwuid() is used to get home
directory entry.
=head2 cleanser => obj
Object to cleanse result for JSON output. By default this is an instance of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perinci/CmdLine/Util/Config.pm view on Meta::CPAN
return join($ENV{HOMEDRIVE}, "\\", $ENV{HOMEPATH})
if $ENV{HOMEDRIVE} && $ENV{HOMEPATH};
} else {
return $ENV{HOME} if $ENV{HOME};
my @pw;
eval { @pw = getpwuid($>) };
return $pw[7] if @pw;
}
die "Can't get home directory";
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/_peri-eg-noop-inline view on Meta::CPAN
# my ($user, $slash) = @_;
# my @ent;
# if (length $user) {
# @ent = getpwnam($user);
# } else {
# @ent = getpwuid($>);
# $user = $ent[0];
# }
# return $ent[7] . $slash if @ent;
# "~$user$slash";
#}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/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
share/win32/config.gc.tt view on Meta::CPAN
d_getprotoprotos='define'
d_getprpwnam='undef'
d_getpwent='undef'
d_getpwent_r='undef'
d_getpwnam_r='undef'
d_getpwuid_r='undef'
d_getsbyname='define'
d_getsbyport='define'
d_getsent='undef'
d_getservbyname_r='undef'
d_getservbyport_r='undef'
share/win32/config.gc.tt view on Meta::CPAN
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
view all matches for this distribution
view release on metacpan or search on metacpan
share/perl-5.16-x86-64int/win32_config.gc.tt view on Meta::CPAN
d_getprotoprotos='define'
d_getprpwnam='undef'
d_getpwent='undef'
d_getpwent_r='undef'
d_getpwnam_r='undef'
d_getpwuid_r='undef'
d_getsbyname='define'
d_getsbyport='define'
d_getsent='undef'
d_getservbyname_r='undef'
d_getservbyport_r='undef'
share/perl-5.16-x86-64int/win32_config.gc.tt view on Meta::CPAN
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
view all matches for this distribution
view release on metacpan or search on metacpan
share-5123/default/win32/config.gc.tt view on Meta::CPAN
d_getprotoprotos='define'
d_getprpwnam='undef'
d_getpwent='undef'
d_getpwent_r='undef'
d_getpwnam_r='undef'
d_getpwuid_r='undef'
d_getsbyname='define'
d_getsbyport='define'
d_getsent='undef'
d_getservbyname_r='undef'
d_getservbyport_r='undef'
share-5123/default/win32/config.gc.tt view on Meta::CPAN
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
view all matches for this distribution
view release on metacpan or search on metacpan
share-5123/default/win32/config.gc.tt view on Meta::CPAN
d_getprotoprotos='define'
d_getprpwnam='undef'
d_getpwent='undef'
d_getpwent_r='undef'
d_getpwnam_r='undef'
d_getpwuid_r='undef'
d_getsbyname='define'
d_getsbyport='define'
d_getsent='undef'
d_getservbyname_r='undef'
d_getservbyport_r='undef'
share-5123/default/win32/config.gc.tt view on Meta::CPAN
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
view all matches for this distribution
view release on metacpan or search on metacpan
share/vanilla/perl-5.10.0/lib/Config_heavy.pl view on Meta::CPAN
d_getprotoprotos='define'
d_getprpwnam='undef'
d_getpwent='undef'
d_getpwent_r='undef'
d_getpwnam_r='undef'
d_getpwuid_r='undef'
d_getsbyname='define'
d_getsbyport='define'
d_getsent='undef'
d_getservbyname_r='undef'
d_getservbyport_r='undef'
share/vanilla/perl-5.10.0/lib/Config_heavy.pl view on Meta::CPAN
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/PrereqScanner/NotQuiteLite/Context.pm view on Meta::CPAN
getprotobyname => 88,
getprotobynumber => 89,
getprotoent => 90,
getpwent => 91,
getpwnam => 92,
getpwuid => 93,
getservbyname => 94,
getservbyport => 95,
getservent => 96,
getsockname => 97,
getsockopt => 98,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/Tidy/Tokenizer.pm view on Meta::CPAN
exp fc fcntl fileno
flock for foreach formline
ge getc getgrgid getgrnam
gethostbyaddr gethostbyname getnetbyaddr getnetbyname
getpeername getpgrp getpriority getprotobyname
getprotobynumber getpwnam getpwuid getservbyname
getservbyport getsockname getsockopt glob
gmtime goto grep gt
hex if index int
ioctl join keys kill
last lc lcfirst le
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/ToPerl6/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
lib/syslog.pl view on Meta::CPAN
$mask = $2;
}
unless ($whoami) {
($whoami = getlogin) ||
($whoami = getpwuid($<)) ||
($whoami = 'syslog');
}
$whoami .= "[$$]" if $lo_pid;
view all matches for this distribution
view release on metacpan or search on metacpan
share/Synopsis/S16-io.pod view on Meta::CPAN
has $gid;
has $gecos;
has $shell;
}
All the information is naturally fetched from the system via getpwuid, getpwnam, or the
like.
=head2 Group role
role Group {
view all matches for this distribution
view release on metacpan or search on metacpan
docs/Perl6/Spec/Functions.pod view on Meta::CPAN
=item getlogin
our Str multi OS::getlogin ()
Returns the username of the account running the program. This may
not be as secure as using C<getpwuid> on some platforms.
=item kill
our Bool multi OS::kill ( OS::Signal $signal, Bool :$group, *@pids )
our Bool multi method Conc::Proc::kill ( Conc::Proc $pid: OS::Signal $signal?, Bool :$group )
view all matches for this distribution
view release on metacpan or search on metacpan
gen/attr-PerlBean.pl view on Meta::CPAN
my $self = shift;
my $fh = shift;
my $m = $MON[(localtime())[4]];
my $y = (localtime())[5] + 1900;
my $p = (getpwuid($>))[6];
my $also = 'TODO';
if (defined($self->get_collection())) {
$also = '';
foreach my $pkg (sort($self->get_collection()->keys_perl_bean())) {
view all matches for this distribution
view release on metacpan or search on metacpan
benchmarks/app/perlfunc.pod view on Meta::CPAN
=item Fetching user and group info
C<endgrent>, C<endhostent>, C<endnetent>, C<endpwent>, C<getgrent>,
C<getgrgid>, C<getgrnam>, C<getlogin>, C<getpwent>, C<getpwnam>,
C<getpwuid>, C<setgrent>, C<setpwent>
=item Fetching network info
C<endprotoent>, C<endservent>, C<gethostbyaddr>, C<gethostbyname>,
C<gethostent>, C<getnetbyaddr>, C<getnetbyname>, C<getnetent>,
benchmarks/app/perlfunc.pod view on Meta::CPAN
C<dbmclose>, C<dbmopen>, C<dump>, C<endgrent>, C<endhostent>,
C<endnetent>, C<endprotoent>, C<endpwent>, C<endservent>, C<exec>,
C<fcntl>, C<flock>, C<fork>, C<getgrent>, C<getgrgid>, C<gethostbyname>,
C<gethostent>, C<getlogin>, C<getnetbyaddr>, C<getnetbyname>, C<getnetent>,
C<getppid>, C<getpgrp>, C<getpriority>, C<getprotobynumber>,
C<getprotoent>, C<getpwent>, C<getpwnam>, C<getpwuid>,
C<getservbyport>, C<getservent>, C<getsockopt>, C<glob>, C<ioctl>,
C<kill>, C<link>, C<lstat>, C<msgctl>, C<msgget>, C<msgrcv>,
C<msgsnd>, C<open>, C<pipe>, C<readlink>, C<rename>, C<select>, C<semctl>,
C<semget>, C<semop>, C<setgrent>, C<sethostent>, C<setnetent>,
C<setpgrp>, C<setpriority>, C<setprotoent>, C<setpwent>,
benchmarks/app/perlfunc.pod view on Meta::CPAN
restrict what salts C<crypt()> accepts.
Here's an example that makes sure that whoever runs this program knows
their password:
$pwd = (getpwuid($<))[1];
system "stty -echo";
print "Password: ";
chomp($word = <STDIN>);
print "\n";
benchmarks/app/perlfunc.pod view on Meta::CPAN
=item getlogin
This implements the C library function of the same name, which on most
systems returns the current login from F</etc/utmp>, if any. If null,
use C<getpwuid>.
$login = getlogin || getpwuid($<) || "Kilroy";
Do not consider C<getlogin> for authentication: it is not as
secure as C<getpwuid>.
=item getpeername SOCKET
Returns the packed sockaddr address of other end of the SOCKET connection.
benchmarks/app/perlfunc.pod view on Meta::CPAN
=item getnetbyname NAME
=item getprotobyname NAME
=item getpwuid UID
=item getgrgid GID
=item getservbyname NAME,PROTO
benchmarks/app/perlfunc.pod view on Meta::CPAN
In scalar context, you get the name, unless the function was a
lookup by name, in which case you get the other thing, whatever it is.
(If the entry doesn't exist you get the undefined value.) For example:
$uid = getpwnam($name);
$name = getpwuid($num);
$name = getpwent();
$gid = getgrnam($name);
$name = getgrgid($num);
$name = getgrent();
#etc.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PerlFM.pm view on Meta::CPAN
while (defined( $datahash{reverse}[$int] )) {
my $entry=$datahash{reverse}[$int];
my $atime=localtime($datahash{names}{$entry}{atime});
my $ctime=localtime($datahash{names}{$entry}{ctime});
my $mtime=localtime($datahash{names}{$entry}{mtime});
my ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell,$expire) = getpwuid($datahash{names}{$entry}{uid});
if (!defined($name)) {
$name=$datahash{names}{$entry}{uid};
}
my ($gname,$gpasswd,$ggid,$members) = getgrgid($datahash{names}{$entry}{gid});
if (!defined($gname)) {
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_re_arg|||xciu
get_re_gclass_nonbitmap_data|5.031010||Viu
get_regclass_nonbitmap_data|5.031010||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
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