Bug#333138: [Pkg-shadow-devel] Bug#333138: chfn behaves bogusly when either fd 0, 1 or 2 is not a tty

Christian Perrier bubulle at debian.org
Mon Oct 10 18:08:01 UTC 2005


> Package: passwd
> Version: 1:4.0.3-39
> Severity: normal

Testing with 4.0.13 (next version). Should be the same with 4.0.12
(the version in unstable and Wednesday in testing):

> 
> aragorn:~# chfn rmh
> Changing the user information for rmh
> Enter the new value, or press ENTER for the default
>         Full Name [rmh]:^C
> aragorn:~# cat | chfn rmh
> Changing the user information for rmh
> Enter the new value, or press ENTER for the default
> ^C

If you enter "something" here, even on more than 1 line, then chfn
will do what's advertised and change informations:

root at mykerinos:/tmp# useradd krabs
root at mykerinos:/tmp# cat | LC_ALL=C chfn krabs
Changing the user information for krabs
Enter the new value, or press ENTER for the default
Captain Krabs
Krusty Krab
Spongebob boss
and Carlo boss as well
THE big boss
        Full Name []:   Room Number []:         Work Phone []:  Home Phone []:        Other []:
root at mykerinos:/tmp# grep krabs /etc/passwd
krabs:x:1004:100:Captain Krabs,Krusty Krab,Spongebob boss,and Carlo boss as well,THE big boss:/home/krabs:/bin/sh


The display is a bit clumsy because the prompts are sent to stdout but
you can get it clean:

root at mykerinos:/tmp# cat | LC_ALL=C chfn krabs >/dev/null
Captain Krabs
Krusty Krab
Spongebob boss
and Carlo boss as well
THE big boss

root at mykerinos:/tmp#    

> aragorn:~# chfn rmh | cat
> ^C

No idea what you're actually trying to do here...


> aragorn:~# chfn rmh 2>&1 | cat
> ^C

Same here




So, I actually fail to see what is exactly the bug you report.






More information about the Pkg-shadow-devel mailing list