[dput-ng-maint] Bug#696785: unable to determine login name

Arno Töll arno at debian.org
Thu Dec 27 12:05:49 UTC 2012


reassign 69678 libc0.1 2.13-37
retitle 69678 getlogin() fails (sometimes) on kfreebsd
thanks

For reference: Christoph tried to use dput-ng on kFreeBSD but it failed
with:

On 27.12.2012 04:16, Christoph Egger wrote:
> [CRITICAL] 1356578085.464574: (<module>) unable to determine login name

This output comes from os.getlogin() in Python. By talking to you, you
confirmed that this command fails for you indeed. However, it works for
me on both kFreeBSD and FreeBSD 8.2:

[root at kfreebsd:/home/arno]# uname -a
GNU/kFreeBSD kfreebsd 9.0-2-amd64 #0 Sat Sep 22 19:00:52 UTC 2012 x86_64
amd64 Intel(R) Core(TM) i7-2620M CPU @ 2.70GHz GNU/kFreeBSD
[root at kfreebsd:/home/arno]# python -c 'import os; print os.getlogin()'
arno


[root at fbsd-test /home/arno]# uname -a
FreeBSD fbsd-test.fritz.box 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb
17 02:41:51 UTC 2011
root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
[root at fbsd-test /home/arno]# python -c 'import os; print os.getlogin()'
arno


Digging further, we revealed that this program does not work either for
Christoph:

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main()
{
        char * login = getlogin();
        if (login)
                printf("%s", login);
        else
                printf("getlogin(): %s", strerror(errno));
}


while it does work for me. Christoph gets:

./a.out
getlogin():Success%

At this point, my knowledge ends. I know that getlogin(3) is not very
reliable, but hopefully it might be a little better than that. At very
least I lack the understanding why it works for me, but fails for
Christoph.


-- 
with kind regards,
Arno Töll
IRC: daemonkeeper on Freenode/OFTC
GnuPG Key-ID: 0x9D80F36D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/dput-ng-maint/attachments/20121227/3f55c83b/attachment.pgp>


More information about the dput-ng-maint mailing list