[Bug 712614] Re: getty can't execute a login program with arguments
Clint Byrum
clint at fewbar.com
Tue Apr 5 15:43:02 UTC 2011
@Scott, good point, logname is not passed through with this patch, so I
think its not really acceptible yet, so I'll unsubscribe sponsors.
@Adrian, the patch is *almost* ready, but not quite. Once the following
changes are done, I'd be happy to send it upstream. Instructions for
doing so yourself are here:
http://git.kernel.org/?p=utils/util-linux/util-
linux.git;a=blob_plain;f=README.devel;hb=master
Here are the changes that need to be made:
a) you need to append "--",logname as the final arguments to login, or explain why you feel thats not necessary anymore.
b) the code is a bit off from the formatting standards, which are here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/CodingStyle
(ignore bits about spaces vs. tabs. util-linux seems to be indented with spaces. Everything else applies).
Specifically
- comments must be /* .. */
- put a space after commas in function arguments.
c) make the patch from the root of the source tree, not from inside term-utils.
d) Just FYI, in newer versions, agetty.c has moved from login-utils to term-utils.
@Adrian, please do these things and then re-subscribe ubuntu-sponsors
Marking the bug as Confirmed, importance Wishlist. I can see this as
quite useful for a secured physical serial console where you just want
the user logged in as soon as they plug in to it.
** Changed in: util-linux (Ubuntu)
Status: Incomplete => Confirmed
** Changed in: util-linux (Ubuntu)
Importance: Undecided => Wishlist
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is a direct subscriber.
https://bugs.launchpad.net/bugs/712614
Title:
getty can't execute a login program with arguments
Status in “util-linux” package in Ubuntu:
Confirmed
Bug description:
Binary package hint: util-linux
/sbin/getty can't run a login program if you pass arguments to the
latter via the '-l' getty optional argument (e.g. in the tty config
file).
how to reproduce:
update any tty config in /etc/init/ , e.g. tty6.conf:
exec /sbin/getty -n -i -l '/bin/login -p -f root' -8 38400 tty6
restart the terminal service: initcl restart tty4
the following error will be logged:
tty6: Can't exec /bin/login -p -f root: No such file or directory
reason: getty is using execl() to execute the login program specified with '-l' option.
fix: use execve(); patch included
One should be able to pass login command arguments to getty. Using a
wrapper to encapsulate login program arguments hides readability and
adds complexity when not necessary.
The attached patch does not alter in any way the existent getty functionality and usage. It just adds what's missing.
The attached patch does not create any security concerns unless getty is explicitly configured in such a way.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: util-linux 2.17.2-0ubuntu1.10.10.1
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic 2.6.35.10
Uname: Linux 2.6.35-25-generic x86_64
NonfreeKernelModules: nvidia wl
Architecture: amd64
Date: Thu Feb 3 18:27:12 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
ProcEnviron:
LANGUAGE=en_US.utf8
LANG=en_US.utf8
LC_MESSAGES=en_US.utf8
SHELL=/bin/bash
SourcePackage: util-linux
More information about the Ubuntu-sponsors
mailing list