bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test-getlogin false failure in non login shells


From: Guilherme de Almeida Suckevicz
Subject: Re: test-getlogin false failure in non login shells
Date: Tue, 13 May 2014 16:39:05 -0300

Hi Pádraig,

Thanks for the answer! I will work on a patch for that.

I think the better way to fix this is check the getlogin(3) against the
owner of the controlling terminal, this is, using the ttyname(3), stat(2)
and the field pw_name of getpwuid(3).

Is it right!?

Thanks!
Guilherme Almeida.



2014-05-13 16:13 GMT-03:00 Guilherme de Almeida Suckevicz <address@hidden>:
Hi Pádraig,

Thanks for the answer! I will work on a patch for that.

I think the better way to fix this is check the getlogin(3) against the
owner of the controlling terminal, this is, using the ttyname(3), stat(2)
and the field pw_name of getpwuid(3).

Is it right!?

Thanks!
Guilherme Almeida.


2014-05-13 15:38 GMT-03:00 Pádraig Brady <address@hidden>:

On 05/13/2014 07:27 PM, Guilherme de Almeida Suckevicz wrote:
> Hello!
>
> I would like to ask if this gnulib test is right.
> I will reproduce some steps to arrive there and explain what is happening!
>
> I have a virtual machine with Fedora 20 installed, so logging with ssh as
> root.
>
> address@hidden ~]# logname
> root
>
> address@hidden ~]# su - flab
> address@hidden ~]$ logname
> root
>
> address@hidden ~]$ cd coreutils/build
> address@hidden build]$ make
>
> ... a lot of output ...
>
> address@hidden build]$ make check
>
> ... a lot of output ...
>
> It fails on the test-getlogin.c!
> Exactly on this part:
>
>       ASSERT (strcmp (buf, name) == 0);
>
> Because the buf content is the result of the getlogin function, this is,
> the owner of the controlling terminal, and the content of name, that is the
> USER or LOGNAME environment variable that is set by the shell, like they
> are differentthe test fails.
>
>
> If it is really an error and if is possible, I would like to help and make
> the changes!

Yes that doesn't look right.
I noticed this too when running: sudo make check
It would be good to get that fixed up.

thanks!
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]