[Botan-devel] Configure.pl changes

Jack Lloyd lloyd at randombit.net
Thu Sep 11 12:02:19 EDT 2008


On Thu, Sep 11, 2008 at 09:01:32PM +0800, Joel Low wrote:
> Hey Jack,
> 
> Getpwuid is not defined for Windows (I think) and configure is giving me
> errors now, just thought I'd let you know.

> Regards,
> 
> Joel

Hi Joel,

Thanks for the report. I should have tested this, but actually this
was very surprising, it looks like Perl on Windows is just killing the
process when getpwuid is called, rather than simply returning undef!
This is completely contrary to the documentation; perlfunc suggests
getting the username by:

   $login = getlogin || getpwuid($<) || "Kilroy";

while I wrote:

  $$config{'user'} = getpwuid($<) || "unknown";

So if getpwuid had returned undef, it would have set the user to
unknown. I skipped getlogin because it was described in terms of
reading utmp records, so I doubted it would work on anything but
Unix. But getpwuid can do that without any problems, so I skipped the
getlogin. However it looks like the leading getlogin is really
required. It also works for Windows though, returning a readable
username, a fact which is not documented in my version of Perl.

-Jack



More information about the botan-devel mailing list