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 < guito.li...@gmail.com>: > 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 <p...@draigbrady.com>: > > 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. >> > >> > [root@fedoralab ~]# logname >> > root >> > >> > [root@fedoralab ~]# su - flab >> > [flab@fedoralab ~]$ logname >> > root >> > >> > [flab@fedoralab ~]$ cd coreutils/build >> > [flab@fedoralab build]$ make >> > >> > ... a lot of output ... >> > >> > [flab@fedoralab 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. >> >> >