summaryrefslogtreecommitdiffstats
path: root/term-utils
Commit message (Collapse)AuthorAgeFilesLines
* script: always write stat and done message to typescript fileKarel Zak2017-04-182-6/+6
| | | | | | And remove usec from timestamp. Signed-off-by: Karel Zak <kzak@redhat.com>
* fix the position of newline in the time output of 'script'Rui Zhao (renyuneyun)2017-04-141-4/+9
| | | | | | | - move '\n' to fprintf - use `timeutils/strtime_iso()` instead of `strtime()` Signed-off-by: Rui Zhao (renyuneyun) <renyuneyun@gmail.com>
* script: don't call strftime() if not necessaryKarel Zak2017-04-131-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'script_quiet' of https://github.com/renyuneyun/util-linuxKarel Zak2017-04-131-1/+2
|\ | | | | | | | | * 'script_quiet' of https://github.com/renyuneyun/util-linux: script: fix start message showing in output file when -q is on
| * script: fix start message showing in output file when -q is onRui Zhao (renyuneyun)2017-04-051-1/+2
| | | | | | | | Signed-off-by: Rui Zhao (renyuneyun) <renyuneyun@gmail.com>
* | agetty: various man-page fixesJ William Piggott2017-04-101-24/+36
| | | | | | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | agetty: fix login-options desc in man pageKarel Zak2017-04-051-4/+4
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: improve agetty.8 manual pageSami Kerola2017-04-031-61/+68
| | | | | Reviewed-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: make --remote to forward --nohostname as -H to loginSami Kerola2017-04-032-5/+12
| | | | | | | | | | | | Without this change an attempt to remove hostname printing required following rather clumsy agetty invocation. /sbin/agetty --nohostname --login-options '/bin/login -H -- \u' After the change --nohostname behaves similar way with --host option, that is when combined with --remote the effect is passed to login(1). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: remove variable that is set but not readSami Kerola2017-04-011-7/+2Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: fix typoKarel Zak2017-03-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fix characters reorder in login promptKarel Zak2017-03-271-12/+34
| | | | | | | | | | | | | | The current agetty uses TIOCSTI ioctl to return already read chars from login name back to the terminal (without read() before tcsetattr() we will lost data already written by user). The ioctl based solution is fragile due to race -- we can return chars when terminal already contains another new chars. The result is reordered chars in login name. The solution is to use extra buffer for already read data. Reported-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* setterm: fix bitfield warning [smatch]Sami Kerola2017-02-281-1/+1
| | | | | | | term-utils/setterm.c:179:27: warning: dubious bitfield without explicit `signed' or `unsigned' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: fix a memory leak when parsing \S in issue filesMatthias Gerstner2017-02-271-0/+3
|
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-201-1/+1
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-204-46/+46
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|
* term-utils/script: fix typo leading to syntax errorBert van Hall2017-01-181-1/+1
| | | | | | Introduced in edc7e42, this typo is actually invalid C. Fix this. Signed-off-by: Bert van Hall <bert.vanhall@avionic-design.de>
* build-sys: use -lm for scriptreplay if necessaryKarel Zak2017-01-181-1/+1
| | | | | | Reported-by: Bert van Hall <bert.vanhall@avionic-design.de> Addresses: https://github.com/karelzak/util-linux/pull/397 Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'setterm' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2017-01-042-1/+118
|\ | | | | | | | | * 'setterm' of git://github.com/kerolasa/lelux-utiliteetit: setterm: add --resize option
| * setterm: add --resize optionSami Kerola2016-12-292-1/+118
| | | | | | | | | | | | | | | | | | Reset terminal size by assessing maximum row and column. This is useful when actual geometry and kernel terminal driver are not in sync. Addresses: http://bugs.debian.org/835636 Based-on-work-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | agetty: fix ifdef typoRuediger Meier2016-12-211-1/+1
|/ | | | | | introduced in 77835be2 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Use --help suggestion on invalid optionKarel Zak2016-12-196-7/+7
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-198-8/+8
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: various pages: Use 'UID" and "GID", not "uid" and "gid" in man pagesMichael Kerrisk2016-12-091-1/+1
| | | | Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
* docs: various pages: Use consistent terminology (set-user-ID and set-group-ID)Michael Kerrisk2016-12-091-1/+2
| | | | | | | | | | Use consistent terminology for set-user-ID and set-group-ID bits. There's much inconsistency in the pages. "suid", "set-user-identifier", "setuid". Stick with one terminology, "set-user-ID" and set-grout-ID, as suggested in man-pages(7). Signed-off-by: <mtk.man-pages@gmail.com>
* docs: various pages: Format pathnames as italic (.I)Michael Kerrisk2016-12-091-5/+5
| | | | | | | | | In the majority of pages, pathnames are formatted as Italic, which is the norm. However, there are several cases where they are formatted as bold. This patch fixes a number of those exceptions. Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
* wall: remove unnecessary includeKarel Zak2016-12-081-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: re-add utmp.h for Debian GNU/kFreeBSDRuediger Meier2016-12-071-1/+7
| | | | | | | It's needed there to get login_tty(). On normal FreeBSD we would need libutil.h. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* login-utils: switch to utmpx.hRuediger Meier2016-12-073-28/+28
| | | | | | | | Now the build will fail on many non-Linux systems because utmpx.h is available everywhere but we still use non-POSIX features. We'll fix this next commit. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* agetty: remove obsolete HAVE_UPDWTMP fallbackRuediger Meier2016-12-071-20/+1Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* login-utils: avoid using the defined utmp sizes.Ruediger Meier2016-12-071-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* login-utils: remove _HAVE_UT_TV fallbackRuediger Meier2016-12-071-4/+0Star
| | | | | | | | | | _HAVE_UT_TV is glibc only. Moreover we want to move to utmpx where timeval is standard. Now utmp/subsecond (1173d0a6) should work on all supported systems. CC: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* wall: check -g GIDKarel Zak2016-12-021-1/+7
| | | | | | Based on comments from Sami Kerola. Signed-off-by: Karel Zak <kzak@redhat.com>
* wall: add --group optionJim Patterson2016-12-022-1/+82
| | | | | | | | | | | | | | | | The wall command on AIX supports a "-g" option to limit the message to a group of users by gid. Add compatibility to the Linux version. Thanks to Sami Kerola <kerolasa@iki.fi> for an initial skeleton implementation. [kzak@redhat.com: - rename max to ngroups - add free_group_workspace() - some cosmetic changes] Reference: http://www.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.cmds6/wall.htm Signed-off-by: Jim Patterson <jimp@wegrok.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: spelling, always use "cannot" instead of "can not"Ruediger Meier2016-11-302-2/+2
| | | | | | Just to be consistent ... Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Place SEE ALSO entries in orderMichael Kerrisk (man-pages)2016-11-293-5/+5
| | | | | | | | | | | | This patch does only the following: * Order SEE ALSO entries first by section name, then alphabetically within section * Adds one or two missing commas in SEE ALSO lists * Removes one or two periods that were (inconsistently) used at the end of SEE ALSO lists. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* misc: always check setenv(3) return valueSami Kerola2016-08-121-1/+3
| | | | | | At least glibc setenv(3) can fail when system runs out of memory. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: move unreachable code to pre-processor #else segment [oclint]Sami Kerola2016-07-211-2/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setterm: fix declarations shadowing variables in the global scope [oclint]Sami Kerola2016-07-211-40/+40
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-212-20/+13Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* agetty: call uname() only when necessaryKarel Zak2016-07-201-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: fix \S usageKarel Zak2016-07-201-10/+15
| | | | | | | | If \S without argument used then uninitialized 'varname' compared with ANSI_COLOR. Addresses: https://github.com/karelzak/util-linux/issues/329 Signed-off-by: Karel Zak <kzak@redhat.com>
* write: don't use strftime()Karel Zak2016-07-141-6/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: try to find tty in get_terminal_name()Sami Kerola2016-07-041-13/+3Star
| | | | | | | | Try all standard terminal input/output file descriptors when finding tty name in get_germinal_name(). This should make all invocations of the function as robust as they can get. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: stop removing and adding /dev/ in front of tty stringSami Kerola2016-07-042-43/+39Star
| | | | | | | | | | | Add both path and tty name representations of tty's to control structure, that point to same string beginning from different depths. This way there is no need to removing and adding /dev/ in front of tty string all the time. Secondly this change makes it possible to use of get_terminal_name() from ttyutils.c. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: tell when effective gid and tty path group mismatchSami Kerola2016-07-041-2/+7
| | | | | | | | | | | | | | | | | | Most commonly this error happens when write(1) executable does not have correct group ownership and setgid bit. The earlier message was unclear what exactly was wrong. $ mesg is y $ write testuser write: you have write permission turned off Alternatively the 'getegid() == s.st_gid' could be considered unnecessary. Afterall if to write to destination tty is denied that does not go unnoticed at thet time when tty is opened. Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: improve coding styleSami Kerola2016-07-041-36/+35Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: remove PUTC macroSami Kerola2016-07-041-10/+5Star
| | | | | | | | Function like macros make following the execution flow unnecessarily difficult, and deserves to be removed. Requested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* write: make timestamp to be obviously just a clock timeSami Kerola2016-07-011-8/+9
| | | | | | | | | | By looking the code one will had hard time knowing that a slice of ctime() from characters 11 to 16 is HH:MM time format. Use of strftime("%H:%M") makes this a lot less mysterious. In same go make \007 hex printouts to be \a that is the same thing: alarm. Signed-off-by: Sami Kerola <kerolasa@iki.fi>