Nowadays, gcc(1) provides the -Wno-format-y2k option to prevent the
warning, so that the above workaround is no longer required.
Reference: http://man7.org/linux/man-pages/man3/strftime.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The scriptreplay(1) will expect capture file always to have header.
Before this change the --quiet option together with timing caused
following replay error.
$ script --quiet --timing=timing
[...]
$ scriptreplay timing typescript
[...]
scriptreplay: unexpected end of file on typescript
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
One item to poll() more is a lot less work for system than separete input
and output processes.
Addresses: https://github.com/karelzak/util-linux/pull/62
CC: Wolfgang Richter <wolf@cs.cmu.edu>
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Finalize the signalfd() change by adding file descriptors to poll() loop.
Addresses: https://github.com/karelzak/util-linux/pull/62
CC: Wolfgang Richter <wolf@cs.cmu.edu>
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is incomplete change. Working command requires the subsequent
select() to poll() change as well.
Addresses: https://github.com/karelzak/util-linux/pull/62
CC: Wolfgang Richter <wolf@cs.cmu.edu>
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Regression check to a fix by Stanislav Brabec.
Reference: 0b285b84b2
CC: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The umount.<type> helpers does not support --fake option and it does
not make sense to call the helpers at all. All we need is to remove
mtab/utab entries.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1172297
Signed-off-by: Karel Zak <kzak@redhat.com>
We have to call epoll to drain mountinfo events too. The problem is
visible if the monitor epoll FD is within another (top-level) epoll.
Signed-off-by: Karel Zak <kzak@redhat.com>
It seems better to keep the strange sysfs devnames internally and
translate to real devnames only on output or when we read from /dev.
Signed-off-by: Karel Zak <kzak@redhat.com>
Well, I don't have mental power to use function names like
sysfs_devname_to_dev_name()
so this patch renames to
sysfs_devname_sys_to_dev()
sysfs_devname_dev_to_sys()
It also cleanups usage of the functions. We have to be sure that
sysfs.c code returns regular devnames. The existence of the sysfs
devnames (with '!') should be completely hidden in sysfs specific
code.
Signed-off-by: Karel Zak <kzak@redhat.com>
d0dc6c1 introduced translation of /sys names to /dev names, as required
by the kernel linux/drivers/base/core.c: device_get_devnode(). But there
are other places of code that use /dev names in /sys. They need reverse
translation from '/' to '!'.
For example, fdisk -l returns empty list since a22c6eb for device nodes
in subdirectories (used e. g. by cciss driver).
Introduce yet another helper sysfs_dev_name_to_devname() and use it where
appropriate.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
It is impossible to predict /dev/dm-N partition names. Use predictable
and better readable /dev/mapper names instead.
[kzak@redhat.com: - remove if-before-free]
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
The default configuration of multipath-tools appends "-partN" to
partition nodes. Follow this conventions and do the same.
It fixes for example fdisk -l /dev/mapper/name_of_the_device.
Note that the current implementation only partially fixes the problem. It
does not reflect any udev configuration changes, as udev does not provide
any function to return names of future (or current) partitions of a
particular device. It also does not fix fdisk -l /dev/dm-0.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
linux/drivers/base/core.c: device_get_devnode() defines a translation of
'!' in sysfs nodes to '/' in /dev nodes. The same translation has to be
done to properly support device nodes with slash (e. g. device nodes of
cciss driver and several other drivers).
Introduce new helper sysfs_devname_to_devno() and use it where
appropriate.
Fixes for example lsblk -f on devices using cciss driver.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Fortunately very few people are crazy enough to install hwclock as
setuid. Some comments in code and unfortunately also man page
advertising that setuid is no problem. That's pretty stupid promise.
The code quality is poor and it's obviously not designed to be secure
(things like popen() without drop privileges, etc.).
This patch removes all notes about "setuid support" and for sure
disable hwclock execution for non-root users.
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786804
Signed-off-by: Karel Zak <kzak@redhat.com>
* according to "man getpwnam" 16384 bytes is enough to store one
passwd entry (let's use 2*BUFSIZE to avoid magic numbers in code)
* don't use strcpy() to set empty password
Signed-off-by: Karel Zak <kzak@redhat.com>
It's necessary for people who want to compile util-linux in very
unusual environment and disable as much as possible dependencies.
For example distro bootstrap.
References: https://bugzilla.redhat.com/show_bug.cgi?id=1223894
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch adds support for building a static version of unshare.
We need to add unshare to the list of possible static programs, and
provide build flags for the compiler and linker, which are equivalent to
the flags of the non-static program, except additional static linking.
See also: commit 2fa60c5 build-sys: support nsenter.static
Signed-off-by: Georg Schiesser <georg.schiesser@opentech.at>
On s390 and other big endian machines, doinput() sends NUL instead of
EOF to the tty master. NUL does not even reach the slave, and it is
waiting for more data forever.
If STDIN is not a tty, the bug caused "^@" being into the log, and since
commit 032228c it also causes hang.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>