Commit Graph

663 Commits

Author SHA1 Message Date
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 d54749cf33 docs: agetty manual update
Tell users how to see what issue escape will print by using other
commands, such as uname.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-27 23:21:21 +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 a7a4aa9857 mesg: add \n to usage() output
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-14 17:16:30 +02:00
Karel Zak e1167ce2ec mesg: man page clean wqup
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-14 17:11:23 +02:00
Sami Kerola 849c6ea3f7 mesg: new --verbose option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 17:08:00 +02:00
Sami Kerola ea87bbf679 mesg: add long options to the man page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 17:07:55 +02:00
Sami Kerola fe16e12513 mesg: use long options, also --help and --version added
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 17:07:26 +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 e9980cf8f1 docs: agetty long options
Long options to manual page with the new --version and --help.
The manual page option order is also set to be the same as it is
in code. For the persons who don't see the order it is short
option case in sensitive alphabetical order.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-14 13:20:25 +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
Sami Kerola 7ca59ef25f script: optional timing output file argument added
And update to manual page accordingly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 14:21:36 +02:00
Sami Kerola ed66f51588 docs: scriptreplay add note about new options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 14:21:36 +02:00
Sami Kerola 0da871b50d scriptreplay: allow arguments as command line switches
The command line switches override old style arguments

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 14:21:36 +02:00
Sami Kerola 178365ef96 docs: scriptreplay mention basic long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 14:20:01 +02:00
Sami Kerola 84adb5e65e scriptreplay: support long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 14:19:44 +02:00
Sami Kerola f004a02d80 scriptreplay: end printing with new line
Depending on opinion this is either modest bug fix or tiny
improvement.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 13:35:37 +02:00
Karel Zak 9123987458 script: don't include err.h directly 2011-04-12 12:57:56 +02:00
Karel Zak 35b671371b wall: support --timeout switch (vol 2.)
This is the rest of the commit

	cae7485e59

the original patch was committed without man page and Makefile
changes. Sorry.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:50:00 +02:00
Karel Zak c666d1d170 wall: cleanup mbufsize usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:49:28 +02:00
Sami Kerola cae7485e59 wall: support --timeout switch
The switch controls message write time out to terminals.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 11:31:21 +02:00
Sami Kerola e89c3891a5 wall: add long options and 79 char cut info to the man page
Mention that over 79 characters long lines are cut, while long
options is an obvious change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-12 11:29:13 +02:00
Sami Kerola 5e6bf8008b ttymsg: fix compiler warnings and use EXIT_
[kzak@redhat.com: - remove 'register' storage class specifier]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:19:15 +02:00
Sami Kerola 76cc41b7fb wall: use long options
Also --version & --help options added, and rewrote help output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:12:17 +02:00
Sami Kerola 98e2d4deb3 wall: remove global variables and support TMPDIR
The TMPDIR environment is preferred over _PATH_TMP in which a
file is created that is ultimately sent to terminals. This patch
will also fix compiler warnings and removes magical numbers,
which has not explanation.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-12 11:09:42 +02:00
Karel Zak 9497ebb074 setterm: use xmalloc()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:24:23 +02:00
Sami Kerola 172ba4f2a8 setterm: fix variable types, and unused argument warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:21:48 +02:00
Sami Kerola 9350520053 setterm: add note about long dump file paths to man page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:20:48 +02:00
Sami Kerola a973947c88 setterm: function screendump coding style fixed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:19:15 +02:00
Sami Kerola 6e8e22adf6 setterm: mention in man setterm.1 -version and -help switches
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 11:15:15 +02:00
Sami Kerola 261f1423fb setterm: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:13:40 +02:00
Sami Kerola faa0548de4 setterm: support -help and -version options
[kzak@redhat.com: - merge all options to the one string]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-06 11:10:34 +02:00
Sami Kerola 2971543625 setterm: segfault with long dump file name
The patch will make too long path to be truncated to MAX_PATH
lenght. If user supplies too long file name that is caught at
fopen. Some users might find this unintuitive, so the altered
behavior will be mantioned in manual page.

Bug in earlier version was visible with a command bellow.

setterm -dump -file $(for i in $(seq 254); do printf x ; done)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-04-06 10:59:17 +02:00
Karel Zak c738bc32a4 build-sys: fix distcheck for term-utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-04 10:53:07 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Karel Zak 342da61035 build-sys: add term-utils/.gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:29:34 +01:00
Karel Zak db6772a19c build-sys: move wall to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:20:33 +01:00
Karel Zak c4571e4908 build-sys: move mesg to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:18:31 +01:00
Karel Zak 720d1af42e build-sys: move reset to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:08:30 +01:00
Karel Zak c76d33bacc build-sys: move script and scriptreplay to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:06:23 +01:00
Karel Zak 8c59914ee2 build-sys: move setterm to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 14:02:01 +01: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
Karel Zak c0f20acb7a build-sys: add term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-02 13:54:05 +01:00