Commit Graph

147 Commits

Author SHA1 Message Date
Sami Kerola 5da054e070 script: add noreturn function attributes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-26 13:51:33 +02:00
Sami Kerola 4d9e37bfed setterm: fix shadow declaration
term-utils/setterm.c:221:55: warning: declaration of 'opt_term' shadows a global declaration [-Wshadow]
term-utils/setterm.c:181:5: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 13:44:58 +02:00
Mantas Mikulėnas 9002d6504a agetty: remove unnecessary sleep(10)
I'm quite sure this is not supposed to be here (apparently added as part
of commit 783b08fc1c).

Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
2012-07-25 16:13:11 +02:00
Karel Zak 5769a938b4 scriptreplay: fix compiler warning [-Wmissing-prototypes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-16 18:48:27 +02:00
Sami Kerola 289dcc9023 translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Sami Kerola add1b8afd0 translation: unify stat error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Karel Zak 783b08fc1c agetty: close tty before vhangup()
Let's close all tty file descriptors if called with --hangup option.

References: https://lkml.org/lkml/2012/6/5/145
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-12 16:34:56 +02:00
Karel Zak 4459448fbd agetty: make tcsetpgrp() optional
The session setup TIOCSCTTY is optional, so tcsetpgrp() that depends
on controlling terminal should be optional too.

Reported-by: Hilko Bengen <bengen@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-11 18:15:21 +02:00
Sami Kerola 01c5b78794 agetty: use configured run state directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-10 13:00:20 +02:00
Karel Zak dcdb349be7 build-sys: always use default $(LDADD)
The global variable $(LDADD) is always used if program_LDADD is
not specified. Let's use $LDADD everywhere to avoid exceptions for
people who need to specify global $LDADD.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-09 16:23:51 +02:00
Karel Zak f38e5ff355 build-sys: cleanup .gitignore files
- move all binaries to top-level .gitignore
 - remove unnecessary */.gitignore files

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:50:54 +02:00
Karel Zak d77ab74af7 build-sys: convert lib/ to libcommon.la
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:50:53 +02:00
Karel Zak 22d2322eb1 build-sys: convert term-utils/ to module
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 17:53:09 +02:00
Karel Zak 46e28f0431 script: remove unused code
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-21 12:14:34 +02:00
Karel Zak efcf26f44f agetty: more robust debug() macro, check ioctl result [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-21 12:13:08 +02:00
Sami Kerola 66fc066537 scriptreplay: fix compiler format warning
scriptreplay.c:210:3: warning: format '%zd' expects argument of type 'signed size_t *', but argument 4 has type 'size_t *' [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-17 18:00:00 +02:00
Sami Kerola 0e9b73d3fb build: fix redundant redeclaration warnings
env.c:24:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls]
su.c:81:15: warning: redundant redeclaration of 'environ' [-Wredundant-decls]

fstab.c:581:14: warning: redundant redeclaration of 'strsignal' [-Wredundant-decls]

kill.h:1:13: note: previous declaration of 'get_pids' was here
kill.c:152:13: warning: redundant redeclaration of 'get_pids' [-Wredundant-decls]

kill.c:142:5: warning: redundant redeclaration of 'main' [-Wredundant-decls]
getopt.c:89:5: warning: redundant redeclaration of 'main' [-Wredundant-decls]

agetty.c:536:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls]
agetty.c:537:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
script.c:161:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]
wall.c:96:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls]

libmount.h:362:26: note: previous declaration of 'mnt_update_get_fs' was here
libmount.h:454:26: note: previous declaration of 'mnt_context_get_fs' was here
mountP.h:383:26: warning: redundant redeclaration of 'mnt_context_get_fs' [-Wredundant-decls]
mountP.h:398:26: warning: redundant redeclaration of 'mnt_update_get_fs' [-Wredundant-decls]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-11 19:51:35 +02:00
Karel Zak abb53be5cb Merge branch '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit
* '2012wk22' of git://github.com/kerolasa/lelux-utiliteetit:
  docs: clean up getopt.1 manual
  docs: clean up dmesg.1 manual
  docs: clean up chcpu.8 manual
  fileutils: xmkstemp() interface change
  docs: fix all man page groff warnings
  tools: add checkmans.sh
  docs: clean up wdctl.8 manual
  docs: clean up login.1 manual
  login: allow TTYGROUP name begin by number
  build-sys: add su executable to .gitignore
  logindefs: change getlogindefs_num() to return unsigned long

Conflicts:
	login-utils/su.c
	sys-utils/dmesg.1
2012-06-05 16:57:01 +02:00
Bernhard Voelker 871ffd0960 Fix typos in comments and wall's man page
Culprits identified again by (newer) misspellings:

  $ git ls-files | misspellings -f - | grep -v '^po/'

* wall: Fix typo in man page.
* Fix typos in source code comments.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-06-05 14:37:26 +02:00
Dave Reisner 3c4fed097d fileutils: xmkstemp() interface change
We can not let the user control where TMPDIR is for this tempfile.
This will be where we write the updated passwd file, and must be
capable of being moved atomically with rename(2).  Therefore, it
cannot be on a different device, or setpwnam() and vipw/vigr programs
will invariably fail with EXDEV.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:12 +02:00
Sami Kerola 79f8481889 docs: fix all man page groff warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 20:29:12 +02:00
Thomas Schwinge 4658cfd492 write: Don't explicitly include <asm/param.h>.
It doesn't exist on some systems, but will come in via <sys/param.h> on the
others.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2012-05-29 10:11:41 +02:00
Thomas Schwinge e78a7ecd4f write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2012-05-29 10:11:37 +02:00
Karel Zak 3a9c3f3fb7 include/c: move fallback for MAXHOSTNAMELEN to c.h
Reported-by: Thomas Schwinge <thomas@codesourcery.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-29 10:08:25 +02:00
Karel Zak b43d3a3a2c term-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:46:05 +02:00
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