]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
8 years agobash-completion: curly brace missed for findmnt
Alexander Kuleshov [Fri, 2 Oct 2015 09:38:56 +0000 (15:38 +0600)] 
bash-completion: curly brace missed for findmnt

This patch provides fix for bash-completion/fndmt script. There
is curly brace missed in the completion generation for the -M/--mountpoint
option.

In other way we will get following messages:

bash: /etc/bash_completion.d/findmnt: line 91: unexpected EOF while looking for matching `)'
bash: /etc/bash_completion.d/findmnt: line 141: syntax error: unexpected end of file

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
8 years agofdisk: to recognize partition type 0xEA (Rufus)
Jörg Jenderek [Sat, 26 Sep 2015 00:58:06 +0000 (02:58 +0200)] 
fdisk: to recognize partition type 0xEA (Rufus)

i used a partitioning+formatting tool product rufus 2.2. of
https://rufus.akeo.ie/ This software has an extra format option for older BIOS.
With this fix the main partition is created with some alignments and for the
remaining unallocated space a small extra and empty partition with
identification 0xEA is created.

On the List of partition identifiers for PCs at
http://www.win.tue.nl/~aeb/partitions/partition_types-1.html is is said that
there is a freedesktop proposal to use also type ea as boot partition

Unfortunately the software fdisk (util-linux-2.27) can not classify that
partition.  I send for the fdisk program my 2 patches so that fdisk recognize
this partition type.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibuuid: fix buffer overflow with long paths
Karel Zak [Wed, 30 Sep 2015 10:42:16 +0000 (12:42 +0200)] 
libuuid: fix buffer overflow with long paths

Based on patch from Justin Akers, he wrote:
> When building Openembedded inside a Jenkins matrix job the paths can
> get quite long. This ensures libuuid won't crash when attempting to
> connect to uuidd in such a scenario.

Reported-by: Justin Akers <dafugg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agozramctl: fix lists of the all devices
Karel Zak [Thu, 24 Sep 2015 10:46:21 +0000 (12:46 +0200)] 
zramctl: fix lists of the all devices

The command zramctl lists the same stat info for all devices (DATA COMPR TOTAL).

Reported-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: (promise raid) cleanup code
Karel Zak [Tue, 22 Sep 2015 09:14:31 +0000 (11:14 +0200)] 
libblkid: (promise raid) cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: fix partition move/resize code
Karel Zak [Thu, 17 Sep 2015 10:27:58 +0000 (12:27 +0200)] 
libfdisk: fix partition move/resize code

- verify that the new partition fits to the area if the size of the
  has not been modified
- fix remaining space calculation (yes, brown-paper-bag bug..)
- offer also space before first partition as free space

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: add more debug message to resize code
Karel Zak [Thu, 17 Sep 2015 10:04:23 +0000 (12:04 +0200)] 
libfdisk: add more debug message to resize code

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agofdisk: fix -N internal return code
Karel Zak [Mon, 2 Nov 2015 09:12:00 +0000 (10:12 +0100)] 
fdisk: fix -N internal return code

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibfdisk: (gpt) control ranges in set_partition
Karel Zak [Thu, 17 Sep 2015 09:44:08 +0000 (11:44 +0200)] 
libfdisk: (gpt) control ranges in set_partition

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoipcs: fix ipc_sem_get_limits()
Karel Zak [Tue, 15 Sep 2015 07:50:08 +0000 (09:50 +0200)] 
ipcs: fix ipc_sem_get_limits()

Reported-by: https://github.com/AndrewIrcha
Addresses: https://github.com/karelzak/util-linux/commit/e5995acda2d3d55ba4d926741ddd789c9776f1e7#commitcomment-13200369
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: (monitor) remove unnecessary epoll EPOLLPRI
Karel Zak [Fri, 11 Sep 2015 09:37:49 +0000 (11:37 +0200)] 
libmount: (monitor) remove unnecessary epoll EPOLLPRI

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: (monitor) don't check for regular mtab
Karel Zak [Fri, 11 Sep 2015 09:19:30 +0000 (11:19 +0200)] 
libmount: (monitor) don't check for regular mtab

The monitor supports utab only (as documented). It's application
responsibility to use libmount in the right way. It's overkill to
check for valid environment during monitor initialization.

For example systemd checks for regular mtab during boot, it's better
than try to be smart later in libmount monitor when system is already
running.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: release++ (v2.27) v2.27
Karel Zak [Mon, 7 Sep 2015 07:55:19 +0000 (09:55 +0200)] 
build-sys: release++ (v2.27)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update v2.27-ReleaseNotes
Karel Zak [Mon, 7 Sep 2015 07:53:37 +0000 (09:53 +0200)] 
docs: update v2.27-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update AUTHORS file
Karel Zak [Mon, 7 Sep 2015 07:50:08 +0000 (09:50 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: merge changes
Karel Zak [Mon, 7 Sep 2015 07:47:51 +0000 (09:47 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update uk.po (from translationproject.org)

9 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update pl.po (from translationproject.org)

9 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Mon, 7 Sep 2015 07:42:15 +0000 (09:42 +0200)] 
po: update ja.po (from translationproject.org)

9 years agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Mon, 7 Sep 2015 07:42:14 +0000 (09:42 +0200)] 
po: update es.po (from translationproject.org)

9 years agologger: improve logger --journald man page example
Michal Schmidt [Thu, 3 Sep 2015 11:41:19 +0000 (13:41 +0200)] 
logger: improve logger --journald man page example

The example use of logger --journald in the man page has a couple of flaws:
 - It's missing a "MESSAGE=" field. This is supposed to be the primary
   human readable text. Without it the log entry is invisible in a
   plain "journalctl" output.
 - The MESSAGE_ID is supposed to be a 128-bit hexadecimal string that
   globally uniquely identifies the message type.
   One can generate such an id with "journalctl --new-id".

This patches fixes the above and also changes the example to use a
here-document instead of printf. In my opinion it makes the expected
multi-line data format more obvious.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
9 years agohwclock: fix format warning in alpha code
Andreas Henriksson [Mon, 7 Sep 2015 06:50:39 +0000 (08:50 +0200)] 
hwclock: fix format warning in alpha code

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agoMerge branch 'build-sys' of https://github.com/kolyshkin/util-linux
Karel Zak [Fri, 4 Sep 2015 08:07:28 +0000 (10:07 +0200)] 
Merge branch 'build-sys' of https://github.com/kolyshkin/util-linux

* 'build-sys' of https://github.com/kolyshkin/util-linux:
  build-sys: allow gettext 0.17 to be used
  build-sys: allow autoconf < 2.64 to be used

9 years agolibmount: typo fixes
Kir Kolyshkin [Thu, 3 Sep 2015 00:48:56 +0000 (17:48 -0700)] 
libmount: typo fixes

I was reading the code and found these mountinfo typos.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agobuild-sys: allow gettext 0.17 to be used
Kir Kolyshkin [Thu, 3 Sep 2015 01:20:22 +0000 (18:20 -0700)] 
build-sys: allow gettext 0.17 to be used

The requirement for gettext 0.18 was introduced by commit e3e16717
to pass --no-wrap option to msgmerge tool, which I guess improves
the process of updating po files for translators. At the same time,
unfortunately, it makes building from git fail on a RHEL/CentOS 6
system, as it comes with gettext 0.17.

Use the existing hack in autogen.sh to allow building with gettext 0.17,
with an appropriate warning so that the user is aware:

 warning: forcing autopoint to use old gettext 0.17

The only negative side effect of this patch I am aware of is
if gettext-0.17 is used, then --no-wrap is not being passed
to msgmerge (although msgmerge 1.17 already supports it), because
Makefile.in.in that comes with gettext 0.17 doesn't have MSGMERGE_OPTIONS.
From my POV, this is way better than to not being able to build.

NOTE if gettext 0.18.3 is installed, it is used and this patch
doesn't change anything; it only allows gettext 1.17 to be used
if this is all we have.

Cc: Benno Schulenberg <bensberg@justemail.net>
Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agobuild-sys: allow autoconf < 2.64 to be used
Kir Kolyshkin [Thu, 3 Sep 2015 00:50:15 +0000 (17:50 -0700)] 
build-sys: allow autoconf < 2.64 to be used

Since commit 50d096a macro m4_ifblank is used, but as it is only
available in autoconf-2.64, on CentOS 6 system we end up with:

> $ ./autogen.sh
> configure:25396: error: possibly undefined macro: m4_ifblank
>       If this token and others are legitimate, please use
> m4_pattern_allow.
>       See the Autoconf documentation.
> [root@kir-ovz2 util-linux]# autoconf --version
> autoconf (GNU Autoconf) 2.63

So, the obvious thing to do would be to raise AC_PREREQ to 2.64
in configure.ac. But, given the facts that
 - autoconf 2.64 is not available for RHEL/CentOS 6,
 - the only need is one small macro,
it's better to just add the missing macro.

While at it, add the m4_ifnblank, too.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 years agolibfdisk: (gpt) reorder only when necessary
Karel Zak [Wed, 2 Sep 2015 12:43:58 +0000 (14:43 +0200)] 
libfdisk: (gpt) reorder only when necessary

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomount: remove XFS from man page, xfsprogs provides xfs(5)
Karel Zak [Wed, 2 Sep 2015 08:56:24 +0000 (10:56 +0200)] 
mount: remove XFS from man page, xfsprogs provides xfs(5)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolscpu: fix read_hypervisor_powerpc() logic
Karel Zak [Tue, 1 Sep 2015 10:37:18 +0000 (12:37 +0200)] 
lscpu: fix read_hypervisor_powerpc() logic

We care about /proc/device-tree/compatible content...

The patch also removes unnecessary path_exist(), it seems good enough
to call open() rather than access() + open().

Addresses: https://github.com/karelzak/util-linux/issues/218
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: (blkid) update drbdmanage
Karel Zak [Mon, 31 Aug 2015 12:10:24 +0000 (14:10 +0200)] 
tests: (blkid) update drbdmanage

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (bsd) add note about non-written parental MBR
Karel Zak [Mon, 31 Aug 2015 11:24:33 +0000 (13:24 +0200)] 
libfdisk: (bsd) add note about non-written parental MBR

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: use 'VERSION' rather than 'PERSISTENCE_VERSION'
Karel Zak [Mon, 31 Aug 2015 11:23:55 +0000 (13:23 +0200)] 
libblkid: use 'VERSION' rather than 'PERSISTENCE_VERSION'

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: (drbdmanage) improve version setting code
Karel Zak [Mon, 31 Aug 2015 09:49:45 +0000 (11:49 +0200)] 
libblkid: (drbdmanage) improve version setting code

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: fix compiler warning [-Wdiscarded-qualifiers]
Karel Zak [Mon, 31 Aug 2015 09:38:58 +0000 (11:38 +0200)] 
libmount: fix compiler warning [-Wdiscarded-qualifiers]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologin: replace siginterrupt with sigaction
Chen Qi [Mon, 31 Aug 2015 08:23:46 +0000 (16:23 +0800)] 
login: replace siginterrupt with sigaction

[kzak@redhat.com: - POSIX.1-2008 marks siginterrupt() as obsolete]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9 years agobuild-sys: include errno.h instead of argp.h
Chen Qi [Mon, 31 Aug 2015 08:23:45 +0000 (16:23 +0800)] 
build-sys: include errno.h instead of argp.h

configure should include errno.h instead of argp.h when
checking for presence of program_invocation_short_name
uclibc defines this to be const char* unlike util-linux-ng
which defines this to be char* so this error goes unnoticed
on glibc/eglibc systems.

here is the error it fixes

in file included from mountP.h:14:0,
                 from cache.c:29:
/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'
../../../include/c.h:118:14: note: previous declaration of '__progname' was here
make[3]: *** [cache.lo] Error 1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
9 years agotests: (cal) update US week numbers
Karel Zak [Mon, 31 Aug 2015 08:46:56 +0000 (10:46 +0200)] 
tests: (cal) update US week numbers

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocal: check biggest week number correctly when highlighting
Sami Kerola [Thu, 27 Aug 2015 13:21:29 +0000 (14:21 +0100)] 
cal: check biggest week number correctly when highlighting

This allows Sunday based week 54 be highlighted, and deny week 54 for
Monday based weeks when year has only 52 weeks.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocal: replace magic constants with symbolical values
Sami Kerola [Thu, 27 Aug 2015 13:21:28 +0000 (14:21 +0100)] 
cal: replace magic constants with symbolical values

This makes it easier to know what the values in guestion represent.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocal: correct gregorian week numbering
Sami Kerola [Thu, 27 Aug 2015 13:21:26 +0000 (14:21 +0100)] 
cal: correct gregorian week numbering

Jan 1 is always First week, and year always has 53 weeks.  The week 53
may be cut short, e.g., it may and often has fewer than 7 days.  Every
year 28 year intervals US week numbering continues all the way to 54th
week, such as 1972, 2000, and 2028.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249486
Reported-by: Michal Toth
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agolib/sysfs: make sysfs_next_subsystem() more robust
Karel Zak [Mon, 31 Aug 2015 08:11:01 +0000 (10:11 +0200)] 
lib/sysfs: make sysfs_next_subsystem() more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsblk: fix resource leak [coverity scan]
Andreas Henriksson [Tue, 25 Aug 2015 16:27:41 +0000 (18:27 +0200)] 
lsblk: fix resource leak [coverity scan]

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agolib/strutil: fix parse_switch resource leak [coverity scan]
Andreas Henriksson [Tue, 25 Aug 2015 16:27:40 +0000 (18:27 +0200)] 
lib/strutil: fix parse_switch resource leak [coverity scan]

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agoMerge branch 'escaped-test' of https://github.com/kees/util-linux
Karel Zak [Fri, 28 Aug 2015 08:13:42 +0000 (10:13 +0200)] 
Merge branch 'escaped-test' of https://github.com/kees/util-linux

* 'escaped-test' of https://github.com/kees/util-linux:
  tests: add very long mount line to libmount mtab

9 years agodocs: fix typo
Karel Zak [Thu, 27 Aug 2015 21:07:15 +0000 (23:07 +0200)] 
docs: fix typo

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add very long mount line to libmount mtab
Kees Cook [Wed, 26 Aug 2015 21:39:21 +0000 (14:39 -0700)] 
tests: add very long mount line to libmount mtab

Very long mount lines from the kernel (either from escaping or from giant
option lists) could exceed BUFSIZ, leading to parsing failures. This
adds a test for the condition.

Signed-off-by: Kees Cook <keescook@chromium.org>
9 years agodocs: add notest about drone.io and travis-ci
Karel Zak [Thu, 27 Aug 2015 14:04:42 +0000 (16:04 +0200)] 
docs: add notest about drone.io and travis-ci

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: (drbdmanage) add magic strings array terminator
Karel Zak [Thu, 27 Aug 2015 09:07:39 +0000 (11:07 +0200)] 
libblkid: (drbdmanage) add magic strings array terminator

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: handle arbitrary line length for mounts
Karel Zak [Thu, 27 Aug 2015 08:49:39 +0000 (10:49 +0200)] 
libmount: handle arbitrary line length for mounts

Based on patch from Kees Cook, he wrote:
> The kernel's maximum path length is PATH_MAX (4096). The use of BUFSIZ
> (8192) would seem sufficient for reading mountinfo files, but it's
> not. Paths may contain escaped characters (requiring 4x as many bytes
> to read), and filesystem options are of unknown length. To avoid
> mounts being either intentionally or unintentionally hidden from
> libmount and its users, we must accept arbitrary length lines when
> parsing.
>
> Long valid entries are currently ignored, with warnings like this:
> mount: /proc/self/mountinfo: parse error: ignore entry at line 11.
> mount: /proc/self/mountinfo: parse error: ignore entry at line 12.
>
> Instead of using a malloc on every line parsed from mount files, do it
> once per mount file context, growing it as needed. The general case
> will never grow it.

I have moved the parser stuff to the new struct libmnt_parser, maybe
we can move more things (e.g. libmnt_table->fmt) to this struct later.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'master' of https://github.com/yurchor/util-linux
Karel Zak [Wed, 26 Aug 2015 08:52:49 +0000 (10:52 +0200)] 
Merge branch 'master' of https://github.com/yurchor/util-linux

* 'master' of https://github.com/yurchor/util-linux:
  Fix trivial typos

9 years agoFix trivial typos
Yuri Chornoivan [Tue, 25 Aug 2015 17:02:53 +0000 (20:02 +0300)] 
Fix trivial typos

9 years agodmesg: highlight -T issues in docs
Karel Zak [Tue, 25 Aug 2015 13:43:03 +0000 (15:43 +0200)] 
dmesg: highlight -T issues in docs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofallocate: fix error message
Karel Zak [Tue, 25 Aug 2015 13:34:09 +0000 (15:34 +0200)] 
fallocate: fix error message

FALLOC_FL_KEEP_SIZE flag is generic and used in many situations,
"-n" in the error message does not make sense.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1146152
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: release++ (v2.27-rc2) v2.27-rc2
Karel Zak [Mon, 24 Aug 2015 10:38:48 +0000 (12:38 +0200)] 
build-sys: release++ (v2.27-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update v2.27-ReleaseNotes
Karel Zak [Mon, 24 Aug 2015 10:37:13 +0000 (12:37 +0200)] 
docs: update v2.27-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update AUTHORS file
Karel Zak [Mon, 24 Aug 2015 10:33:52 +0000 (12:33 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: merge changes
Karel Zak [Mon, 24 Aug 2015 10:27:54 +0000 (12:27 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Mon, 24 Aug 2015 10:23:20 +0000 (12:23 +0200)] 
po: update ja.po (from translationproject.org)

9 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Mon, 24 Aug 2015 10:23:20 +0000 (12:23 +0200)] 
po: update fi.po (from translationproject.org)

9 years agotests: update static build test
Karel Zak [Mon, 24 Aug 2015 10:17:35 +0000 (12:17 +0200)] 
tests: update static build test

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: add hint about chfn & chsh bug and thanks to qualys
Karel Zak [Mon, 24 Aug 2015 09:40:19 +0000 (11:40 +0200)] 
docs: add hint about chfn & chsh bug and thanks to qualys

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: added drbdmanage control volume detection.
Philipp Marek [Tue, 18 Aug 2015 12:07:49 +0000 (14:07 +0200)] 
libblkid: added drbdmanage control volume detection.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agohwclock: fix iopl implicit declaration warning on alpha
Andreas Henriksson [Fri, 21 Aug 2015 14:13:29 +0000 (16:13 +0200)] 
hwclock: fix iopl implicit declaration warning on alpha

Build warning:
sys-utils/hwclock-cmos.c: In function 'i386_iopl':
sys-utils/hwclock-cmos.c:611:9: warning: implicit declaration of function 'iopl' [-Wimplicit-function-declaration]
  return iopl(level);
         ^
sys-utils/hwclock-cmos.c:611:2: warning: nested extern declaration of 'iopl' [-Wnested-externs]
  return iopl(level);
  ^

Also:
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

Please note that this has never been (build-)tested, but should hopefully
resolve the warning.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agohwclock: fix fgets unchecked return value warning on alpha
Andreas Henriksson [Fri, 21 Aug 2015 14:13:28 +0000 (16:13 +0200)] 
hwclock: fix fgets unchecked return value warning on alpha

Build warning:
sys-utils/hwclock-cmos.c: In function 'is_in_cpuinfo':
sys-utils/hwclock-cmos.c:162:4: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
    fgets(field, 256, cpuinfo);

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

This change has never actually been (build-)tested on alpha, but
hopefully the change should fix the warning.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agohwclock: fix signed/unsigned comparison warning on alpha
Andreas Henriksson [Fri, 21 Aug 2015 14:13:27 +0000 (16:13 +0200)] 
hwclock: fix signed/unsigned comparison warning on alpha

Fixes the following warning:
sys-utils/hwclock.c: In function 'manipulate_epoch':
sys-utils/hwclock.c:1465:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (epoch_opt == -1)

Full build log available on:
https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.26.2-9&stamp=1440078034

Detected by/via:
https://qa.debian.org/bls/packages/u/util-linux.html

Please note that this has never actually been (build-)tested on alpha,
but should hopefully resolve the warning. Note also that limits.h is
already included.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
9 years agomisc: fix shadow declarations
Sami Kerola [Mon, 17 Aug 2015 17:44:28 +0000 (18:44 +0100)] 
misc: fix shadow declarations

sys-utils/zramctl.c: In function 'get_mm_stat':
sys-utils/zramctl.c:276:58: warning: declaration of 'inbytes' shadows a global declaration [-Wshadow]
 static char *get_mm_stat(struct zram *z, size_t idx, int inbytes)
sys-utils/zramctl.c:119:39: note: shadowed declaration is here
 static unsigned int raw, no_headings, inbytes;

libmount/src/tab.c: In function 'mnt_table_get_fs_root':
libmount/src/tab.c:1221:22: warning: declaration of 'fs' shadows a parameter [-Wshadow]
    struct libmnt_fs *fs = mnt_table_find_mountpoint(tb,
libmount/src/tab.c:1197:24: note: shadowed declaration is here
      struct libmnt_fs *fs,

disk-utils/fsck.minix.c: In function 'main':
disk-utils/fsck.minix.c:1364:17: warning: declaration of 'i' shadows a previous local [-Wshadow]
   unsigned long i, free;
disk-utils/fsck.minix.c:1250:6: note: shadowed declaration is here
  int i;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agochfn: document CHFN_RESTRICT /etc/login.defs
Karel Zak [Mon, 24 Aug 2015 08:46:48 +0000 (10:46 +0200)] 
chfn: document CHFN_RESTRICT /etc/login.defs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agochsh, chfn, vipw: fix filenames collision
Karel Zak [Mon, 24 Aug 2015 08:05:55 +0000 (10:05 +0200)] 
chsh, chfn, vipw: fix filenames collision

The utils when compiled WITHOUT libuser then mkostemp()ing
"/etc/%s.XXXXXX" where the filename prefix is argv[0] basename.

An attacker could repeatedly execute the util with modified argv[0]
and after many many attempts mkostemp() may generate suffix which
makes sense. The result maybe temporary file with name like rc.status
ld.so.preload or krb5.keytab, etc.

Note that distros usually use libuser based ch{sh,fn} or stuff from
shadow-utils.

It's probably very minor security bug.

Addresses: CVE-2015-5224
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add blkid script to test whole-disk MBR devices
Karel Zak [Fri, 21 Aug 2015 09:51:49 +0000 (11:51 +0200)] 
tests: add blkid script to test whole-disk MBR devices

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: (monitor) fix docs
Karel Zak [Wed, 19 Aug 2015 13:27:20 +0000 (15:27 +0200)] 
libmount: (monitor) fix docs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update TODO
Karel Zak [Wed, 19 Aug 2015 13:27:02 +0000 (15:27 +0200)] 
docs: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'master' of https://github.com/FGrose/util-linux
Karel Zak [Mon, 17 Aug 2015 10:12:28 +0000 (12:12 +0200)] 
Merge branch 'master' of https://github.com/FGrose/util-linux

* 'master' of https://github.com/FGrose/util-linux:
  Fix typos in --target

9 years agolibmount: add support for "bind,ro"
Karel Zak [Mon, 17 Aug 2015 09:54:26 +0000 (11:54 +0200)] 
libmount: add support for "bind,ro"

Now it's necessary t use two mount(8) calls to create a read-only
mount:

  mount /foo /bar -o bind
  mount /bar -o remount,ro,bind

This patch allows to specify "bind,ro" and the remount is done
automatically by libmount by additional mount(2) syscall. It's not
atomic of course.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoFix typos in --target
Frederick Grose [Fri, 14 Aug 2015 13:37:07 +0000 (09:37 -0400)] 
Fix typos in --target

9 years agodocs: add lsblk vs. btrfs to TODO
Karel Zak [Thu, 13 Aug 2015 09:49:20 +0000 (11:49 +0200)] 
docs: add lsblk vs. btrfs to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: add mount --namespace to TODO
Karel Zak [Thu, 13 Aug 2015 09:41:49 +0000 (11:41 +0200)] 
docs: add mount --namespace to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoMerge branch 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Wed, 12 Aug 2015 20:53:47 +0000 (22:53 +0200)] 
Merge branch 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit

* 'colcrt' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add colcrt regression tests
  colcrt: allocate enough space for data moves [afl & asan]
  colcrt: avoid writing beyond array bound [afl & asan]
  colcrt: use #define in place of magic constants
  misc: fix redundant assignment and reassignments before use [cppcheck]
  tools: stop checkmans.sh validating libtool builds

9 years agoMerge branch 'patch-1' of https://github.com/borutmrak/util-linux
Karel Zak [Wed, 12 Aug 2015 09:09:04 +0000 (11:09 +0200)] 
Merge branch 'patch-1' of https://github.com/borutmrak/util-linux

* 'patch-1' of https://github.com/borutmrak/util-linux:
  mount.8: also note diratime does not override noatime.
  mount.8: Clarify relation between noatime and nodiratime

9 years agolsipc: add more resource to the limits list
Karel Zak [Wed, 12 Aug 2015 08:21:48 +0000 (10:21 +0200)] 
lsipc: add more resource to the limits list

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomount.8: also note diratime does not override noatime.
Borut Mrak [Tue, 11 Aug 2015 01:00:29 +0000 (03:00 +0200)] 
mount.8: also note diratime does not override noatime.

9 years agomount.8: Clarify relation between noatime and nodiratime
Borut Mrak [Tue, 11 Aug 2015 00:51:36 +0000 (02:51 +0200)] 
mount.8: Clarify relation between noatime and nodiratime

According to https://lwn.net/Articles/245002/ and checking Linus' git master fs/inode.c it's obvious nodiratime is redundant when mounting with noatime. Clarify that in the man page.

9 years agotests: add colcrt regression tests
Sami Kerola [Mon, 10 Aug 2015 21:12:03 +0000 (22:12 +0100)] 
tests: add colcrt regression tests

Thanks to Alaa Mubaied for providing crash1 input file making colcrt to
crash.  The crash2 was generated using American Fuzzy Lop.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocolcrt: allocate enough space for data moves [afl & asan]
Sami Kerola [Sun, 9 Aug 2015 17:02:18 +0000 (18:02 +0100)] 
colcrt: allocate enough space for data moves [afl & asan]

==2807==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000013a31f0 at pc 0x0000004e3047 bp 0x7fffcb7df8d0 sp 0x7fffcb7df8c8
READ of size 4 at 0x0000013a31f0 thread T0
    #0 0x4e3046 in move /home/src/util-linux/text-utils/colcrt.c:309:13
    #1 0x4e25b1 in pflush /home/src/util-linux/text-utils/colcrt.c:264:3
    #2 0x4e246d in colcrt /home/src/util-linux/text-utils/colcrt.c:157:4
    #3 0x4e17d4 in main /home/src/util-linux/text-utils/colcrt.c:141:3
    #4 0x7fb0cb2ee60f in __libc_start_main (/usr/lib/libc.so.6+0x2060f)
    #5 0x4362c8 in _start (/home/src/util-linux/colcrt+0x4362c8)

0x0000013a31f0 is located 0 bytes to the right of global variable 'page' defined in 'text-utils/colcrt.c:73:9' (0x1380b40) of size 140976
SUMMARY: AddressSanitizer: global-buffer-overflow /home/src/util-linux/text-utils/colcrt.c:309 move

And another crash:

==4578==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000013a3d24 at pc 0x0000004e2510 bp 0x7ffc9257b0e0 sp 0x7ffc9257b0d8
READ of size 4 at 0x0000013a3d24 thread T0
    #0 0x4e250f in colcrt /home/src/util-linux/text-utils/colcrt.c:218:8
    #1 0x4e17d4 in main /home/src/util-linux/text-utils/colcrt.c:141:3
    #2 0x7fe0ac94160f in __libc_start_main (/usr/lib/libc.so.6+0x2060f)
    #3 0x4362c8 in _start (/home/src/util-linux/colcrt+0x4362c8)

0x0000013a3d24 is located 8 bytes to the right of global variable 'page' defined in 'text-utils/colcrt.c:73:9' (0x1381240) of size 142044
SUMMARY: AddressSanitizer: global-buffer-overflow /home/src/util-linux/text-utils/colcrt.c:218 colcrt

Reported-by: Alaa Mubaied <alaamubaied@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocolcrt: avoid writing beyond array bound [afl & asan]
Sami Kerola [Sun, 9 Aug 2015 17:16:34 +0000 (18:16 +0100)] 
colcrt: avoid writing beyond array bound [afl & asan]

text-utils/colcrt.c:205:10: runtime error: index -1 out of bounds for type 'wchar_t [133]'
SUMMARY: AddressSanitizer: undefined-behavior text-utils/colcrt.c:205
=================================================================
==2357==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000013811b0 at pc 0x0000004e2514 bp 0x7ffdf6ba4450 sp 0x7ffdf6ba4448
READ of size 4 at 0x0000013811b0 thread T0
    #0 0x4e2513 in colcrt /home/src/util-linux/text-utils/colcrt.c:213:8
    #1 0x4e17d4 in main /home/src/util-linux/text-utils/colcrt.c:139:3
    #2 0x7fb77236960f in __libc_start_main (/usr/lib/libc.so.6+0x2060f)
    #3 0x4362c8 in _start (/home/src/util-linux/colcrt+0x4362c8)

Reported-by: Alaa Mubaied <alaamubaied@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agocolcrt: use #define in place of magic constants
Sami Kerola [Sun, 9 Aug 2015 16:50:41 +0000 (17:50 +0100)] 
colcrt: use #define in place of magic constants

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomisc: fix redundant assignment and reassignments before use [cppcheck]
Sami Kerola [Tue, 4 Aug 2015 21:46:26 +0000 (22:46 +0100)] 
misc: fix redundant assignment and reassignments before use [cppcheck]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotools: stop checkmans.sh validating libtool builds
Sami Kerola [Tue, 4 Aug 2015 20:36:05 +0000 (21:36 +0100)] 
tools: stop checkmans.sh validating libtool builds

The checkmans.sh tried to validate shared libraries, such as
./.libs/libsmartcols.so.1, causing the check output to a have
lot of pointless garbage.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agolibmount: fix typo in mnt_optstr_prepend_option()
Karel Zak [Wed, 5 Aug 2015 11:39:06 +0000 (13:39 +0200)] 
libmount: fix typo in mnt_optstr_prepend_option()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agologger: improve readability [smatch scan]
Karel Zak [Wed, 5 Aug 2015 11:23:34 +0000 (13:23 +0200)] 
logger: improve readability [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomisc: fix indention [smatch scan]
Karel Zak [Wed, 5 Aug 2015 11:22:05 +0000 (13:22 +0200)] 
misc: fix indention [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotools: add hexdump badconv() to noreturn smatch list
Karel Zak [Wed, 5 Aug 2015 11:18:40 +0000 (13:18 +0200)] 
tools: add hexdump badconv() to noreturn smatch list

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomore: improve ugly macro
Karel Zak [Wed, 5 Aug 2015 11:09:12 +0000 (13:09 +0200)] 
more: improve ugly macro

no comment, just F*CK YOU to the original author of this crap...

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: (gpt) fix label pointer usage [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:59:16 +0000 (12:59 +0200)] 
libfdisk: (gpt) fix label pointer usage [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: remove impossible condition [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:55:30 +0000 (12:55 +0200)] 
libfdisk: remove impossible condition [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: make context->label usage more robust [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:53:03 +0000 (12:53 +0200)] 
libfdisk: make context->label usage more robust [smatch scan]

9 years agolibblkid: fix inconsistent indenting [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:48:54 +0000 (12:48 +0200)] 
libblkid: fix inconsistent indenting [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: variable dereferenced before check [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:46:56 +0000 (12:46 +0200)] 
libmount: variable dereferenced before check [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocfdisk, sfdisk: remove unused variables
Karel Zak [Wed, 5 Aug 2015 10:41:46 +0000 (12:41 +0200)] 
cfdisk, sfdisk: remove unused variables

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotools: add err_oom() to smatch no_return_funcs
Karel Zak [Wed, 5 Aug 2015 10:41:17 +0000 (12:41 +0200)] 
tools: add err_oom() to smatch no_return_funcs

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolib/blkdev: use 64-bit to count size in bytes
Karel Zak [Wed, 5 Aug 2015 10:40:35 +0000 (12:40 +0200)] 
lib/blkdev: use 64-bit to count size in bytes

Signed-off-by: Karel Zak <kzak@redhat.com>