summaryrefslogtreecommitdiff
path: root/term-utils
AgeCommit message (Collapse)AuthorFilesLines
2014-02-16Use utmpxIgor Pashev1-26/+41
We do not use login & friends from util-linux, but for completeness
2014-02-10scriptreplay: Add --maxdelay option.Jesper Dahl Nyerup2-4/+20
This option caps the delay between updates, to avoid long pauses in transcript playback. Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-24include/c.h: prefer nanosleep() over usleep()Karel Zak1-1/+1
Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-16script: use all-io.h to make the code more robustKarel Zak1-9/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-16script: fix inconsistent -q, use poll() rather then O_NONBLOCKKarel Zak1-25/+17
- don't suppress "Script done" message in typescript file by -q (note that -q has no effect to "Script started" message) - simplify the code by poll() Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-16script: don't wait for empty descriptors if child is deadKarel Zak1-4/+8
The current code waits for empty file master and slave descriptors, but it makes sense only if there is child process that cares (read) about data in the descriptors. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-03script: script input redirection / eof handlingKarel Zak1-19/+79
echo "ps uf" | script does not work because script assume that stdin is terminal and it does not forward EOF to the pty. This patch: * make non-tty use-case more robust (don't call tty ioclts to non-tty file descriptors. * send EOF (CTL('D') control char) to the master channel when detected eof by read() on stdin * wait for empty master and slave file descriptors to be sure that we don't miss date for typescript. This is also necessary to be sure that slave channel (shell) is completely initialized otherwise EOF is ignored. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02script: check that stdin is a terminalKarel Zak1-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02setterm: fix -dump man page infoKarel Zak1-1/+1
It seems that setterm -dump does not dump terminal attributes, but the man page says -dump includes the attributes. Let's fix the man page. Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-02agetty: support the special terminal on first serial line on a S/390Werner Fink1-0/+18
which is due legacy reasons a block terminal of type 3270 or higher. Whereas the second serial line on a S/390(x) is a real character terminal which is compatible with VT220. Signed-off-by: Werner Fink <werner@suse.de>
2013-12-02losetup, agetty: remove unnecessary if's before free()Sami Kerola1-4/+2
Reference: http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/useless-if-before-free Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-11-14script: restore errno in signal handlerKarel Zak1-0/+3
References: https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/gHSscCJkakd Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-14script: don't call TIOCGWINSZ in signal handlerKarel Zak1-3/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15docs: standardize the phrases for --help and --version in all man pagesBenno Schulenberg4-7/+7
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15docs: format, grammarize, and standardize the wall man pageBenno Schulenberg1-19/+21
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola1-5/+5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-10-08textual: make two messages somewhat easier to understandBenno Schulenberg1-2/+2
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-04build-sys: use tinfo *or* ncurses for more(1), ul(1) and setterm(1)Karel Zak1-2/+9
* it seems that we don't have to link the utils with ncurses, tinfo is enough. This change saves one unnecessary dependence. * libtinfo is also distributed with pkg-config files, so we can use PKG_CHECK_MODULES() as a primary source for LIBS and CFLAGS. * add TINFO_CFLAGS (although it's probably always empty) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-04docs: tweak the grammar of an agetty man-page fragmentBenno Schulenberg1-4/+4
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-04agetty: use standard angular brackets in usage messageBenno Schulenberg1-2/+2
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-04build-sys: Fix check for __GNU_LIBRARY__Michael Forney1-1/+1
If we are not on glibc, __GNU_LIBRARY__ will not exist causing the check to always fail and try to use syscalls directly. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-04include: Add missing includesMichael Forney1-0/+1
sys/types.h: For u_char typedef sys/params.h: For MAXNAMLEN sys/ttydefaults.h: For various tty definitions (also add configure check) Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak1-1/+1
2013-09-30textual: fix misspelled words in -rc1Karel Zak1-1/+1
Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-30clean up term lib handlingMike Frysinger1-5/+2
The ncurses package has been providing pkg-config files for a while now. So let's start using them to get the proper linker & compiler flags. It can make a difference when ncurses is configured in a way that requires extra link time flags but util-linux doesn't provide them, or when the headers live in a weird place and util-linux can't find them. Since the NCURSES_LIBS is always defined for the Makefile, there's no need to gate on the HAVE_NCURSES conditional. When it's disabled, the var will simply be empty. With a minor tweak to how tinfo is handled, we can do the same thing -- we just always use TINFO_LIBS in the Makefile's. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-30setterm: fix term.h/ncurses.h include orderingMike Frysinger1-2/+3
The ncurses term.h header has logic in it to detect if nucrses.h has already been included and void defining things when it has. But since setterm includes term.h and the ncurses.h, it doesn't work and we can get fun build-time warnings like: CC term-utils/setterm-setterm.o In file included from term-utils/setterm.c:109:0: /usr/include/ncursesw/ncurses.h:827:12: warning: redundant redeclaration of 'tigetflag' [-Wredundant-decls] extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ ^ In file included from term-utils/setterm.c:106:0: /usr/include/ncursesw/term.h:775:12: note: previous declaration of 'tigetflag' was here extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); ^ Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-28Fix various typosYuri Chornoivan1-2/+2
2013-09-12agetty: add \S to output /etc/os-release dataKarel Zak2-2/+111
This patch allows to use a new \S or \S{VARNAME} sequence in the /etc/issue file. The sequence prints data from /etc/os-release. The reason is to keep /etc/issue file distribution and release independent. The \S{ANSI_COLOR} is converted to the real terminal escape seq. For example: \S Kernel \r on an \m (\l) or more complex example: Welcome to \S{ANSI_COLOR}\S{NAME}0m \S{VERSION} Report bugs at \S{BUG_REPORT_URL}. See http://www.freedesktop.org/software/systemd/man/os-release.html fr more details about /etc/issue. Based on patch from Bill Nottingham <notting@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-12agetty: add baud rates available from glibc that are not already supportedJames Buren1-0/+36
This adds userspace support for baud rates reater than 230400, provided the tty also supports it.
2013-09-12agetty: only use EXTA/EXTB macros if B19200/B38400 macros are not presentJames Buren1-7/+5
2013-09-09agetty: cleanup debug ifdefsKarel Zak1-5/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-29last, utmpdump, agetty, wall, write: avoid compatibility hacksSami Kerola3-3/+7
In include/bits/utmp.h the ut_user and ut_time macros are marked with comment they are backwards compatibility hacks. It is probably best to avoid use of these macros where ever possible. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29write: change determination can user write to a terminalSami Kerola1-4/+5
Earlier test failed when user had write permission, but was not in special group that owns terminal devices, usually tty. This made write(1) to fail for root, if the root did not happen to be in tty group. In this commit root is granted ot write to anyone, even if they have mesg(1) turned off. For an user who is trying to write to own other session the group write bit is significant only for whether mesg(1) are enabled. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29docs: add note to wall(1) about sessions which will not get messageSami Kerola1-0/+6
Sessions that has in utmp data ut_line begining with ':' are skipped. This is done to avoid write errors to devices such as '/dev/:0'. For example wdm is reported to to generate such utmp line. Perhaps in future this code should be revalidated. If an utmp data contains broken device lines it might be best inform user with a error message, rather than skipping silently suspicious device entries. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29wall: line wrap at column 79 also when line has tab charsSami Kerola1-0/+2
Earlier tabs caused random ragged right indentation, because the tab length was assumed to be 1 char which is not the case most of the time. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29mesg: sync usage() with howto-usage-function.txtSami Kerola1-8/+7
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29wall: sync usage() with howto-usage-function.txtSami Kerola1-11/+10
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29wall: send message also to sessions opened by user 'sleeper'Sami Kerola1-4/+1
Ignoring an user by name, and not telling about it in manual page, is unexpected. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-23include: carefulput: print determined char when unprintable char is foundSami Kerola2-2/+2
This is done to allow reuse of the functin in last(1). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-13wall: make banner sysvinit compatibleKarel Zak1-16/+18
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-13wall: allow to specify <message> on command lineKarel Zak2-36/+68
wall(1) from sysvinit supports # wall I love this company! semantic, This patch add this functionally to the util-linux wall. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-06agetty: -L accepts optional argumentKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-09agetty: fix memory leak [clang-analyzer]Sami Kerola1-1/+3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-04Fixes "getty: unrecognized option '--loginpause'"kernc1-2/+2
Usage incorrectly stated --loginpause is a valid option, where instead --login-pause is. Also --no-hostname --> --nohostname.
2013-06-18agetty: improve wording, grammar and some formatting in man pageBenno Schulenberg1-49/+49
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-18agetty: fix a kill/erase error in man page and improve clarityBenno Schulenberg1-12/+12
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-13Merge branch 'master' of https://github.com/eric-s-raymond/util-linuxKarel Zak1-26/+44
* 'master' of https://github.com/eric-s-raymond/util-linux: Fix broken list syntax. Restore use of correct alternation syntax using { | }. Re-layout a FILES section in the traditional style. Remove another .ti for .RS/.RE, and remove a .TP that broke list parsing. Replace .IP o with .IP \(bu, using the [nt]roff bullet character. Replace .ti operations with equivalent .RS/.RE pairs.
2013-06-13agetty: use O_NONBLOCK only for serial lines with CLOCALKarel Zak1-5/+7
* regression introduced by ef264c830effc91add6da334204215f61eb8515e * also increase sleep when O_NONBLOCK used (grr.. this is so stupid thing, do we really need O_NONBLOCK for the stupid serial lines?) References: https://bugzilla.redhat.com/show_bug.cgi?id=972457 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-10Re-layout a FILES section in the traditional style.Eric S. Raymond1-5/+12
2013-06-10Remove another .ti for .RS/.RE, and remove a .TP that broke list parsing.Eric S. Raymond1-8/+11