Commit Graph

122 Commits

Author SHA1 Message Date
Petr Uzel e12c9866b5 include: rename writeall.h to all-io.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15 11:32:27 +02:00
Sami Kerola cdd2a8c360 term-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:46:25 +02:00
Sami Kerola d2ec3e33f1 script: error in usage() output
Error originates to commit 3ff526391f
which is bit more than year, and part or releases v2.20 & v2.21.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-02 13:14:20 +02:00
Sami Kerola b0660441de reset: make scripts bourne sh compliant [checkbashisms]
In addition strict compliance the commit will take variable name
quoting, and $(command) substitution in use.

$ checkbashisms reset reset.033c
possible bashism in reset line 11 ('$[' should be '$(('):
bot=$[ ${LINES:-`tput lines`} - 1 ]
possible bashism in reset.033c line 11 (echo -e):
echo -e \\033c

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 6a801e1a38 setterm: correct manual page reference
An error from commit faa0548de4

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 7961acce46 fileutils: differentiate xmkstemp and xfmkstemp
Let developer to choose, case by case, what sort of return value is
best in her code.  The xmkstemp() is for users who want file
descriptor as return value of the function, xfmkstemp() will return
FILE pointer.

Proposed-By: Karel Zak <kzak@redhat.com>
CC: Davidlohr Bueso <dave@gnu.org>
Reference: http://marc.info/?l=util-linux-ng&m=133129570124003&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:29:38 +01:00
Sami Kerola a000bbb613 wall: use xmkstemp for temporary file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:04 +01:00
Sami Kerola 041b8ab252 mesg: use rpmatch to yes/no question
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:04 +01:00
Karel Zak 879a7ab470 agetty: move vc initialization to ttyutils.h
... to make the code usable for sulogin.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-12 14:39:32 +01:00
Karel Zak a17f32645d script: play well with csh when invoked from within /etc/csh.login
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797888
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-08 16:02:28 +01:00
Karel Zak d9201203cf agetty: check localtime() result
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-06 16:02:28 +01:00
Francesco Cosoleto 1a204cd216 agetty: add static and const qualifiers
Remove also a static qualifier in main() function.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-12-16 12:49:13 +01:00
Jari Aalto 115bfafafe setterm: order man page items alphabetically
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
2011-12-16 11:25:10 +01:00
Karel Zak 1593b134eb agetty: don't use log_err() for non-fatal errors
The TIOCSCTTY ioctl requires that caller is session leader -- so it
depends on initd (or we have to add setsid() to aggety). It seems that the
traditional way is to setup tty in agetty and session in login(1).

It means that all session related things (TIOCSCTTY, vhangup, ...) in the
command agetty should be optional. (Note that vhangup() is called when
--hangup is explicitly specified on command line, so log_err() makes
sense there.)

