[Pkg-shadow-devel] Bug#524139: login: tty perms very, weirdly wrong on console

Sven Joachim svenjoac at gmx.de
Wed Apr 15 11:22:30 UTC 2009


On 2009-04-15 08:31 +0200, Sven Joachim wrote:

> On 2009-04-15 06:26 +0200, Chip Salzenberg wrote:
>
>> Package: login
>> Version: 1:4.1.3-1
>> Severity: grave
>>
>> When logging in on the console, the permission on e.g. /dev/tty1 are Weirdly Wrong:
>>
>>    # ls -l /dev/tty1
>>    c--x-wx--T 1 root 4, 1 Apr 14 21:24 /dev/tty1
>>
>> "That's not right.  It's not even wrong."
>
> Same here.  Looks like a problem with octal vs decimal numbers, because
> that weird permissions are 1130 numerical, and 01130 = 600 in decimal.

The problem seems to be in the getlong function in lib/getlong.c, it
uses the wrong base for strtol:

	val = strtol (numstr, &endptr, 10);

and numstr contains "0600", so the result is 600 aka 01130 instead of
384 aka 0600.  Probably that line just needs to be changed to

	val = strtol (numstr, &endptr, 0);

to fix the problem.

Sven





More information about the Pkg-shadow-devel mailing list