Commit Graph

10796 Commits

Author SHA1 Message Date
Karel Zak 37301faa01 build-sys: release++ (v2.29-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:24:42 +02:00
Karel Zak 66872edda5 docs: update v2.29-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:22:39 +02:00
Karel Zak b86db3c7cf docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:13:00 +02:00
Karel Zak 0d74f118cc po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:05:42 +02:00
Karel Zak 82053f5e3d libsmartcols: add scols_column_add_width()
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:01:41 +02:00
Sebastian Rasmussen 9abc823240 po: update sv.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Jakub Bogusz 7752451c25 po: update pl.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Benno Schulenberg c9ef4c05a9 po: update nl.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Takeshi Hamasaki 91420f055a po: update ja.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Antonio Ceballos Roa 09cac2b971 po: update es.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Philipp Thomas 452c0f04fb po: update de.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Petr Písař 01207d0f92 po: update cs.po (from translationproject.org) 2016-09-30 10:34:15 +02:00
Karel Zak 3255314721 findmnt: remove duplicate include
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 10:30:07 +02:00
Karel Zak c9a11fe892 tests: update build-sys tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 10:29:00 +02:00
Karel Zak 8e49250168 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>
2016-09-29 16:32:33 +02:00
Stanislav Brabec a0a8e98844 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>
2016-09-29 14:24:00 +02:00
Karel Zak 3e44e75dae libmount: paranoid change in mnt_table_is_fs_mounted()
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-29 11:55:07 +02:00
Aurelien Aptel 76d4fba2e4 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>
2016-09-29 11:51:38 +02:00
Tobias Stoeckmann f20b214edc 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>
2016-09-29 11:49:08 +02:00
Sami Kerola 0b404f0845 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>
2016-09-29 11:49:08 +02:00
Karel Zak 68a7f92b94 libsmartcols: custom wrap fixes
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 14:16:18 +02:00
Karel Zak 81b176c4da docs: some random fixes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 12:52:47 +02:00
Karel Zak be163aa0da libfdisk: (docs) add missing version notes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 11:58:32 +02:00
Karel Zak 3f47320a17 libsmartcols: (docs) add missing version notes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 11:35:43 +02:00
Igor Gnatenko 618a1d6dbe 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>
2016-09-27 11:19:03 +02:00
Karel Zak 949ea05f1a 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>
2016-09-26 11:20:07 +02:00
Karel Zak 0d71eb9c4b libsmartcols: (docs) add missing functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 14:31:06 +02:00
Karel Zak a3b91e82f2 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()
2016-09-23 14:25:37 +02:00
Igor Gnatenko 43e06c67f9 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>
2016-09-23 14:21:15 +02:00
Igor Gnatenko 8427c2ec9c libsmartcols: add scols_table_is_nowrap()
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:20:41 +02:00
Karel Zak 63168cf9b5 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>
2016-09-23 14:20:24 +02:00
Igor Gnatenko 9696071737 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>
2016-09-23 14:11:34 +02:00
Karel Zak 302419e8da findmnt: (verify) add docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak a766fafef3 findmnt: (verify) minor changes in strings
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak 5f1608e068 findmnt: (verify) check filesystem type
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak a1c95432f8 findmnt: (verify) add swaparea verification
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak 67260dc468 findmnt: (verify) add options verification
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak 169b4a8cd5 findmnt: (verify) add source verification
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Karel Zak c768892f4c findmnt: add --verify and --verbose
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 13:21:02 +02:00
Igor Gnatenko e0140aa138 libsmartcols: use const qualifier for scols_table_get_termwidth
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 11:27:35 +02:00
Karel Zak 266eecd54e 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
2016-09-23 11:14:15 +02:00
Karel Zak 54d98cf8e8 Merge branch 'master' of https://github.com/ignatenkobrain/util-linux 2016-09-23 11:07:15 +02:00
Karel Zak 02aaba6f9f 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>
2016-09-22 13:47:23 +02:00
Karel Zak 07332bfa1e 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>
2016-09-21 15:08:50 +02:00
Igor Gnatenko f7a9ea28ef 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>
2016-09-21 08:36:00 +02:00
Igor Gnatenko 0e0943c15b 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>
2016-09-21 08:22:35 +02:00
Igor Gnatenko 6f9377ab81 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>
2016-09-21 07:26:44 +02:00
Igor Gnatenko 2889fb2da9 trivial: use tabs consistently
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-20 15:36:55 +02:00
Karel Zak 8f0c12f1c9 Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux 2016-09-19 14:21:18 +02:00
Karel Zak ffd1325ddd Merge branch 'typos' of https://github.com/ignatenkobrain/util-linux
* 'typos' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: fix typos in docs
2016-09-19 14:20:37 +02:00