Reported-by: Andrew Walrond <andrew@walrond.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-12-08 12:54:49 +01:00
Sami Kerola e11a5e6375 build-sys: check HAVE_ definitions with #ifdef [smatch scan]
Fix to `warning: undefined preprocessor identifier' messages.

[kzak@redhat.com: replace "#ifdef XXX #ifdef YYY" with
                  "#if defined(XXX) && defined(YYY)"]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-12-02 18:27:12 +01:00
Sami Kerola fbc333fec0 build-sys: check HAVE_ definitions with #ifdef [smatch scan]
Fix to `warning: undefined preprocessor identifier' messages.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-02 18:21:46 +01:00
Dennis Jensen 9c62a2326e agetty: map NL to CR-NL on output in initial termiossettings
From: Jacoby Hickerson <hickersonjl@gmail.com>
Signed-off-by: Dennis Jensen <dennis.h.jensen@siemens.com>
2011-11-28 10:34:39 +01:00
Karel Zak 01095ae33c agetty: pass hostname to login(1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-26 23:17:15 +02:00
Sami Kerola 7dab96af41 docs: align wall.1 with howto-man-page.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-03 20:51:39 +02:00
Sami Kerola 1aa1fbaee1 docs: align scriptreplay.1 with howto-man-page.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-03 20:49:04 +02:00
Sami Kerola c5e7b9fa70 docs: align script.1 with howto-man-page.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-03 20:32:45 +02:00
Petr Uzel 960cf5737e misc: use %m in format string instead of %s and strerror(errno)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-09-27 15:46:07 +02:00
Karel Zak b926112726 agetty: test ECHO on c_lflag
Reported-by: xinglp <xinglp@gmail.com>
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=739522
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-26 12:34:10 +02:00
Karel Zak d36ee054ca script: non-ANSI definition [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-12 16:18:16 +02:00
Karel Zak 36601b2343 agetty: add --nohints
Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-12 14:24:27 +02:00
Karel Zak 4d84fcb4c7 script: libintl.h included in nls.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-07 16:29:56 +02:00
Karel Zak 89aed1c950 agetty: double equals sign typo in opentty()
Reported-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-07 07:37:03 +02:00
Natanael Copa 3c911718df script: fix building with --disable-nls
We should only include the libintl.h when NLS is requested.

This fixes issue when building util-linux with uClibc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2011-09-07 07:30:35 +02:00
Karel Zak b89fdd9c05 write: fix path for freopen()
Reported-by: xinglp <xinglp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-06 03:18:46 +02:00
Karel Zak fa25f2289c Merge branch 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit
* 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit:
  docs: remove duplicated text
  docs: require kernel support before accepting use of it
  docs: note about independent super block structs
  docs: add libmount & libblkid debug instructions
  Documentation: add debugging doc
  arch: start using arch as a usage() example
  docs: new file Documentation/release-schedule.txt
  docs: move setuid information from reame to hwclock.8
  docs: clean up old readme files
  docs: copy contributors from legacy files to AUTHORS
  docs: new file Documentation/howto-man-page.txt
  docs: new file Documentation/source-code-management.txt
  docs: new file Documentation/howto-contribute.txt
  docs: new file Documentation/howto-compilation.txt
  docs: tell what the Documentation/ is about
  docs: add usage() howto for contributors
  docs: Documentation directory added
  docs: remove README.clear
2011-08-31 11:04:15 +02:00
Benno Schulenberg 62246430f3 docs: also uniformize headers and footers of troff-formatted man pages
Add two spaces as the required third argument of the date line to make
the specified date get used instead of today's date.  Incorporate the
section number into the page title, then use an empty section number,
so that specifying an explicit section/volume name will work.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:39 +02:00
Benno Schulenberg 557db9cd05 scriptreplay: improve synopsis and formatting and wording in man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:28 +02:00
Benno Schulenberg 232dc924c4 docs: uniformize the header and footer lines in man pages
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.

Also improve here and there the one-line program description.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:21 +02:00
Karel Zak 4c27cd9089 write: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:56:17 +02:00
Karel Zak a290362bb8 wall: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:53:36 +02:00
Karel Zak a1e04e8fe3 setterm: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:50:29 +02:00
Karel Zak 14cc9ddafe scriptreplay: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:43:34 +02:00
Karel Zak 87d6050bb0 script: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:41:06 +02:00
Karel Zak 2960a4a343 mesg: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:39:03 +02:00
Karel Zak c0d38ecdce agetty: clean up usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 11:58:50 +02:00
Benno Schulenberg 73bc3206bc script: normalize formatting of the man page
Also improve the description of the --timing option,
and discard a then superfluous paragraph.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-15 15:49:50 +02:00
Benno Schulenberg 51b65a5bf7 script: indicate that the file argument to --timing is optional
Also improve some other descriptions in the usage message.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-15 15:49:48 +02:00
Benno Schulenberg 1bf3e8a8eb write: remove inconsistent periods from two error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-15 15:49:47 +02:00
Sami Kerola f98d4f766e docs: Documentation directory added
Move readme, licence, change log, relese notes and other
supplementary files to a Documentation directory. This commit
does not change contents of any other but few Makefile.am files.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-08-12 20:19:52 +02:00
Karel Zak 9aeb66dc6b agetty: improve login(1) argv[]
* fix regression: missing username should not be reported (EPERM) if
  -n/--skip-login is given and username is NULL.

* don't compose login options *string* if we can use argv *array* (the
  string is necessary only for --login-options).

* don't overwrite --login-options by --autologin

  The old code silently ignores login-options and "login -f <username>"
  is always used.

  The new code uses:
    a)	"login -f <username>"    by default
    b)	"login <login-options>"  for --login-options + --autologin

  where for b) the username from "--autologin <username>" is used to
  replace \u magic string in <login-options>.

* the \u could be used more than once in one login argv string, for
  example: agetty --login-options "-o user=\\u,name=\\u --foo"

* the space in --login-options is correctly ignored, for example
  agetty --login-options " hello world ".

Reviewed-by: Voelker, Bernhard <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-08 12:07:07 +02:00
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
Petr Uzel e3c5ef39e3 wall: build with SUID_{C,LD}FLAGS
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-08-08 11:49:43 +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
Sami Kerola 739de07650 scriptreplay: fix buffer overflow
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-26 11:58:38 +02:00