view release on metacpan or search on metacpan
lib/Net/FullAuto.pm view on Meta::CPAN
=item
use Net::FullAuto;
my $ip_or_hostname = $ARGV[0] || 'localhost';
my $username = $ARGV[1] || getlogin || getpwuid($<);
my $identity_file = $ARGV[2] || ''; # required unless password or
# or key-based login
my $password = $ARGV[3] || ''; # required unless identity file
# or key-based login
my $remote_host_block={
lib/Net/FullAuto.pm view on Meta::CPAN
=item
use Net::FullAuto;
my $ip_or_hostname = $ARGV[0] || 'localhost';
my $username = $ARGV[1] || getlogin || getpwuid($<);
my $identity_file = $ARGV[2] || ''; # required unless password or
# or key-based login
my $password = $ARGV[3] || ''; # required unless identity file
# or key-based login
lib/Net/FullAuto.pm view on Meta::CPAN
=item
use Net::FullAuto;
my $ip_or_hostname = $ARGV[0] || 'localhost';
my $username = $ARGV[1] || getlogin || getpwuid($<);
my $identity_file = $ARGV[2] || ''; # required unless password or
# or key-based login
my $password = $ARGV[3] || ''; # required unless identity file
# or key-based login
view all matches for this distribution
view release on metacpan or search on metacpan
#Some convenient tags
%EXPORT_TAGS =
( 'resolve' => [qw( hesiod_init hesiod_end hesiod_resolve)],
'all' => [ qw( hesiod_init hesiod_end hesiod_resolve
hesiod_to_bind hesiod_getpwnam hesiod_getpwuid
hesiod_getservbyname hesiod_getmailhost) ]
);
# 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_OK = qw( hesiod_init hesiod_end hesiod_resolve
hesiod_to_bind hesiod_getpwnam hesiod_getpwuid
hesiod_getservbyname hesiod_getmailhost);
$VERSION = '1.11';
sub AUTOLOAD {
}
my $name=shift;
return hesiod_getpwnam($context,$name);
}
sub getpwuid($$)
{ my $context = shift;
if ( ! ref($context) )
{ croak "Net::Hesiod::getpwuid called as class method.";
}
my $uid=shift;
return hesiod_getpwuid($context,$uid);
}
sub getservbyname($$$)
{ my $context = shift;
if ( ! ref($context) )
=head2 Non-OO interface
use Net::Hesiod qw(
hesiod_init hesiod_end hesiod_to_bind hesiod_resolve
hesiod_getpwnam hesiod_getpwuid
hesiod_getservbyname hesiod_getmailhost );
$res=hesiod_init($context);
$bindname = hesiod_to_bind($context,$name,$type);
@results = hesiod_resolve($context,$name,$type);
@pwent = hesiod_getpwnam($context,$username);
@pwent = hesiod_getpwuid($context,$uid);
@servent = hesiod_getservbyname($context,$servicename,$proto);
@mhent = hesiod_getmailhost($context,$username);
$bindname = $ctxt->to_bind($name,$type);
@results = $ctxt->resolve($name,$type);
@pwent = $ctxt->getpwnam($username);
@pwent = $ctxt->getpwuid($uid);
@servent = $ctxt->getservbyname($servicename,$proto);
@mhent = $ctxt->getmailhost($username);
$results = $ctxt->query($name,$type,$delim);
The C<hesiod_resolve> routine and the C<resolve> method perform an actual
query. As with all DNS queries, multiple records can be returned, each of
which is returned as separate items in returned list. Usually, only the
first item is relevant.
The routines C<hesiod_getpwnam>, C<hesiod_getpwuid>, C<hesiod_getservbyname>,
and the related methods (C<getpwnam>, C<getpwuid>, and C<getservbyname>), are
hesiod versions of the Core Perl routines C<getpwnam>, C<getpwuid>, and
C<getservbyname>. The arrays returned have the same structure as the Core
routines. B<NOTE>: The service entry returned by C<hesiod_getservbyname> and
the related method has the port number in host-byte order, not network-byte
order as the standard C servent structure does. This is consistent with the
CORE C<getservbyname> and related functions.
=item hesiod_to_bind
=item hesiod_getpwnam
=item hesiod_getpwuid
=item hesiod_getservbyname
=item hesiod_getmailhost
L<hesiod>
L<hesiod_init>, L<hesiod_end>, L<hesiod_to_bind>, L<hesiod_resolve>
L<hesiod_getpwnam>, L<hesiod_getpwuid>, L<hesiod_getservbyname>, L<hesiod_getmailhost>
MIT's Athena Project
http://web.mit.edu/is/athena/
=back
view all matches for this distribution
view release on metacpan or search on metacpan
Connection.pm view on Meta::CPAN
my $self = { # obvious defaults go here, rest are user-set
_debug => $_[0]->{_debug},
_port => 6667,
# Evals are for non-UNIX machines, just to make sure.
_username => eval { scalar getpwuid($>) } || $ENV{USER} || $ENV{LOGNAME} || "japh",
_ircname => $ENV{IRCNAME} || eval { (getpwuid($>))[6] } || "Just Another Perl Hacker",
_nick => $ENV{IRCNICK} || eval { scalar getpwuid($>) } || $ENV{USER} || $ENV{LOGNAME} || "WankerBot",
_ignore => {},
_handler => {},
_verbose => 0, # Is this an OK default?
_parent => shift,
_frag => '',
Connection.pm view on Meta::CPAN
croak "No server address specified in connect()";
}
$self->server( $ENV{IRCSERVER} );
}
unless ($self->nick) {
$self->nick($ENV{IRCNICK} || eval { scalar getpwuid($>) }
|| $ENV{USER} || $ENV{LOGNAME} || "WankerBot");
}
unless ($self->port) {
$self->port($ENV{IRCPORT} || 6667);
}
unless ($self->ircname) {
$self->ircname($ENV{IRCNAME} || eval { (getpwuid($>))[6] }
|| "Just Another Perl Hacker");
}
unless ($self->username) {
$self->username(eval { scalar getpwuid($>) } || $ENV{USER}
|| $ENV{LOGNAME} || "japh");
}
# Now for the socket stuff...
if ($self->connected) {
view all matches for this distribution
view release on metacpan or search on metacpan
print "# identd tells us we're $username\n";
print $accept "you are $username\n";
close $accept;
close $listen;
# if you think the above is an extremely silly way to do getpwuid($<),
# think again. Just for fun, let's compare the ID we got with getpwuid
# and co... sometimes it IS different (for privacy-enhanced identd)
if ( ( getpwuid($<) && $username ne getpwuid($<) )
&& ( getlogin() && $username ne getlogin() )
&& ( $ENV{USER} && $username ne $ENV{USER} ) ) {
print "# Hmm... that doesn't look like getpwuid(\$<) = \"", getpwuid($<) || "(undef)", "\"\n";
print "# nor like getlogin() = \"", getlogin() || "(undef)", "\"\n";
print "# nor like $ENV{USER} = \"", $ENV{USER} || "(undef)", "\"\n";
}
# let apache warm up some more, if necessary
view all matches for this distribution
view release on metacpan or search on metacpan
IdentServer.pm view on Meta::CPAN
$this->not_found(@_);
return;
}
my $name = getpwuid( $found );
unless( $name =~ m/\w/ ) {
# This can happen if a deleted user has a socket open. 'u' might be a better choice.
# I happen to think hidden user is a nice choice here.
$this->log(2, "lookup from $rem_addr for $local_port, $rem_port: found uid, but no pwent");
view all matches for this distribution
view release on metacpan or search on metacpan
my $user;
if ($^O eq 'MSWin32') {
$user = getlogin();
} else {
$user = scalar(getpwuid($>));
}
$self->{Jobs}->{$jobkey} = {
JobID => $jobid,
Jobname => $jobname,
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
my $name =
$arg{Name} ||
$ENV{USER} ||
$ENV{LOGNAME} ||
((getpwuid($<))[0]);
$self->{refno} = 1;
$self->{socket} = IO::Socket::INET->new(
PeerAddr => $host,
view all matches for this distribution
view release on metacpan or search on metacpan
$time = "0:01" unless $time;
#
# Default user
#
my $user = $opts{"u"} || (getpwuid($<))[0];
my $wuser = (getpwuid($<))[0];
#
# Store information as follows:
#
# $cron->{user}->{host}->{ cron }->[ min hour day mon weekday args ]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/OpenSSH/More.pm view on Meta::CPAN
use Time::HiRes ();
use Term::ANSIColor ();
my %defaults = (
'user' => $ENV{'USER'} || getpwuid($>),
'port' => 22,
'use_persistent_shell' => 0,
'output_prefix' => '',
'home' => File::HomeDir->my_home,
'retry_interval' => 6,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/OpenSSH.pm view on Meta::CPAN
push @ssh_opts, -l => $user if defined $user;
push @ssh_opts, -p => $port if defined $port;
my $home = do {
local ($@, $SIG{__DIE__});
eval { Cwd::realpath((getpwuid $>)[7]) }
};
if (${^TAINT}) {
($home) = $home =~ /^(.*)$/;
Scalar::Util::tainted($ENV{PATH}) and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Printer.pm view on Meta::CPAN
my $myname = hostname();
my $snum = int(rand 1000);
# Fill up hash
$chash{'1H'} = $myname;
$chash{'2P'} = getlogin || getpwuid($<) || "nobody";
$chash{'3J'} = $self->{filename};
$chash{'4C'} = $myname;
$chash{'5f'} = sprintf("dfA%03d%s", $snum, $myname);
$chash{'6U'} = sprintf("cfA%03d%s", $snum, $myname,);
$chash{'7N'} = $self->{filename};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/RDAP.pm view on Meta::CPAN
use Net::RDAP::Registry;
use Net::RDAP::SearchResult;
use Net::RDAP::Service;
use Net::RDAP::Values;
use Net::RDAP::JCard;
use POSIX qw(getpwuid);
use vars qw($VERSION);
use constant {
DEFAULT_CACHE_TTL => 3600,
DEFAULT_ACCEPT_LANGUAGE => "en",
};
lib/Net/RDAP.pm view on Meta::CPAN
ref($self),
sha256_hex(join(chr(0), (
$VERSION,
$url->as_string,
$lang,
getpwuid($<),
)))
)
);
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/RRP/Toolkit.pm view on Meta::CPAN
$Net::RRP::Toolkit::VERSION = (split " ", '# $Id: Toolkit.pm,v 1.3 2000/10/04 08:05:37 mkul Exp $ ')[3];
sub decodeTilde
{
my $path = shift || return undef;
$path =~ s/^~([^\/]*)/$1 ? (getpwnam($1))[7] : (getpwuid($>))[7]/e;
$path;
}
sub safeCall
{
view all matches for this distribution
view release on metacpan or search on metacpan
diag("\nFurther testing requires credentials to login to this box");
if ($ENV{NRS_INTERACTIVE} and prompt(q{Run this test? [y/n]: }, -yes))
{
sleep 1;
diag("\nWe need a username to test");
my $login = getpwuid($<);
my $user = prompt(qq{Username [$login]: }, -d => $login);
sleep 1;
diag("\nWe need the user's password to test authentication");
my $pass = prompt(qq{Password for $user: }, -e => '*');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Respite/Client.pm view on Meta::CPAN
my $name = $self->service_name;
my $method = shift || throw "Missing $name service method", undef, 1;
my $args = shift || {};
throw "Invalid $name service args", {method => $method, args => $args}, 1 if ref($args) ne 'HASH';
local $args->{'_i'} = $self->{'remote_ip'} || $ENV{'REMOTE_ADDR'} || (($ENV{'REALUSER'} || $ENV{'SUDO_USER'}) ? 'sudo' : 'cmdline');
local $args->{'_w'} = $self->{'remote_user'} || $ENV{'REALUSER'} || $ENV{'SUDO_USER'} || $ENV{'REMOTE_USER'} || $ENV{'USER'} || (getpwuid($<))[0] || '-unknown-';
local $args->{'_t'} = $self->{'token'} if !$args->{'_t'} && $self->{'token'};
local $args->{'_c'} = do {my $i = my $c = 0; $c = [(caller $i++)[0..3]] while !$i || $c->[0]->isa(__PACKAGE__); join '; ', @$c} if ! $self->config(no_trace => undef, $name);
local $self->{'flat'} = exists($args->{'_flat'}) ? delete($args->{'_flat'}) : $self->config(flat => undef, $name);
return $self->_remote_call($method, $args) if $self->_needs_remote($method);
return $self->_local_call( $method, $args);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm view on Meta::CPAN
my $port = delete $opts->{port} || 22;
%$opts and return;
unless (defined $auth_args{username}) {
local $SIG{__DIE__};
$auth_args{username} = eval { scalar getpwuid $< };
defined $auth_args{username} or croak "required option 'user' missing";
}
$ssh2 = $self->{_ssh2} = Net::SSH2->new();
$debug and $debug & 131072 and $ssh2->debug(1);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/SFTP/Server/FS.pm view on Meta::CPAN
our @month2name = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
sub resolve_uid {
my ($self, $uid) = @_;
my $name = getpwuid $uid;
defined $name ? $name : $uid;
}
sub resolve_gid {
my ($self, $gid) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
bin/sftp-server.pl view on Meta::CPAN
# hard limits on process memory usage;
setrlimit( RLIMIT_RSS, $MEMLIMIT, $MEMLIMIT );
setrlimit( RLIMIT_VMEM, $MEMLIMIT, $MEMLIMIT );
my $debug = (defined DEBUG_USER->{uc(getpwuid($>))} and DEBUG_USER->{uc(getpwuid($>))}) ? 1 : 0;
my $sftp = Net::SFTP::SftpServer->new(
debug => $debug,
home => '/var/upload/sftp',
file_perms => 0660,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/SSH/Any/Backend/Net_SSH2.pm view on Meta::CPAN
return;
}
$config_dir = File::Spec->join($appdata, 'libnet-ssh-any-perl');
}
else {
my $home = (getpwuid $>)[7];
$home = $ENV{HOME} unless defined $home;
unless (defined $home) {
$any->_set_error(SSHA_CONNECTION_ERROR, "unable to determine user home directory");
return;
}
lib/Net/SSH/Any/Backend/Net_SSH2.pm view on Meta::CPAN
__check_host_key($any) or return;
my %aa;
$aa{username} = _first_defined($be_opts->{user},
eval { (getpwuid $<)[0] },
eval { getlogin() });
$aa{password} = $be_opts->{password} if defined $be_opts->{password};
$aa{passphrase} = $be_opts->{passphrase} if defined $be_opts->{passphrase};
if (defined (my $private = $be_opts->{key_path})) {
unless (-f $private) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/SSH/AuthorizedKeysFile.pm view on Meta::CPAN
###########################################
my($self, $user) = @_;
if(!defined $user) {
my $uid = $>;
$user = getpwuid($uid);
if(!defined $user) {
ERROR "getpwuid of $uid failed ($!)";
return undef;
}
}
my @pwent = getpwnam($user);
view all matches for this distribution
view release on metacpan or search on metacpan
my $ssh = Net::SSH::Perl->new($host || $this_host,
port => $port || 'ssh',
cipher => Net::SSH::Perl::Cipher::name($c),
debug => 1);
my $this_user = $ENV{USERNAME} || scalar getpwuid($<);
print "Enter your username on that host: [$this_user] ";
chomp(my $user = <STDIN>);
use Term::ReadKey;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/SSH/Tunnel.pm view on Meta::CPAN
port => 10000,
type => 'local',
action => 'setup',
help => 0,
debug => 0,
user => scalar( getpwuid($>) ),
sshport => 22,
};
GetOptions(
$opts,
view all matches for this distribution
view release on metacpan or search on metacpan
example/read.pl view on Meta::CPAN
$ssh2->connect('localhost') or $ssh2->die_with_error;
$ssh2->check_hostkey('ask') or $ssh2->die_with_error;
# use an interactive authentication method with default callback
# (if a password is provided here, it will forward it without prompting)
$ssh2->auth(username => scalar getpwuid($<), interact => 1)
or $ssh2->die_with_error;
sub _read {
my $handle = shift;
while (my $line = <$handle>) {
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/Net/Sieve.pm view on Meta::CPAN
$user = $ENV{LOGNAME};
} else {
die "Unable to figure out a default user, sorry.\n";
}
} else {
$user = getpwuid $>;
}
# this should handle the non-mswin32 case if 64bit _is_ different.
die "Unable to figure out a default user, sorry!\n"
unless defined $user;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Squid/ReverseProxy.pm view on Meta::CPAN
my $cache_dir_size = $arg{'cache_dir_size'} || 50;
my $visible_hostname = $arg{'visible_hostname'} || 'localhost.localdomain';
if ($arg{'cache_dir'} ) {
my $uid = (stat $arg{'cache_dir'})[4];
my $user = (getpwuid $uid)[0];
if ($user ne 'nobody') {
croak "init failed, $arg{'cache_dir'} must be owned by nobody";
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/WWD/Functions.pm view on Meta::CPAN
$code =~ s/getprotobyname\(//g;
$code =~ s/getprotobynumber\(//g;
$code =~ s/getprotoent\(//g;
$code =~ s/getpwent\(//g;
$code =~ s/getpwnam\(//g;
$code =~ s/getpwuid\(//g;
$code =~ s/getservbyname\(//g;
$code =~ s/getservbyport\(//g;
$code =~ s/getservent\(//g;
$code =~ s/glob\(//g;
$code =~ s/import\(//g;
view all matches for this distribution
view release on metacpan or search on metacpan
demo/shell_server.pl view on Meta::CPAN
owner => $loop,
listen => 1,
addr => $host,
port => $port,
on_read => sub {
my $shell = (getpwuid $>)[8] or die "No shell!";
my $session = rand;
my $did_handshake;
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