aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-12-07sulogin: bail out from getpasswd(...) on timeoutHEADmasterAndreas Henriksson1-0/+4
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>
2016-12-07sulogin: make getpasswd(...) return NULL on ^DAndreas Henriksson1-0/+1
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>
2016-12-07build-sys: disable tailf by defaultRuediger Meier1-1/+5
It's deprecated since 3f8478a7, so we shouldn't build it by default. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07agetty: re-add utmp.h for Debian GNU/kFreeBSDRuediger Meier2-1/+9
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>
2016-12-07travis: let OSX auto-skip utmpx toolsRuediger Meier1-8/+0
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>
2016-12-07build-sys: check for POSIX utmpx usageRuediger Meier1-0/+9
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>
2016-12-07login-utils: switch to utmpx.hRuediger Meier9-90/+92
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>
2016-12-07agetty: remove obsolete HAVE_UPDWTMP fallbackRuediger Meier5-25/+1
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07login: re-add lastlog.h headerRuediger Meier2-0/+4
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>
2016-12-07login-utils: avoid using the defined utmp sizes.Ruediger Meier2-10/+10
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07utmpdump: code formatting for readabilityRuediger Meier1-3/+5
BTW avoid using the defined sizes. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-07lslogins: remove useless strlen()Ruediger Meier1-6/+2
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>
2016-12-07login-utils: remove _HAVE_UT_TV fallbackRuediger Meier5-56/+15
_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>
2016-12-07last: include libgen.h for basename(3p)Ruediger Meier1-1/+6
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-05docs: kill(1): Wording fixMichael Kerrisk1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05docs: kill(1): Formatting fixesMichael Kerrisk1-2/+7
Formatting fixes for constants and structure/field names, as per man-pages(7). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05docs: kill(1): Rework notes on thread groupsMichael Kerrisk1-18/+15
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>
2016-12-05docs: kill(1): Add more detail on use of SIGTERM vs SIGKILLMichael Kerrisk1-3/+11
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>
2016-12-05docs: kill(1): Fix section reference for sigqueue(3) and add to SEE ALSOMichael Kerrisk1-1/+2
Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-05docs: various pages: Use "system call" not "syscall"Michael Kerrisk5-8/+9
A minor wording fix... Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-05chrt: default to SCHED_RR policyAndreas Henriksson1-1/+1
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>
2016-12-05docs: nsenter(1): add missing 'see also' for --userKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-05docs: nsenter(1): Formatting fixMichael Kerrisk1-14/+36
Add formatting for 'file' argument used by various options. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05docs: nsenter(1): Describe the 'file' argument used by namespace optionsMichael Kerrisk1-0/+7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-02wall: check -g GIDKarel Zak2-2/+8
Based on comments from Sami Kerola. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-02fallocate: add insert range supportFabian Frederick2-2/+15
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>
2016-12-02wall: add --group optionJim Patterson3-1/+86
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>
2016-12-02lsns: Fix parser for /proc/<pid>/stat which is including space in commOGAWA Hirofumi1-4/+26
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>
2016-12-01misc: fix typos using codespellRuediger Meier4-5/+5
# 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>
2016-11-30misc: spelling, always use "cannot" instead of "can not"Ruediger Meier11-15/+15
Just to be consistent ... Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-30tests: update sfdisk outputKarel Zak48-0/+96
The output of the "New situation:" contains Disklabel type: <name> Disk identifier: <removed> lines now. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30sfdisk: support empty label use-caseKarel Zak7-10/+75
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>
2016-11-30sfdisk: cleanup --dump error messagesKarel Zak1-1/+4
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>
2016-11-30tests: update lsmem testsKarel Zak2-35/+35
The commit 4c0e1eaf34fe604118afcd792291419e1d4ff661 modifies the alignment of the STATE column. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29Merge branch 'master' of https://github.com/rudimeier/util-linuxKarel Zak1-1/+1
2016-11-29sfdisk: don't be silent when list non-existing deviceKarel Zak1-6/+10
Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29build-sys: use sed to substituteKarel Zak1-1/+1
Travis CI: tools/git-version-gen: 116: tools/git-version-gen: Bad substitution Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29build-sys: cosmetics, avoid useless m4 quotesRuediger Meier1-1/+1
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29build-sys: fix bashism, introduced in 85004b14Ruediger Meier1-1/+1
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29build-sys: fix "remove the g in git describe"Ruediger Meier1-8/+8
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>
2016-11-29build-sys: remove old git fallback from git-version-genRuediger Meier1-21/+0
Just make the script more readable. Nobody is using 10 years old git. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29build-sys: cosmetics PACKAGE_VERSION_MINORRuediger Meier1-2/+2
This should changes nothing. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29build-sys: update package release number during developmentRuediger Meier1-1/+1
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>
2016-11-29build-sys: fix empty package release numberRuediger Meier1-4/+2
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>
2016-11-29IPC namespaces also isolate POSIX message queuesMichael Kerrisk (man-pages)2-2/+4
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>
2016-11-29Provide better cross references for namespace conceptsMichael Kerrisk (man-pages)1-15/+44
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>
2016-11-29Provide better cross references for namespace conceptsMichael Kerrisk (man-pages)1-10/+47
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>
2016-11-29SEE ALSO: add cross reference to namespaces(7)Michael Kerrisk (man-pages)2-1/+3
Rationale: both of these pages are about namespaces. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29Replace reference to sigvec(2) with sigaction(2)Michael Kerrisk (man-pages)1-1/+1
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>
2016-11-29Fix formatting errors in page cross referencesMichael Kerrisk (man-pages)4-4/+4
These pages had errors such as .BR page (x) . which should be .BR page (x). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29Fix reference for scheduling discussionMichael Kerrisk (man-pages)1-1/+1
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>
2016-11-29Fix section number in lockf() page xrefMichael Kerrisk (man-pages)1-1/+1
lockf() is in section 3, not 2. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29Fix page cross referencesMichael Kerrisk (man-pages)3-11/+11
* Add a section number to page cross reference * Format cross references in bold Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29Correctly format page cross referencesMichael Kerrisk (man-pages)4-5/+5
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>
2016-11-29Place SEE ALSO entries in orderMichael Kerrisk (man-pages)47-88/+88
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>
2016-11-29Fix typo in page cross reference (capabilities(7), not, capability(7))Michael Kerrisk (man-pages)1-1/+1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-09lsmem: improve node lookupHeiko Carstens1-0/+1
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>
2016-11-09lsmem: (man page) recommend use --outputKarel Zak1-4/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: align STATE to the rightKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: add CopyrightKarel Zak2-2/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09tests: add x86_64-16g lsmem testKarel Zak3-1/+272
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09tests: cleanup and update lsmemKarel Zak2-105/+126
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: add missing placeholdersKarel Zak1-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: cleanup for --summary=onlyKarel Zak1-0/+11
* don't fill scols table * check for collision with raw,pairs and json options Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: cleanup man pageKarel Zak2-62/+45
* 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>
2016-11-09lsmem: disable summary for JSONm, raw and export outputKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: add --summary[=<when>] optionKarel Zak1-12/+48
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: rename control structKarel Zak1-67/+67
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: cleanup, use libsmartcols for all outputKarel Zak1-188/+213
* add --pairs, --raw a --json outputs * add --noheadings to disable header * add --bytes * add --output <list> Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09build-sys: mark lsmem and chmem as Linux onlyKarel Zak1-2/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09lsmem: add testcaseHeiko Carstens5-0/+166
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>
2016-11-09chmem: new toolHeiko Carstens5-0/+435
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>
2016-11-09lsmem: new toolHeiko Carstens5-0/+605
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>
2016-11-09lib,strutils: add strtoux[16|32|64]_or_err functionsHeiko Carstens2-6/+41
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>
2016-11-08build-sys: release++ (v2.29)Karel Zak2-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-08docs: update v2.29-ReleaseNotesKarel Zak1-1/+50
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-08po: merge changesKarel Zak27-7484/+8020
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-08po: update zh_CN.po (from translationproject.org)Wylmer Wang1-1614/+1171
2016-11-08po: update uk.po (from translationproject.org)Yuri Chornoivan1-195/+150
2016-11-08po: update sv.po (from translationproject.org)Sebastian Rasmussen1-194/+146
2016-11-08po: update pl.po (from translationproject.org)Jakub Bogusz1-233/+157
2016-11-08po: update nl.po (from translationproject.org)Benno Schulenberg1-212/+182
2016-11-08po: update es.po (from translationproject.org)Antonio Ceballos Roa1-188/+141
2016-11-08po: update de.po (from translationproject.org)Philipp Thomas1-2735/+2407
2016-11-07tests: let lsmod fail silentlyRuediger Meier1-2/+2
This is mostly for non-Linux systems where lsmod is not even available. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-07tests: always quote $LODEVRuediger Meier1-23/+23
Since there is no error handling in this test $LODEV may be empty. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-07tests: replace sleep by udevadmRuediger Meier1-11/+10
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> CC: Stanislav Brabec <sbrabec@suse.cz>
2016-11-07tests: udevadm settle before losetup -dRuediger Meier1-0/+10
Fails on Debian 7 (wheezy), Kernel 3.2. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> CC: Stanislav Brabec <sbrabec@suse.cz>
2016-11-07docs: update TODO fileKarel Zak1-2/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-03lscpu: disable is_vmware_platform() for non-root usersKarel Zak1-0/+9
References: http://www.spinics.net/lists/util-linux-ng/msg13302.html Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-03tests: check for timeout progKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-02tests: wait for flock background processRuediger Meier1-0/+10
Maybe we should add a --daemonize option to flock to cover this use case. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-02lsblk: add note about --sort and --list relationKarel Zak2-1/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-02lsblk: sort by MAJ:MIN by defaultKarel Zak1-0/+5
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>
2016-11-02libsmartcols: make scols_sort_table() usable for treesKarel Zak1-3/+50
We also need to sort children when tree is enabled. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-02libfdisk: fix typoKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-31tests: add flock testsKarel Zak9-0/+107
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-31flocks: keep run_program() simpleKarel Zak1-8/+7
2016-10-31Merge branch 'fixes-for-v2.29' of https://github.com/rudimeier/util-linuxKarel Zak8-45/+22
* '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()
2016-10-31flock: fix no-flock patchKarel Zak1-17/+28
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842598 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-27mount: append inverting options for mount.<type> on "users"Karel Zak1-1/+2
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>
2016-10-27misc: once again some printf format stringsRuediger Meier3-5/+7
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-27misc: fix some compiler warningsRuediger Meier4-37/+9
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>
2016-10-27chrt: fix HAVE_SCHED_SETATTR fallback caseRuediger Meier1-2/+3
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>
2016-10-27fdisk: fix memleak in list_disk_geometry()Ruediger Meier1-1/+3
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-27libfdisk: cleanup labelitem initializationKarel Zak3-2/+12
* 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>
2016-10-27libfdisk: fix uninitialized fdisk_labelitemRuediger Meier1-1/+1
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>
2016-10-26tests: add sfdisk script case-insensitive testKarel Zak2-0/+35
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26libfdisk: (script) make bootable flag parsing more robustKarel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26libfdisk: add trivial script testKarel Zak1-0/+19
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26fdisk: fix compiler warningKarel Zak1-2/+2
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>
2016-10-26Merge branch 'tests-raid1' of https://github.com/rudimeier/util-linuxKarel Zak2-1/+3
2016-10-26misc: fix unsigned int usage for ctype.h functionsKarel Zak5-8/+8
Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25rtcwake: add note about RTC limitsKarel Zak1-0/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25tests: let's follow ts_scsi_debug_rmmodKarel Zak1-2/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25Merge branch 'test-rmmod-scsi_debug' of https://github.com/rudimeier/util-linuxKarel Zak24-54/+45
* 'test-rmmod-scsi_debug' of https://github.com/rudimeier/util-linux: tests: consolidate rmmod scsi_debug
2016-10-25docs: add sfdisk scripts quotes issue to TODO fileKarel Zak1-0/+3
Addresses: https://github.com/karelzak/util-linux/issues/367 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25tests: add another sfdisk script testsKarel Zak8-0/+263
Addresses: https://github.com/karelzak/util-linux/issues/367 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25libfdisk: make script token parser more robustKarel Zak1-3/+29
* 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>
2016-10-25tests: add sfdisk Type= and Id= testKarel Zak2-0/+92
Addresses: https://github.com/karelzak/util-linux/issues/367 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25libfdisk: fix script Type= and Id= parsingKarel Zak1-2/+1
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>
2016-10-25tests: add GPT attributes parser testsKarel Zak6-0/+2264
Addresses: https://github.com/karelzak/util-linux/issues/367 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-25libfdisk: (gpt) make attributes parser more robustKarel Zak1-5/+14
* 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>
2016-10-24Merge branch 'master' of https://github.com/yurchor/util-linuxKarel Zak3-4/+4
* 'master' of https://github.com/yurchor/util-linux: Fix minor typos
2016-10-21build-sys: improve libncursesw5 install for travisKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-21test: fix raid1 minimum I/O sizeRuediger Meier2-1/+3
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>
2016-10-21tests: consolidate rmmod scsi_debugRuediger Meier24-54/+45
- 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>
2016-10-21getopt: be sure that options array is terminatedKarel Zak1-8/+11
Reported-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-21Merge branch 'test-fixes' of https://github.com/rudimeier/util-linuxKarel Zak3-5/+5
* 'test-fixes' of https://github.com/rudimeier/util-linux: build-sys: fix missing ncursesw message tests: avoid &>> for bash compatibility
2016-10-21build-sys: fix drone.io buildsKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-20build-sys: fix missing ncursesw messageRuediger Meier1-2/+2
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-20tests: avoid &>> for bash compatibilityRuediger Meier2-3/+3
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-20tests: call umount --fake for tmpfs testsKarel Zak2-2/+15
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>
2016-10-20Fix minor typosYuri Chornoivan3-4/+4
2016-10-20build-sys: fix typo on ncurses-config command lineKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-20build-sys: use ncurses-config rather than pkg-configKarel Zak2-8/+41
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>
2016-10-19build-sys: release++ (v2.29-rc2)Karel Zak2-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19docs: update v2.29-ReleaseNotesKarel Zak1-1/+47
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19docs: update AUTHORS fileKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19po: merge changesKarel Zak27-13472/+13518
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19tests: update build-sys expected outputKarel Zak18-36/+36
The su(1) change based on libseccomp has been reverted. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19cramfs: revert crc32 changesKarel Zak2-11/+21
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>
2016-10-19cramfs: add missing includesKarel Zak2-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19lib/crc32: prefix public functionsGustavo Zacarias7-18/+18
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>
2016-10-18fstrim: add -v to the systemd serviceKarel Zak1-1/+1
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>
2016-10-07cal: support abbreviated month namesKarel Zak2-4/+21
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-07cal: support alone month name parameterKarel Zak2-7/+16
For example 'cal August' to print August for the current year. Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-07cal: cleanup man pageKarel Zak1-20/+22
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-07cal: remove err message from monthname_to_number()Karel Zak1-3/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-07docs: update AUTHORS fileKarel Zak1-1/+1
Addresses: https://github.com/karelzak/util-linux/commit/b86db3c7cff489b8ce4cf9fc58176a78a1797bdc#commitcomment-19326504 Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-06losetup --nooverlap: fix typoStanislav Brabec1-1/+1
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>
2016-10-06rev: Avoid out of boundary readTobias Stoeckmann1-0/+3
Check if the length of the parsed string is at least 1, otherwise an out of boundary read would occur.
2016-10-06rev: Avoid calling free in a signal handlerTobias Stoeckmann1-1/+0
free() is not a safe function for a signal handler. The next line calls _exit() anyway, so there is no need for resource management.
2016-10-06libblkid: Avoid strlen if only first char is checkedTobias Stoeckmann6-6/+6
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.
2016-10-06docs: update infor about TIOCSTIKarel Zak2-2/+13
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-05Merge branch 'master' of https://github.com/Zeuh/util-linuxKarel Zak1-1/+1
2016-10-05wdct: mark usage() as noreturn [coverity scan]Karel Zak1-1/+1
2016-10-05swapoff: fix mem leak [coverity scan]Karel Zak1-1/+4
2016-10-05setarch: let's keep analyzer happy [coverity scan]Karel Zak1-0/+1
2016-10-05rtcwake: make sure buffer is zero terminated [coverity scan]Karel Zak1-1/+1
2016-10-05lsns: fix mem leak [coverity scan]Karel Zak1-1/+1
2016-10-05findmnt: (verify) fix mem leak [coverity scan]Karel Zak1-5/+6
2016-10-04isosize: fix read() result checkKarel Zak1-1/+1
2016-10-04libmount: fix null-checking [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04libblkid: check blkid_parse_tag_string() return code [coverity scan]Karel Zak2-4/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04lib/randutils: remove unnecessary functionKarel Zak2-10/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04lib/mbsalign: free buffer after error [coverity scan]Karel Zak1-5/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04sfdisk: cleanup before going out of scope [coverity scan]Karel Zak1-5/+12
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04sfdisk: free before going out of scope [coverity scan]Karel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04isosize: don't ignore read() result [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04fsck.cramfs: don't ignore read() result [coverity scan]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04tests: (cramfs) check for test_sysinfoKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04cfdisk: fix mountpoint detectionKarel Zak1-21/+26
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04Fix: list all block device from /dev and all symbolic links to block devicesRichard Yann1-1/+1
Before fix "fsck -y /d<tab>" will never show LVM VG from multipath or mapped devices
2016-10-03Revert "su,runuser: add libseccomp based workaround for TIOCSTI ioctl"Karel Zak3-40/+3
This reverts commit 8e4925016875c6a4f2ab4f833ba66f0fc57396a2. Stupid hack...
2016-10-03tests: add chrt vs. nice testKarel Zak2-0/+64
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-03chrt: follow nice setting, prefer sched_setscheduler()Karel Zak1-16/+18
* 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>
2016-10-01tools: make ko-release-gen usable with gpg2Karel Zak1-1/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30build-sys: release++ (v2.29-rc1)Karel Zak2-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30docs: update v2.29-ReleaseNotesKarel Zak1-0/+485
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30docs: update AUTHORS fileKarel Zak1-1/+17
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30po: merge changesKarel Zak27-19051/+25266
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30libsmartcols: add scols_column_add_width()Karel Zak4-0/+23
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30po: update sv.po (from translationproject.org)Sebastian Rasmussen1-5808/+5136
2016-09-30po: update pl.po (from translationproject.org)Jakub Bogusz1-2257/+2026
2016-09-30po: update nl.po (from translationproject.org)Benno Schulenberg1-2417/+2158
2016-09-30po: update ja.po (from translationproject.org)Takeshi Hamasaki1-2263/+2464
2016-09-30po: update es.po (from translationproject.org)Antonio Ceballos Roa1-2258/+2029
2016-09-30po: update de.po (from translationproject.org)Philipp Thomas1-2258/+2026
2016-09-30po: update cs.po (from translationproject.org)Petr Písař1-2259/+2033
2016-09-30findmnt: remove duplicate includeKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30tests: update build-sys testsKarel Zak18-50/+36
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-29su,runuser: add libseccomp based workaround for TIOCSTI ioctlKarel Zak3-3/+40
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>
2016-09-29tests: Add helper for TIOCSTI exploitStanislav Brabec3-0/+32
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>
2016-09-29libmount: paranoid change in mnt_table_is_fs_mounted()Karel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-29libmount: fix mount -a for cifsAurelien Aptel1-3/+24
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>
2016-09-29ul: Fix buffer overflowTobias Stoeckmann1-10/+4
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>
2016-09-29lib/strutils: make left and right trims more robustSami Kerola1-2/+7
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>
2016-09-27libsmartcols: custom wrap fixesKarel Zak3-8/+6
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27docs: some random fixesKarel Zak10-33/+43
Signed-off-by: Karel Zak <kzak@redhat.com>