[Pkg-shadow-devel] Bug#479406: su fails for users with a POSIX script as their login shell

Stephane Chazelas stephane_chazelas at yahoo.fr
Sun May 4 16:46:49 UTC 2008


Package: login
Version: 1:4.1.1-1
Severity: normal


(Note that the same applies to "login").

With this password entry:

test:x:1000:1000:test:/:/tmp/x

And /tmp/x being an executable file containing this only line:

echo test

When logging in as user "test", or with

su test

you get:

Cannot execute /tmp/x: Exec format error

Although not widely known that way of writing shell scripts is
*the* standard (POSIX and Unix) way. The behavior is unspecified
as per POSIX if your file starts with "#!".

All the utilities specified by POSIX and that may execute
commands (sh, env, exec, ex, vi, awk...) and the
execvp/execlp/system/popen libc functions are meant to recognise
those files (the text files that don't start with #!): upon a
ENOEXEC, they should have the file interpreted by a standard
sh.

I'll concede login and su are not specified by POSIX, but it
would make more sense that they behave the same way as other
standard utilities.

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

Kernel: Linux 2.6.25-rc8 (PREEMPT)
Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages login depends on:
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libpam-modules                0.99.7.1-6 Pluggable Authentication Modules f
ii  libpam-runtime                0.99.7.1-6 Runtime support for the PAM librar
ii  libpam0g                      0.99.7.1-6 Pluggable Authentication Modules l

login recommends no packages.

-- debconf-show failed





More information about the Pkg-shadow-devel mailing list