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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>