]>
git.ipfire.org Git - thirdparty/util-linux.git/log
Antonio Ceballos Roa [Fri, 30 Sep 2016 08:34:15 +0000 (10:34 +0200)]
po: update es.po (from translationproject.org)
Philipp Thomas [Fri, 30 Sep 2016 08:34:15 +0000 (10:34 +0200)]
po: update de.po (from translationproject.org)
Petr Písař [Fri, 30 Sep 2016 08:34:15 +0000 (10:34 +0200)]
po: update cs.po (from translationproject.org)
Karel Zak [Fri, 30 Sep 2016 08:30:07 +0000 (10:30 +0200)]
findmnt: remove duplicate include
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 30 Sep 2016 08:29:00 +0000 (10:29 +0200)]
tests: update build-sys tests
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 29 Sep 2016 14:32:33 +0000 (16:32 +0200)]
su,runuser: add libseccomp based workaround for TIOCSTI ioctl
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>
Stanislav Brabec [Wed, 2 Mar 2016 19:35:54 +0000 (20:35 +0100)]
tests: Add helper for TIOCSTI exploit
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>
Karel Zak [Thu, 29 Sep 2016 09:55:07 +0000 (11:55 +0200)]
libmount: paranoid change in mnt_table_is_fs_mounted()
Signed-off-by: Karel Zak <kzak@redhat.com>
Aurelien Aptel [Thu, 1 Sep 2016 11:57:42 +0000 (13:57 +0200)]
libmount: fix mount -a for cifs
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>
Tobias Stoeckmann [Thu, 8 Sep 2016 19:19:22 +0000 (21:19 +0200)]
ul: Fix buffer overflow
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>
Sami Kerola [Sun, 4 Sep 2016 10:15:34 +0000 (11:15 +0100)]
lib/strutils: make left and right trims more robust
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>
Karel Zak [Tue, 27 Sep 2016 12:16:18 +0000 (14:16 +0200)]
libsmartcols: custom wrap fixes
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 27 Sep 2016 10:52:47 +0000 (12:52 +0200)]
docs: some random fixes
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 27 Sep 2016 09:58:32 +0000 (11:58 +0200)]
libfdisk: (docs) add missing version notes
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 27 Sep 2016 09:35:43 +0000 (11:35 +0200)]
libsmartcols: (docs) add missing version notes
Signed-off-by: Karel Zak <kzak@redhat.com>
Igor Gnatenko [Fri, 23 Sep 2016 14:05:02 +0000 (16:05 +0200)]
libsmartcols: fixes in doc generation
* Add 2.29 symbols index
* Sync argument names between header and implementation
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Mon, 26 Sep 2016 09:20:07 +0000 (11:20 +0200)]
libsmartcols: support custom wrap and remove SCOLS_FL_WRAPNL
This new API provides full control on multi-line cells, you can wrap
text by new lines (build-in support) or by another way (after words,
commas, etc.) Changes:
* new scols_column_set_wrapfunc() sets pointers to two callback functions
1/ chunksize() - returns largest data chunk size; used when we
calculate columns width
2/ nextchunk() - terminate the current chunk and returns pointer to
the next; used when we print data
* remove SCOLS_FL_WRAPNL and add new functions scols_wrapnl_chunksize()
and scols_wrapnl_nextchunk() to provide build-in functionality to
wrap cells on \n
* remove scols_column_is_wrapnl() add scols_column_is_customwrap()
(returns true if custom wrap functions are defined)
* add scols_column_set_safechars() and scols_column_get_safechars() to
allow to control output encoding, safe chars are not encoded by \xFOO
* modify "fromfile" test code to use build-in scols_wrapnl_* callbacks
for "wrapnl" tests
* add new function scols_column_get_table()
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 23 Sep 2016 12:31:06 +0000 (14:31 +0200)]
libsmartcols: (docs) add missing functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 23 Sep 2016 12:25:37 +0000 (14:25 +0200)]
Merge branch 'getters' of https://github.com/ignatenkobrain/util-linux
* 'getters' of https://github.com/ignatenkobrain/util-linux:
libsmartcols: add scols_table_is_nolinesep()
libsmartcols: add scols_table_is_nowrap()
libsmartcols: add scols_table_get_name()
Igor Gnatenko [Fri, 23 Sep 2016 12:21:15 +0000 (14:21 +0200)]
libsmartcols: add scols_table_is_nolinesep()
And save 1 or 0 into tb->no_linesep instead of any value.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Fri, 23 Sep 2016 12:20:41 +0000 (14:20 +0200)]
libsmartcols: add scols_table_is_nowrap()
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Fri, 23 Sep 2016 12:20:24 +0000 (14:20 +0200)]
libsmartcols: cleanup scols_table_set_symbols() API
Change behavior:
* scols_table_set_symbols(tb, NULL) remove reference to the current symbols setting
and does not set default symbols at all
Add new functions:
* scols_table_get_symbols()
* scols_table_set_default_symbols()
Signed-off-by: Karel Zak <kzak@redhat.com>
Igor Gnatenko [Fri, 23 Sep 2016 12:09:43 +0000 (14:09 +0200)]
libsmartcols: add scols_table_get_name()
Currently we have scols_table_set_name() but don't have getter for it.
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Fri, 23 Sep 2016 11:20:49 +0000 (13:20 +0200)]
findmnt: (verify) add docs
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 22 Sep 2016 11:46:05 +0000 (13:46 +0200)]
findmnt: (verify) minor changes in strings
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 22 Sep 2016 11:40:24 +0000 (13:40 +0200)]
findmnt: (verify) check filesystem type
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 Sep 2016 13:08:24 +0000 (15:08 +0200)]
findmnt: (verify) add swaparea verification
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 Sep 2016 12:32:47 +0000 (14:32 +0200)]
findmnt: (verify) add options verification
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 Sep 2016 12:15:49 +0000 (14:15 +0200)]
findmnt: (verify) add source verification
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 20 Sep 2016 13:45:15 +0000 (15:45 +0200)]
findmnt: add --verify and --verbose
Signed-off-by: Karel Zak <kzak@redhat.com>
Igor Gnatenko [Fri, 23 Sep 2016 09:24:28 +0000 (11:24 +0200)]
libsmartcols: use const qualifier for scols_table_get_termwidth
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Fri, 23 Sep 2016 09:14:15 +0000 (11:14 +0200)]
Merge branch 'api_const' of https://github.com/ignatenkobrain/util-linux
* 'api_const' of https://github.com/ignatenkobrain/util-linux:
libsmartcols: use const qualifier where it's possible
debug: use const void * for ul_debugobj()
libsmartcols: make get_line/column_separator() return const
Karel Zak [Fri, 23 Sep 2016 09:07:15 +0000 (11:07 +0200)]
Merge branch 'master' of https://github.com/ignatenkobrain/util-linux
Karel Zak [Thu, 22 Sep 2016 11:47:23 +0000 (13:47 +0200)]
libsmartcols: keep scols_table_get_termwidth() read-only
Addresses: https://github.com/karelzak/util-linux/issues/356
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 Sep 2016 12:47:32 +0000 (14:47 +0200)]
swapon: fix discard option parsing
The current code does not work as expected if there is an option
behind the discard=<arg>, for example:
swapon /dev/sdc -o discard=once,pri=10
ignores "once" the result is SWAP_FLAG_DISCARD; strace:
Old version:
swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|10) = 0
Fixed version:
swapon("/dev/sdc", SWAP_FLAG_PREFER|SWAP_FLAG_DISCARD|SWAP_FLAG_DISCARD_ONCE|10) = 0
Signed-off-by: Karel Zak <kzak@redhat.com>
Igor Gnatenko [Wed, 21 Sep 2016 06:30:48 +0000 (08:30 +0200)]
libsmartcols: use const qualifier where it's possible
Closes: https://github.com/karelzak/util-linux/issues/355
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Wed, 21 Sep 2016 06:22:35 +0000 (08:22 +0200)]
debug: use const void * for ul_debugobj()
We don't modify data it's pointing out and we should not modify it.
Also remove casting to void * as gcc will do it automatically (before
we had to cast it explicitly to avoid warning on discarding 'const'
qualifier).
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Wed, 21 Sep 2016 05:25:23 +0000 (07:25 +0200)]
libsmartcols: make get_line/column_separator() return const
The patch introduces tiny API changes (char * -> const char *) for
scols_table_get_line_separator
scols_table_get_column_separator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Tue, 20 Sep 2016 13:36:55 +0000 (15:36 +0200)]
trivial: use tabs consistently
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Mon, 19 Sep 2016 12:21:18 +0000 (14:21 +0200)]
Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux
Karel Zak [Mon, 19 Sep 2016 12:20:37 +0000 (14:20 +0200)]
Merge branch 'typos' of https://github.com/ignatenkobrain/util-linux
* 'typos' of https://github.com/ignatenkobrain/util-linux:
libsmartcols: fix typos in docs
Igor Gnatenko [Sat, 17 Sep 2016 16:55:52 +0000 (18:55 +0200)]
libsmartcols: be consistent, use 'sy' for symbols
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Sun, 18 Sep 2016 09:47:13 +0000 (11:47 +0200)]
libsmartcols: fix typos in docs
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Karel Zak [Mon, 19 Sep 2016 12:07:38 +0000 (14:07 +0200)]
libsmartcols: be more strict about empty tables
and don't print extra \n for empty table.
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 19 Sep 2016 11:48:42 +0000 (13:48 +0200)]
libsmartcols: fix comment
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 19 Sep 2016 11:39:03 +0000 (13:39 +0200)]
libsmartcols: cleanup get functions
The patch introduces tiny API changes (int -> size_t) for
scols_table_get_ncols
scols_table_get_nlines
Addresses: https://github.com/karelzak/util-linux/issues/349
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 12:18:01 +0000 (14:18 +0200)]
tests: add columns separator to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 11:49:37 +0000 (13:49 +0200)]
tests: add export and raw to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 11:37:08 +0000 (13:37 +0200)]
tests: add libsmartcols JSON test
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 11:30:29 +0000 (13:30 +0200)]
libsmartcols: add JSON support to sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 11:22:47 +0000 (13:22 +0200)]
libsmartcols: improve JSON
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 16 Sep 2016 11:00:47 +0000 (13:00 +0200)]
libsmartcols: cleanup line separator usage
* use line separator only to separate lines, not after last line
* explicitly print \n after table in scols_print_table()
* don't terminate table by \n or line separator in scols_print_table_to_string()
Note that the patch is little bit trick due to impact to the trees
printing. Now print_tree_line() should be more readable.
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 15 Sep 2016 10:32:58 +0000 (12:32 +0200)]
tests: add libsmartcols wrap and wrapnl tree tests
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 15 Sep 2016 10:25:08 +0000 (12:25 +0200)]
tests: add tree libsmartcols test files
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 15 Sep 2016 10:22:12 +0000 (12:22 +0200)]
libsmartcols: fix tree padding
We cannot use cell-padding char with in tree ASCII art, because
tree uses two chars rather than one.
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 15 Sep 2016 10:12:18 +0000 (12:12 +0200)]
libsmartcols: add support for trees to the sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 15 Sep 2016 08:05:15 +0000 (10:05 +0200)]
Merge branch 'patch-1' of https://github.com/ignatenkobrain/util-linux
Igor Gnatenko [Wed, 14 Sep 2016 17:36:51 +0000 (19:36 +0200)]
trivial: s/automatical/automatic/g
"Automatical" is archaic form of "automatic".
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko [Tue, 13 Sep 2016 13:06:49 +0000 (15:06 +0200)]
smartcols/symbols: free cell_padding in unref()
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Karel Zak [Wed, 14 Sep 2016 15:02:54 +0000 (17:02 +0200)]
tests: add missing expected/ dir stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 14 Sep 2016 10:49:46 +0000 (12:49 +0200)]
tests: add libsmartcols title test
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 14 Sep 2016 10:38:34 +0000 (12:38 +0200)]
tests: add another libsmartcols tests
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 14 Sep 2016 10:37:53 +0000 (12:37 +0200)]
libsmartcols: fix hidden file usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 13 Sep 2016 14:50:10 +0000 (16:50 +0200)]
build-sys: remove dead libsmartcols sample
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 13 Sep 2016 12:12:11 +0000 (14:12 +0200)]
tests: improve libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 13 Sep 2016 12:06:01 +0000 (14:06 +0200)]
libsmartcols: add functions to control terminal usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 13 Sep 2016 11:08:02 +0000 (13:08 +0200)]
libsmartcols: add application to test library features
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 12 Sep 2016 14:12:22 +0000 (16:12 +0200)]
libsmartcols: fix WRAPNL on strings without \n
Addresses: https://github.com/karelzak/util-linux/issues/343
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 12 Sep 2016 09:58:34 +0000 (11:58 +0200)]
libsmartcols: fix WRAPNL crashes
Addresses: https://github.com/karelzak/util-linux/issues/344
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 8 Sep 2016 09:57:34 +0000 (11:57 +0200)]
mount: add note about another flags for "remount,bind"
The man page is talking about read-only bind mounts (-o
remount,bind,ro), but this feature also works for another VFS flags
like nodev, suid, etc. For example:
mount -o remount,bind,noatime /mountpoint
is a valid command.
Addresses: https://github.com/karelzak/util-linux/issues/342
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 7 Sep 2016 10:25:06 +0000 (12:25 +0200)]
libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on
This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).
For example:
$ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 7 Sep 2016 09:45:35 +0000 (11:45 +0200)]
libsmartcols: add fallback for symbols
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 7 Sep 2016 09:07:04 +0000 (11:07 +0200)]
libsmartcols: allow to change cell padding char
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 12:49:48 +0000 (14:49 +0200)]
fsck: remove fs-specific options from man page
Let's force users to read fs-specific man pages rather than try to be
smart and maintain some non-fsck options in fsck.8.
Reported-by: Matej Cepl <mcepl@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 11:01:45 +0000 (13:01 +0200)]
libsmartcols: extend wrapnl sample
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 11:01:09 +0000 (13:01 +0200)]
libsmartcols: fix padding for non-maxout output
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 10:24:49 +0000 (12:24 +0200)]
libsmartcols: remove debuging code from sample
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 09:18:18 +0000 (11:18 +0200)]
libsmartcols: commit missing file
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 08:51:25 +0000 (10:51 +0200)]
libsmartcols: support multi-line cells based on line breaks
Now libsmartcols completely control when and how wrap long
lines/cells. This is sometimes user unfriendly and it would be nice to
support multi-line cells where wrap is based on \n (new line char).
This patch add new column flag SCOLS_FL_WRAPNL.
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 6 Sep 2016 08:19:52 +0000 (10:19 +0200)]
lib/randutils: add xsrand() and rand_get_number()
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 2 Sep 2016 09:14:54 +0000 (11:14 +0200)]
sfdisk: add --no-tell-kernel
The option forces sfdisk to not call re-read partitions ioctl after
write PT.
Requested-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 1 Sep 2016 09:43:42 +0000 (11:43 +0200)]
tests: update sfdisk output strings
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 13:51:11 +0000 (15:51 +0200)]
sfdisk: make non-interactive output more readable
# echo -e ',1M\n,2M' | sfdisk /dev/sdc
Old version:
>>> Created a new DOS disklabel with disk identifier 0x8fc7d065.
Created a new partition 1 of type 'Linux' and of size 1 MiB.
/dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB.
/dev/sdc3:
New version:
>>> Created a new DOS disklabel with disk identifier 0x9afe17c0.
/dev/sdc1: Created a new partition 1 of type 'Linux' and of size 1 MiB.
/dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB.
/dev/sdc3: Done.
Addresses: https://github.com/karelzak/util-linux/issues/337
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 13:51:03 +0000 (15:51 +0200)]
libsmartcols: use SCOLS_FL_RIGHT in sample
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 13:15:28 +0000 (15:15 +0200)]
libsmartcols: add maxout sample
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 13:13:06 +0000 (15:13 +0200)]
libsmartcols: fix minimal column width calculation
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 11:01:48 +0000 (13:01 +0200)]
libsmartcols: fix non-tty output for 'maxout' columns
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 10:42:38 +0000 (12:42 +0200)]
libsmartcols: fix title output on non-tty
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 10:05:48 +0000 (12:05 +0200)]
libsmartcols: fix scols_table_enable_colors() usage in samples
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2016 10:05:21 +0000 (12:05 +0200)]
libsmartcols: don't print title color is colors disabled
Signed-off-by: Karel Zak <kzak@redhat.com>
Tobias Stoeckmann [Tue, 30 Aug 2016 19:00:38 +0000 (21:00 +0200)]
lib/loopdev: Set errno in is_loopdev on error
The function is_loopdev does not set errno if the supplied string does
not reference a valid loop device. Fix this to avoid an error message
like this one:
losetup: /: failed to use device: Success
I prefer this one:
losetup: /: failed to use device: No such device
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Karel Zak [Wed, 31 Aug 2016 07:48:43 +0000 (09:48 +0200)]
mount: add note about paths verification to mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
Rostislav Skudnov [Tue, 30 Aug 2016 10:07:49 +0000 (10:07 +0000)]
libblkid: [exfat] Limit maximum number of iterations in find_label
Do not hang if there is a cluster chain loop in rootdir
[kzak@redhat.com: - add return NULL]
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 30 Aug 2016 10:07:40 +0000 (12:07 +0200)]
libblkid: ignore empty MBR on LVM device
It's possible to use boot sector and empty MBR on LVM physical volume
to make LVM disk bootable. In this case MBR should be ignored and disk
reported as LVM.
Just for the record, this is ugly non-default LVM setup maintained for
backward compatibility (yes, LVM guys don't like it too).
Unfortunately people still use it. The proper way is to use regular
partitioned disk.
Reported-by: Xen <list@xenhideout.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 30 Aug 2016 09:22:30 +0000 (11:22 +0200)]
libblkid: remove unused function
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 30 Aug 2016 08:41:05 +0000 (10:41 +0200)]
umount: cleanup umount.8 about mtab
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 30 Aug 2016 08:25:44 +0000 (10:25 +0200)]
umount: fix obsolete info about loop= in umount.8
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=
1370959
Signed-off-by: Karel Zak <kzak@redhat.com>
Tobias Stoeckmann [Sun, 28 Aug 2016 19:15:59 +0000 (21:15 +0200)]
libblkid: Avoid OOB access on illegal ZFS superblocks
64 bit systems can trigger an out of boundary access while performing
a ZFS superblock probe.
This happens due to a possible integer overflow while calculating
the remaining available bytes. The variable is of type "int" and the
string length is allowed to be larger than INT_MAX, which means that
avail calculation can overflow, circumventing the "avail < 0" check and
therefore accessing memory outside the "buff" array later on.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 27 Aug 2016 17:28:48 +0000 (19:28 +0200)]
libfdisk: Distinguish between first LBA sector and partition
An insufficient check leads to an invalid free space output, as seen here:
$ dd if=/dev/zero of=cfdisk.iso bs=1M count=1
$ losetup -f cfdisk.iso
$ echo w | fdisk /dev/loop0
$ echo '1,1' | sfdisk /dev/loop0 --append
$ echo '3,' | sfdisk /dev/loop0 --append
$ sfdisk --list-free /dev/loop0
Start End Sectors Size
1 2 2 1K
$ _
In this case, libfdisk fails to notice that it tries to calculate space
between two partitions, not between start of disk and first partition.
Currently, the code tries to achieve that by checking the address of the
last "partition", which is the first_lba block. Now if the first
partition is merely 1 block in size, the "last" address is still equal
to the first_lba block, which renders the check in libfdisk for the next
partition invalid.
I chose to use "nparts == 0" for this check, because the partitions are
properly sorted before iterating over them.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 27 Aug 2016 17:28:16 +0000 (19:28 +0200)]
libfdisk: Fix assert error in free space handling
An off-by-one issue exists in fdisk_get_freespaces. It can trigger an
assert, as seen here:
$ dd if=/dev/zero of=cfdisk.iso bs=1M count=1
$ losetup -f cfdisk.iso
$ echo w | fdisk /dev/loop0
$ echo '1,2' | sfdisk /dev/loop0 --append
$ echo '3,' | sfdisk /dev/loop0 --append
$ sfdisk --list-free /dev/loop0
Aborted
$ _
Problem here is an invalid "grain" processing. A grain is considered
expected free space between partitions which can be required for proper
alignment. Normally, it's 1 MB but in this case our iso is merely 1 MB
so the grain is reduced to 1 byte.
The if-condition in question checks for "last + grain <= pa->start" and
therefore even triggers if there is no space between them (due to equal
check). Eventually, the start block address is higher than the end block
address which triggers the assert().
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>