Bug#524139: login: tty perms very, weirdly wrong on console

2009-04-15 Thread Sven Joachim
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.

Sven



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2009-04-15 Thread Peter Vrabec
yeah, same problem in case home directories.

why didn't we catch this in pre-release  :(

On Wednesday 15 April 2009 01:22:30 pm Sven Joachim wrote:
 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



 ___
 Pkg-shadow-devel mailing list
 pkg-shadow-de...@lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/pkg-shadow-devel


diff -up shadow-4.1.3/lib/getlong.c.base shadow-4.1.3/lib/getlong.c
--- shadow-4.1.3/lib/getlong.c.base	2009-04-11 00:37:28.0 +0200
+++ shadow-4.1.3/lib/getlong.c	2009-04-15 13:38:49.0 +0200
@@ -41,7 +41,7 @@ int getlong (const char *numstr, long in
 	char *endptr;
 
 	errno = 0;
-	val = strtol (numstr, endptr, 10);
+	val = strtol (numstr, endptr, 0);
 	if (('\0' == numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
 		return 0;
 	}


Bug#524139: login: tty perms very, weirdly wrong on console

2009-04-15 Thread Sven Joachim
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



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#524139: login: tty perms very, weirdly wrong on console

2009-04-15 Thread Nicolas François
Hello,

Thank you all for noticing, investigating and providing patches.

I will provide a new upstream release and Debian package tonight.

Best Regards,
-- 
Nekral



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#524139: login: tty perms very, weirdly wrong on console

2009-04-14 Thread Chip Salzenberg
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.
Priority grave becuase of the group-write bit.

And no, I haven't been playing with login.defs:

   # grep '^TTY' /etc/login.defs
   TYGROUPtty
   TTYPERM0600


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-1-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages login depends on:
ii  libc6 2.9-7  GNU C Library: Shared libraries
ii  libpam-modules1.0.1-9Pluggable Authentication Modules f
ii  libpam-runtime1.0.1-9Runtime support for the PAM librar
ii  libpam0g  1.0.1-9Pluggable Authentication Modules l

login recommends no packages.

login suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org