Age | Commit message (Collapse) | Author | Files | Lines |
|
If timeout happens while waiting in prompt, bail out instead
of retrying.
Reported-by: Bjørn Mork <bjorn@mork.no>
Addresses: http://bugs.debian.org/846107
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
|
|
This makes the caller bail out early instead of evaluating the
input as a password.
Reported-by: Bjørn Mork <bjorn@mork.no>
Addresses: http://bugs.debian.org/846112
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
|
|
It's deprecated since 3f8478a7, so we shouldn't build it by default.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
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>
|
|
It will disable all these programs automatically except wall(1)
which is now non-Linux compatible.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
We simply check for utmpxname and updwtmpx functions to disable
all programs which are not POSIX utmpx compatible, even though
last(1) and utmpdump(1) does not use them, see below.
utmpx.h is used in:
login agetty write lslogins last runuser su utmpdump wall
Non-Posix utmpx usage:
utmpxname -> login agetty write lslogins
updwtmpx -> login agetty runuser su
_PATH_.TMP -> login agetty write lslogins last runuser su
utmpx.ut_addr_v6 -> login last utmpdump
POSIX utmpx usage:
wall
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
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>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
This include was removed in a365953a but we will need it again
when we move from utmp.h to utmpx.h.
On Linux (glibc, musl) the struct lastlog is defined in utmp.h
and lastlog.h just includes utmp.h.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Conflicts:
login-utils/login.c
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
BTW avoid using the defined sizes.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
strlen() is not smarter than strncpy(). Bytes that follow a null byte
are not compared anyway.
BTW avoid using the defined sizes.
CC: Ondrej Oprala <ooprala@redhat.com>
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>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Formatting fixes for constants and structure/field names, as
per man-pages(7).
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
The points in the NOTES can be expressed more compactly
(there is some redundancy in the two existing paragraphs).
Also, add a reference to signal(7), since this provides
much more detail on the topic.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
It's worth adding a recommendation here to use SIGTERM
rather than SIGKILL, and explain why.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
|
|
A minor wording fix...
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
|
|
This fixes a regression introduced in:
commit 7a4ea5664edba98bff28adec3a9c3cfb5763a495
"chrt: add control struct"
Previously (and as documented in the manpage) the default policy
was SCHED_RR. Now it's implicitly SCHED_OTHER (0) as the value
is not initialized explicitly anymore.
Test-command: chrt 90 echo hello
Reported-by: Patrick Pelissier <patrick.pelissier@gmail.com>
Addresses: http://bugs.debian.org/846572
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Add formatting for 'file' argument used by various options.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Based on comments from Sami Kerola.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Based on patch 83cc932d7412
("fallocate: introduce an option -c to support COLLAPSE_RANGE")
This patch includes FALLOC_FL_INSERT_RANGE flag
added to Linux kernel v4.1
Thanks to Pádraig Brady for insert range definition
Signed-off-by: Fabian Frederick <fabf@skynet.be>
|
|
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>
|
|
For example, child process of spamd has
32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...
fscanf("%d %*s %c %d*[^\n]") in read_process() can't parse above as we
expected, because %s only skips non-whitespace. I.e. it parses like
following,
32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...
+---+ +----+ +
%d %*s %c
and returns 2 (pid=32031, state=c).
This fixes it by skipping task->comm part manually.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
|
|
# command used was:
$ ~/src/codespell/codespell \
-w -D /home/rudi/src/codespell/build/lib/codespell_lib/data/dictionary.txt \
$(git ls-files | grep -v "^po/\|\.xz$\|\.gz$\|\.bz2$\|\.img$\|^Documentation/releases/")
BTW some manually grammer fixes:
s/uses/used/
s/begin/beginning/
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Just to be consistent ...
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
The output of the "New situation:" contains
Disklabel type: <name>
Disk identifier: <removed>
lines now.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
By default sfdisk creates partition table when a first partition is
specified, otherwise the device is not modified. This force users to
create at least one partition.
This commit allows to create empty label without partitions if "label:
<name>" header line is specified by script.
The commit also modifies "New situation:" output to list label name
and label identifier.
Addresses: https://github.com/karelzak/util-linux/issues/374
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
old:
# truncate -s 1G empty && ./sfdisk --dump empty
sfdisk: failed to dump partition table: Success
new:
# truncate -s 1G empty && ./sfdisk --dump empty
sfdisk: empty: does not contain a recognized partition table.
Addresses: https://github.com/karelzak/util-linux/issues/375
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The commit 4c0e1eaf34fe604118afcd792291419e1d4ff661 modifies the
alignment of the STATE column.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Travis CI:
tools/git-version-gen: 116: tools/git-version-gen: Bad substitution
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
The "g" was not always removed and "-rc*" follow-ups were handled
incorrectly.
So now after last commits we have these versions:
git describe -> blkid -V
--------------------------------------------------------------
v2.29-rc4 -> 2.29-rc4 (libblkid 2.29.0)
v2.29-rc4-3-g4c8928d -> 2.29-rc4-3-4c89 (libblkid 2.29.0)
v2.29 -> 2.29 (libblkid 2.29.0)
v2.29-78-g4c8928d -> 2.29.78-4c89 (libblkid 2.29.78)
v2.29.1 -> 2.29.1 (libblkid 2.29.1)
v2.29.1-4-g4c8928d -> 2.29.1.4-4c89 (libblkid 2.29.1)
v2.29.1-rc2 -> 2.29.1-rc2 (libblkid 2.29.1)
v2.29.1-rc2-3-g4c8928d -> 2.29.1-rc2-3-4c89 (libblkid 2.29.1)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Just make the script more readable. Nobody is using 10 years old
git.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
This should changes nothing.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Now we use
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.5)
instead of
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.0)
otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Was broken for major releases since b0e6b25e:
$ blkid -V
blkid from util-linux 2.28 (libblkid 2.28., 12-Apr-2016)
Now we also set 0 in this case, like:
$ blkid -V
blkid from util-linux 2.30 (libblkid 2.30.0, 12-Apr-2016)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
As described in pid_namespaces(7), IPC namespaces also
isolate POSIX message queues. Update the unshare(1)
and nsenter(1) pages to clarify that.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Rationale: both of these pages are about namespaces.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
The sigvec(3) (not sigvec(2)) page documents ancient BSD APIs.
The right page to cross reference here is sigaction(2),
which documents the modern POSIX APIs.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
These pages had errors such as
.BR page (x) .
which should be
.BR page (x).
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Some time back, I moved the discussion of scheduling from
sched_setscheduler(2) to a new sched(7) page. Adjust the cross
reference in the taskset(1) page accordingly.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
lockf() is in section 3, not 2.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
* Add a section number to page cross reference
* Format cross references in bold
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Most pages in util-linux follow the standard convention
of formatting page cross references in bold. Fix the
few exceptions that use italic.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.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>
|
|
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
|
|
Break the loop as soon as we found the node a memory block belongs to,
it doesn't make sense to continue scanning.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* don't fill scols table
* check for collision with raw,pairs and json options
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* add missing new options
* remove columns description (for ls-like utils we maintains columns
description only in the --help output)
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* add --pairs, --raw a --json outputs
* add --noheadings to disable header
* add --bytes
* add --output <list>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Add a single s390 specific test case to verify that the contents of
various output formats do not change in incompatible way if the
lsmem code is changed.
This is based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
Move the s390 specific chmem tool to util-linux.
The chmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html
Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.
This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.
The chmem tool can be used to set memory online or offline. This can
be achieved by specifying a memory range:
Memory Block 19 (0x0000000130000000-0x000000013fffffff) disabled
or by specifying a size where chmem will automatically select memory
blocks:
Memory Block 21 (0x0000000150000000-0x000000015fffffff) disable failed
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled
or by specifying memory block numbers instead of address ranges:
Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled
This is based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
Move the s390 specific lsmem tool to util-linux.
The lsmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html
Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.
This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.
The lsmem tool inspect the contents of /sys/devices/system/memory and
prints a summary output similar to what lscpu does:
RANGE SIZE STATE REMOVABLE BLOCK
0x0000000000000000-0x000000005fffffff 1,5G online yes 0-5
0x0000000060000000-0x000000007fffffff 512M online no 6-7
0x0000000080000000-0x000000013fffffff 3G online yes 8-19
0x0000000140000000-0x000000014fffffff 256M offline - 20
0x0000000150000000-0x000000017fffffff 768M online no 21-23
Memory block size : 256M
Total online memory : 5,8G
Total offline memory: 256M
In order to keep the output small the tool merges subsequent address
ranges where the attributes are identical. To avoid merging of line
the "-a" option can be used.
The lsmem tool also has "--extendend" and "--parsable" option which
can be used to customize the output, e.g. limit the output to
specified columns. This is quite similar to what the lscpu tool does.
This is based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
Add helper functions which allow to parse hexadecimal numbers.
Based on a patch from Clemens von Mann.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is mostly for non-Linux systems where lsmod is not
even available.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Since there is no error handling in this test $LODEV
may be empty.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
|
|
Fails on Debian 7 (wheezy), Kernel 3.2.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
CC: Stanislav Brabec <sbrabec@suse.cz>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
References: http://www.spinics.net/lists/util-linux-ng/msg13302.html
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Maybe we should add a --daemonize option to flock to cover
this use case.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Since Linux kernel 4.8 /sys entries are no more sorted and all is
in the native order. It makes lsblk output messy.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
We also need to sort children when tree is enabled.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
* 'fixes-for-v2.29' of https://github.com/rudimeier/util-linux:
misc: once again some printf format strings
misc: fix some compiler warnings
chrt: fix HAVE_SCHED_SETATTR fallback case
fdisk: fix memleak in list_disk_geometry()
|
|
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842598
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
If you call mount(8) as root, then we need to append inverting options
(if specified by fstab) for "user" and "users" to /sbin/mount.<type>
command line, because for UID=0 mount.nfs follows command line rather
than the fstab setting.
This has been originally implemented by commit
a4c0cc75ff9744299f108c259efab1bd30c8007a for the old mount(8). The
same feature is supported by libmount, unfortunately for "user" only.
We need the same also for "users" to be backwardly compatible.
Addresses: https://github.com/karelzak/util-linux/issues/368
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
libsmartcols/samples/fromfile.c:59:2: warning: passing argument 3 of 'string_to_bitmask' from incompatible pointer type
text-utils/pg.c:79:0: warning: "TABSIZE" redefined
libblkid/src/read.c:455:13: warning: 'debug_dump_dev' defined but not used [-Wunused-function]
libblkid/src/probe.c:769:13: warning: unused function 'cdrom_size_correction' [-Wunused-function]
/usr/include/sys/termios.h:3:2: warning: "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead" [-W#warnings]
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Broken since 6f27e449. We could not enter the fallback
if HAVE_SCHED_SETATTR is not defined.
Two gcc warnings made this issue visible:
schedutils/chrt.c:247:1: warning: label 'fallback' defined but not used [-Wunused-label]
schedutils/chrt.c:266:9: warning: 'policy' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
* use macro for label initialization
* make sure we do not call fdisk_ref_labelitem() and
fdisk_unref_labelitem() for non-allocated items
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
fdisk -l could crash randomly. Only seen on some i586 systems with
certain exotic compiler options.
The problem was that this item is later used in
function fdisk_reset_labelitem() like this:
if (li->type == 's')
free(li->data.str);
This may crash if item is randomly initialized.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
disk-utils/fdisk-menu.c: In function ‘gpt_menu_cb’:
disk-utils/fdisk-menu.c:709: warning: passing argument 6 of ‘fdisk_ask_number’ from incompatible pointer type
./libfdisk/src/libfdisk.h:688: note: expected ‘uintmax_t *’ but argument is of type ‘long unsigned int *’
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* 'test-rmmod-scsi_debug' of https://github.com/rudimeier/util-linux:
tests: consolidate rmmod scsi_debug
|
|
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* make sure token is terminated
* skip closing quotes
* allow extra space after quotes and before terminater
* skip extra space after terminater
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The parser is not consistent and *case insensitive* Type= and Id= tokens
are not expected on all places.
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* allow GUID: prefix only for numbers
* require space or comma separator
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* 'master' of https://github.com/yurchor/util-linux:
Fix minor typos
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Seems this has been changed in kernels >4.4.x or >4.8
from 512 bytes to 64K.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
- auto cleanup on test exit
- Add smart timeout: Newer openSUSE systems on OBS failed to rmmod
almost always. udevadm settle does not seem to have any affect.
- now tests will fail if rmmod fails
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Reported-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* 'test-fixes' of https://github.com/rudimeier/util-linux:
build-sys: fix missing ncursesw message
tests: avoid &>> for bash compatibility
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
On old systems (e.g. RHEL6) with /sbin/mount.tmpfs the mtab file is
modified although our in-tree mount does not support mtab file. We
need to call umount --fake to be sure that we remove unwanted lines
from the test.
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
It's painful, but ncurses upstream does not distribute .pc files by
default and it seems that ncurses{6,5}-config is the preferred solution.
For better compatibility lets use ncurses-config.
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The su(1) change based on libseccomp has been reverted.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
We cannot use our crc32 without changes in the code, because our
ul_crc32() assumes that post-conditioning (xor) is done by
application. The zlib implementation does everything.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Make the publicly-visible crc32 library functions prefixed by ul_, such
as crc32() -> ul_crc32().
This is because it clashes with the crc32() function from zlib.
For newer versions of glib (2.50+) zlib and libblkid are required
dependencies and otherwise results in build failure when building
statically.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
It seems to be good idea to have more verbose output in the log files
for weekly fstrim execution. The verbose adds details (one line) for
each filesystem.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1337304
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
For example 'cal August' to print August for the current year.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://github.com/karelzak/util-linux/commit/b86db3c7cff489b8ce4cf9fc58176a78a1797bdc#commitcomment-19326504
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Option is documented and used as --nooverlap, bud coded as --nooverlaps.
--nooverlap is considered as shortened option, making the typo
invisible.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
|
|
Check if the length of the parsed string is at least 1,
otherwise an out of boundary read would occur.
|
|
free() is not a safe function for a signal handler. The next
line calls _exit() anyway, so there is no need for resource
management.
|
|
A strlen() call can lead to out of boundary read access if the
superblock in question has no nul-bytes after the string. This
could be avoided by using strnlen() but the calls in question
merely existed to check if the string length is not 0.
By changing the calls as proposed with this diff, these files are
in sync with other superblock files, which do exactly the same.
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Before fix "fsck -y /d<tab>" will never show LVM VG from multipath or mapped devices
|
|
This reverts commit 8e4925016875c6a4f2ab4f833ba66f0fc57396a2.
Stupid hack...
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
* do not reset 'nice' setting by sched_setattr(), if 'nice' setting
is not zero then chrt ends with EPERM for non-root users:
$ renice -n 5 -p $$; chrt -v -b 0 date
12475 (process ID) old priority 0, new priority 5
chrt: failed to set pid 0's policy: Operation not permitted
* it seems more elegant to always use old sched_setscheduler() API for
non-deadline policies; in this case we do not need getpriority()
to keep 'nice' unchanged.
Addresses: https://github.com/karelzak/util-linux/issues/359
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This patch add libseccomp based syscalls filter to disable TIOCSTI
ioctl in su/runuser children.
IMHO it is not elegant solution due to dependence on libseccomp
(--without-seccomp if hate it)... but there is nothing better for now.
Addresses: CVE-2016-2779
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This helper/exploit injects "id -u -n\n" to the vulnerable calling terminal.
Use id -u -n to get a reproducible output of test cases based on it.
What can happen:
Nothing, no exploit: pty is not accessible, sedsid() disconnected the task from
pty, TIOCSTI failed.
The command is injected to the unprivileged environment pty, and you see e. g.
"nobody": This is acceptable.
The command is injected to the caller (privileged) pty, and you see "root" (or
caller uid name): This is not acceptable and has security implications.
References:
CVE-2016-2779
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2779
http://seclists.org/oss-sec/2016/q1/448
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815922
https://bugzilla.redhat.com/show_bug.cgi?id=173008
https://bugzilla.suse.com/show_bug.cgi?id=968674
https://bugzilla.suse.com/show_bug.cgi?id=968675
CVE-2016-2781
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2781
http://seclists.org/oss-sec/2016/q1/452
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Federico Bento <up201407890@alunos.dcc.fc.up.pt>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
when mounting a cifs share, the src is actually an UNC path which can in
in several forms:
simple: //host/share, //host/share/
including subpath: //host/share/sub/path
to check if the cifs fs is mounted we have to extract the subpath and
compare *that* to the root.
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
|
|
The text-utility ul can run into a buffer overflow on very long lines.
See this proof of concept how to reproduce the issue:
$ dd if=/dev/zero bs=1M count=10 | tr '\000' '\041' > poc.txt
$ echo -ne '\xe\x5f\x8\x5f\x61\x2\xf\x5f\x8\x5f' | dd of=poc.txt conv=notrunc
$ ul -i poc.txt > /dev/null # output would take ages
Segmentation fault
$ _
The problem manifests by using alloca with "maxcol", which can be as
large as INT_MAX, based on the input line.
A very long line (> 8 MB) with modes must be supplied to ul, as seen in
my proof of concept byte sequence above.
It is rather easy to fix this issue: allocate space on the heap instead.
maxcol could overflow here, but in that case no system will have enough
space to handle the request, properly ending ul through an err() call.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
|
Do not follow null pointer, and stop going any further when
ltrim_whitespace() is at the end of a string.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
|
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|