--- Steve Peters <[EMAIL PROTECTED]> escreveu:
> Whenever getpwnam() returns undef, $! should be set.
> Without properly
> checking $!, you will not have a way to understand
> what the root cause
> error is. There will be no way to determine whether
> the problem is in
> Perl or glibc.
>
> Steve
Ok, here is a patch:
<patch>
*** addsmb Mon Feb 18 16:04:06 2008
--- addsmb.new Mon Feb 18 16:03:01 2008
***************
*** 153,159 ****
my $password = shift;
my @errors;
! do { sleep 1; } until ( getpwnam($user) );
my $runner = IPC::Open3::Simple->new(
--- 153,159 ----
my $password = shift;
my @errors;
! getpwnam($user) or die "Cannot fetch $user
information with getpwnam(): $!\n";
my $runner = IPC::Open3::Simple->new(
***************
*** 200,205 ****
--- 200,207 ----
my $gid = shift;
my $uid = getpwnam($user);
+ die "Cannot fetch $user information with
getpwnam(): $!\n"
+ unless ( defined($uid) );
die "Cannot create $home_dir home directory: $!"
unless ( mkdir($home_dir) );
</patch>
I'm not sure if a attachment will be accepted, that's
why I'm putting the patch in the message body.
I still don't have a way to test this right now,
although. Hope Tiago got a change before me.
Regards,
Alceu Rodrigues de Freitas Junior
--------------------------------------
[EMAIL PROTECTED]
http://www.imortais.cjb.net
-----------------------------------------------------------------------
A well-used door needs no oil on its hinges.
A swift-flowing stream does not grow stagnant.
Neither sound nor thoughts can travel through a vacuum.
Software rots if not used.
These are great mysteries -- The Tao Of Programming, 5.1
Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
armazenamento!
http://br.mail.yahoo.com/
--
Failure when using getpwnam core function from perl
https://bugs.launchpad.net/bugs/192055
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs