summaryrefslogtreecommitdiffstats
path: root/term-utils
Commit message (Collapse)AuthorAgeFilesLines
* agetty: replace gethostbyname() with getaddrinfo()Sami Kerola2012-10-222-7/+19
| | | | | | | | The gethostbyname() is legacy function which may be withdrawn in a future. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/gethostbyname.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: stop using MAXHOSTNAMELENKarel Zak2012-10-191-3/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: stop using MAXHOSTNAMELENKarel Zak2012-10-191-23/+55
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: make error message more informativePetr Uzel2012-09-211-3/+7
| | | | | | | | | | | | | | | | | | | | | If `setterm -dump` fails because of lack of permission to read /dev/vcsa, it should not report that it couldn't read /dev/vcsa0. This could be misleading if there is only /dev/vcsa, but not /dev/vcsa0. Before: $ ./setterm -dump setterm: Couldn't read /dev/vcsa0 After: $ ./setterm -dump setterm: Couldn't read neither /dev/vcsa0 nor /dev/vcsa (Note: /dev/vcsa0 does not exist and the user does not have read permission on /dev/vcsa in this case). Addresses: https://bugzilla.novell.com/show_bug.cgi?id=780615 Reported-by: Christopher Yeleighton <giecrilj@stegny.2a.pl> Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* agetty: add \4 and \6 issue file sequences to print IP addressesKarel Zak2012-09-132-3/+121
| | | | | | Based on Andrea Bonomi <a.bonomi@endian.com> ideas. Signed-off-by: Karel Zak <kzak@redhat.com>
* script: add noreturn function attributesSami Kerola2012-07-261-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: fix shadow declarationSami Kerola2012-07-261-3/+3
| | | | | | | | 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>
* agetty: remove unnecessary sleep(10)Mantas Mikulėnas2012-07-251-2/+0Star
| | | | | | | I'm quite sure this is not supposed to be here (apparently added as part of commit 783b08fc1c6e5c906e). Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
* scriptreplay: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify file open error messagesSami Kerola2012-07-163-6/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* translation: unify stat error messagesSami Kerola2012-07-162-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: close tty before vhangup()Karel Zak2012-07-121-17/+27
| | | | | | | 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>
* agetty: make tcsetpgrp() optionalKarel Zak2012-07-111-1/+1
| | | | | | | | 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>
* agetty: use configured run state directorySami Kerola2012-07-101-2/+1Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: always use default $(LDADD)Karel Zak2012-07-091-5/+5
| | | | | | | | 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>
* build-sys: cleanup .gitignore filesKarel Zak2012-06-261-7/+0Star
| | | | | | | - move all binaries to top-level .gitignore - remove unnecessary */.gitignore files Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert lib/ to libcommon.laKarel Zak2012-06-261-8/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: convert term-utils/ to moduleKarel Zak2012-06-262-79/+99
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* script: remove unused codeKarel Zak2012-06-211-10/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: more robust debug() macro, check ioctl result [coverity scan]Karel Zak2012-06-211-5/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* scriptreplay: fix compiler format warningSami Kerola2012-06-171-2/+1Star
| | | | | | 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>
* build: fix redundant redeclaration warningsSami Kerola2012-06-113-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch '2012wk22' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2012-06-053-8/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '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
| * fileutils: xmkstemp() interface changeDave Reisner2012-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * docs: fix all man page groff warningsSami Kerola2012-06-022-7/+7
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | Fix typos in comments and wall's man pageBernhard Voelker2012-06-052-2/+2
|/ | | | | | | | | | | 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>
* write: Don't explicitly include <asm/param.h>.Thomas Schwinge2012-05-291-1/+0Star
| | | | | | | 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>
* write: Use PATH_MAX instead of MAXPATHLEN, as elsewhere.Thomas Schwinge2012-05-291-3/+3
| | | | Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
* include/c: move fallback for MAXHOSTNAMELEN to c.hKarel Zak2012-05-292-16/+0Star
| | | | | Reported-by: Thomas Schwinge <thomas@codesourcery.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* term-utils: cleanup strtoxx_or_err()Karel Zak2012-05-151-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: rename writeall.h to all-io.hPetr Uzel2012-05-151-1/+1
| | | | Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* term-utils: verify writing to streams was successfulSami Kerola2012-04-047-7/+30
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* script: error in usage() outputSami Kerola2012-04-021-1/+1
| | | | | | | Error originates to commit 3ff526391fb5c6b33418dc9cfec31c2ff9b4792e which is bit more than year, and part or releases v2.20 & v2.21. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* reset: make scripts bourne sh compliant [checkbashisms]Sami Kerola2012-03-302-4/+4
| | | | | | | | | | | | | 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>
* setterm: correct manual page referenceSami Kerola2012-03-301-1/+1
| | | | | | An error from commit faa0548de47df5691cf56dd49daaba8dbc89d34a Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fileutils: differentiate xmkstemp and xfmkstempSami Kerola2012-03-181-1/+1
| | | | | | | | | | | | 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>
* wall: use xmkstemp for temporary fileSami Kerola2012-03-182-15/+6Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: use rpmatch to yes/no questionSami Kerola2012-03-181-5/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: move vc initialization to ttyutils.hKarel Zak2012-03-121-63/+7Star
| | | | | | ... to make the code usable for sulogin. Signed-off-by: Karel Zak <kzak@redhat.com>
* script: play well with csh when invoked from within /etc/csh.loginKarel Zak2012-03-081-0/+10
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=797888 Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: check localtime() resultKarel Zak2012-02-061-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: add static and const qualifiersFrancesco Cosoleto2011-12-161-4/+4
| | | | | | Remove also a static qualifier in main() function. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* setterm: order man page items alphabeticallyJari Aalto2011-12-161-85/+67Star
| | | | Signed-off-by: Jari Aalto <jari.aalto@cante.net>
* agetty: don't use log_err() for non-fatal errorsKarel Zak2011-12-081-2/+2
| | | | | | | | | | | | | | 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>
* build-sys: check HAVE_ definitions with #ifdef [smatch scan]Sami Kerola2011-12-021-8/+4Star
| | | | | | | | | | 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>
* build-sys: check HAVE_ definitions with #ifdef [smatch scan]Sami Kerola2011-12-021-3/+7
| | | | | | Fix to `warning: undefined preprocessor identifier' messages. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: map NL to CR-NL on output in initial termiossettingsDennis Jensen2011-11-281-1/+2
| | | | | From: Jacoby Hickerson <hickersonjl@gmail.com> Signed-off-by: Dennis Jensen <dennis.h.jensen@siemens.com>
* agetty: pass hostname to login(1)Karel Zak2011-10-262-7/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: align wall.1 with howto-man-page.txtSami Kerola2011-10-031-47/+45Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: align scriptreplay.1 with howto-man-page.txtSami Kerola2011-10-031-164/+31Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>