Commit Graph

28 Commits

Author SHA1 Message Date
Samuel Thibault b0198a1163 agetty: C.UTF-8 locale instead of en_US.UTF-8
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-08-08 11:50:21 +02:00
Samuel Thibault 7478fce029 agetty: only enable F_UTF8 if kernel has already set IUTF8.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-08-08 11:49:58 +02:00
Werner Fink 8408647d89 agetty: Fix IUTF8 flag
Preserve IUTF8 as set up by the kernel, which knows which consoles are
in utf8 mode.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Werner Fink <werner@suse.de>
2011-08-02 14:20:31 +02:00
Samuel Thibault 4585ec0b29 misc: hurd build fixes
* Make blkdev_is_misaligned return 0 when BLKALIGNOFF is not available.
* Make procutils.c include c.h to get a PATH_MAX replacement.
* Provide agetty.c USE_SYSLOG, DEFAULT_VCTERM and DEFAULT_STERM
  defaults for Hurd.
* Make agetty.c only deal with OFDEL, XCASE and VSWTCH if they are
  available.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-20 12:48:35 +02:00
Karel Zak 4a9b7543ae agetty: try next speed after CBREAK
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-18 14:19:39 +02:00
Karel Zak ca8e91a4bf agetty: don't use xalloc.h stuff
agetty logs errors and warnings to syslog, we shouldn't use err.h
stuff here.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-17 14:02:57 +02:00
Karel Zak 3fc62fd3a5 agetty: remove unnecessary options synonyms
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-17 13:21:45 +02:00
Karel Zak a694957a9a agetty: use a generic function for strings concatenation
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-17 13:03:52 +02:00
Karel Zak 763d7a8705 agetty: remove unnecessary space and "(void)" junk
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-17 11:36:02 +02:00
Dr. Werner Fink e85281a8ac aggety: further mingetty features
Allow the system adminstrator to provide options to the login
program.   Some changes for several layouts of the agetty
prompt like short host name or full qualified host name.
Four options enables the user to delay agetty after start,
to change the working directory, to change the root directory,
and to modified scheduling priority.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:13:19 +02:00
Werner Fink eb8e1f9f0c agetty: add an autologin feature
Add an autologin feature to agetty, that is that a user can be
automatically logged in.  For this the options of for the
login program has to used.  Make it possible to pass-through
options to the login program which requires a security check.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:13:06 +02:00
Dr. Werner Fink 1683f6bf20 agetty: better support of virtual console
Better support of virtual console due support of UTF-8 login names
provided by e.g. LDAP.  Set default size 24/80 on serial modem lines
if not found by the kernel.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:11:30 +02:00
Werner Fink 0da025da8e agetty: check virtual console for UTF-8 support
Check out a virtual console line for UTF-8 support, also skip
modem specific setups on a virtual console line.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:10:36 +02:00
Werner Fink 3aa6b68f7e agetty: proper session on the terminal line
Ensure a proper session on the terminal line, that is do a
vhangup() and become the controlling terminal.  After this
determine if the terminal line a virtual console by using
the ioctl TIOCMGET to get the status modem bits of a serial
line which is a invalid argument on a virtual console.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:10:21 +02:00
Werner Fink 729def03e1 agetty: cleanup argv parsing, utmp update, use writeall(), etc.
Next cleanup, that is split off special character parsing in do_prompt()
and parse_args(), handle name of line of virtual console and use it in
utmp update as well as the session id.  Also move the initial TERM
variable to open_tty() as we use this later in open_tty().  Use writeall()
but avoid repeat to often for EAGAIN (compare with info page of the
(g)libc, description of the macro EAGAIN).

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:10:03 +02:00
Werner Fink bde20e1b2b agetty: more code cleanup
More code cleanup, that is use bit mask for eight bit option, use
modern speed_t type, split local error() into local log_err(), log_warn(),
and dolog() for fine graduated logging with syslogger.

Signed-off-by: Werner Fink <werner@suse.de>
2011-05-17 11:08:49 +02:00
Sami Kerola 96cc7b0b3e agetty.c: move issue path to pathnames.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-27 23:21:19 +02:00
Sami Kerola 53d5504235 agetty.c: further scrubbing
In reply to two requests.

http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/3990
http://permalink.gmane.org/gmane.linux.utilities.util-linux-ng/3999

The scubbing consists;

o Old school introduction back to the top of the source file.
o Indentation changes.
o Removal of void casting.
o Removal of braces from single statements.
o Unified format for comments.
o Comparison with W. Venema's code from 1993 to clean few comment
  mysteries.
o Web referrals added to further explanation to near the code or
  comments which some could find difficult to understand why.
o Clean up of comments.
o FIXME items added where attention is needed.
o Make functions static.
o Functions with same argument types use same argument order.
o Get rid of classic K&R style function declarations.

Please notice that this patch _should not_ affect how program
works e.g. this has no actual code changes.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-27 23:21:17 +02:00
Karel Zak 70bedfa1db agetty: coding style - fix identation
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-14 13:43:11 +02:00
Karel Zak b75c8134aa agetty: coding style - fix comments, remove tailing whitespace
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-14 13:25:57 +02:00
Sami Kerola 72f286b5f6 agetty: getopt case segment reordering
The case clause after getopts is in alphabetical order, just like
option string definition and manual page. The patch also convers
spaces to tabs in this code block.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:20:26 +02:00
Sami Kerola 214af4fd0f agetty: symbolic standard file descriptors
I find it easier to read code in which standard file descriptors
are symbolic strings rather than numbers.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:20:25 +02:00
Sami Kerola af19306b8d agetty: #endif comments
The longer #ifdef ... #endif markups have now at the end section
comment where they begun, which should improve preprosessor
directive readability.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:20:25 +02:00
Sami Kerola 7c45597f91 agetty: error message about required arguments
This patch also fixes only remaining magical number to EXIT_*
markup.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:20:25 +02:00
Sami Kerola 3b4113f2a6 agetty: use long options
This patch will introducing --help and --version options, which
does not have short version. Reason to this is a that the -h was
already assigned.

[kzak@redhat.com: - fix one usage call,
                  - use %1$s in usage printf format
                  - remove "static const" from enum]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-14 13:15:36 +02:00
Sami Kerola 82cd61f251 agetty: use program_invocation_short_name
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:09:09 +02:00
Sami Kerola be66a93afc agetty: use xalloc.h
Unifies and fixes malloc and strdup calls.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:08:59 +02:00
Karel Zak cf56b8b507 build-sys: move agetty to term-utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 13:57:00 +01:00