]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
8 years agobuild-sys: release++ (v2.27.1) stable/v2.27 v2.27.1
Karel Zak [Mon, 2 Nov 2015 10:38:45 +0000 (11:38 +0100)] 
build-sys: release++ (v2.27.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update v2.27.1-ReleaseNotes
Karel Zak [Mon, 2 Nov 2015 10:37:25 +0000 (11:37 +0100)] 
docs: update v2.27.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agodocs: update AUTHORS file
Karel Zak [Mon, 2 Nov 2015 10:35:41 +0000 (11:35 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: merge changes
Karel Zak [Mon, 2 Nov 2015 10:33:12 +0000 (11:33 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agopo: update zh_CN.po (from translationproject.org)
Wylmer Wang [Mon, 2 Nov 2015 10:28:31 +0000 (11:28 +0100)] 
po: update zh_CN.po (from translationproject.org)

8 years agopo: update ru.po (from translationproject.org)
Evgeniy Yakushev [Mon, 2 Nov 2015 10:28:31 +0000 (11:28 +0100)] 
po: update ru.po (from translationproject.org)

8 years agopo: update pt_BR.po (from translationproject.org)
Rafael Ferreira [Mon, 2 Nov 2015 10:28:31 +0000 (11:28 +0100)] 
po: update pt_BR.po (from translationproject.org)

8 years agopo: update de.po (from translationproject.org)
Philipp Thomas [Mon, 2 Nov 2015 10:28:31 +0000 (11:28 +0100)] 
po: update de.po (from translationproject.org)

8 years agopo: update cs.po (from translationproject.org)
Petr Písař [Mon, 2 Nov 2015 10:28:31 +0000 (11:28 +0100)] 
po: update cs.po (from translationproject.org)

8 years agolib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust
Karel Zak [Fri, 30 Oct 2015 10:08:32 +0000 (11:08 +0100)] 
lib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust

Now the function uses result buffer for internal stuff (readlink), so
it requires that the buffer is large enough. This is unexpected as
caller assumes that the buffer has to be large enough for devname only.

References: http://www.spinics.net/lists/util-linux-ng/msg12015.html
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoscript: be pedantic and use "%"SCNi64
Karel Zak [Fri, 16 Oct 2015 09:48:47 +0000 (11:48 +0200)] 
script: be pedantic and use "%"SCNi64

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoscript: don't assume that time_t is compatible with long
Isaac Dunham [Fri, 16 Oct 2015 01:12:59 +0000 (18:12 -0700)] 
script: don't assume that time_t is compatible with long

time_t may change to 64-bit on 32-bit Linux kernels at some point;
at that point, it may be desireable to test for issues with dates
past 2038.

[kzak@redhat.com: - use %jd rather than %lld]

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: follow docs with parse-error callback return code
Karel Zak [Thu, 15 Oct 2015 10:12:11 +0000 (12:12 +0200)] 
libmount: follow docs with parse-error callback return code

The docs says that recoverable errors have rc > 0.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agomount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines
Karel Zak [Thu, 15 Oct 2015 09:53:44 +0000 (11:53 +0200)] 
mount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines

The libmount provides way how to deal with parsing errors in fstab --
on error callback function is executed and according to the return
libmount manipulate with the malformed line, possible are three
states:

  1/ fatal error; all file ignored              (callback rc < 0)
  2/ recoverable error; malformed line ignored  (callback rc > 0)
  3/ ignore the error                           (callback rc == 0)

The 2/ is the default if no callback specified.

Unfortunately our utils uses 3/. The correct way is to use 2/.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibblkid: make XFS Log visible for wipefs
Karel Zak [Tue, 13 Oct 2015 10:01:29 +0000 (12:01 +0200)] 
libblkid: make XFS Log visible for wipefs

Reported-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: root <root@ws.net.home>
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agolibmount: fix uid= and gid= translation
Karel Zak [Mon, 12 Oct 2015 09:42:13 +0000 (11:42 +0200)] 
libmount: fix uid= and gid= translation

The current libmount version returns error when no able to convert
username/groupname to uid/git.

 # mount mount /dev/sda1 /mnt/test -o uid=ignore
 # mount: failed to parse mount options

This is regression, the original mount(8) has ignored possible unknown
user/group names and the option has been used unconverted (with the
original value). For example UDF kernel driver depends on this behavior
and "uid=ignore" (or "forgot") is a valid mount option.

Fixed version (unit test):

./test_mount_optstr  --fix uid=kzak,gid=forgot,aaa,bbb
optstr: uid=kzak,gid=forgot,aaa,bbb
fixed:  uid=1000,gid=forgot,aaa,bbb

Reported-By: Anthony DeRobertis <anthony@derobert.net>
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801527
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agoinclude/pt-mbr-partnames: remove '|' from partition type name
Karel Zak [Fri, 9 Oct 2015 11:13:53 +0000 (13:13 +0200)] 
include/pt-mbr-partnames: remove '|' from partition type name

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agofdisk: to recognize Intel Rapid Start hibernation partition
Jörg Jenderek [Wed, 7 Oct 2015 09:41:23 +0000 (11:41 +0200)] 
fdisk: to recognize Intel Rapid Start hibernation partition

I use Intel Rapid Start Technology on my PC. According to their User Guide
"Rapid_Start_Technology_User_Guide_v1.4.pdf" I create a partition with id=84
for hibernation by this Technology.

Unfortunately the software fdisk (util-linux-2.27) classifies that partition as
"OS/2 hidden C:".  That is not wrong, but on website
https://en.wikipedia.org/wiki/Partition_type is written, that id 0x84 beside
using for hiding drive C: this type is a also used as hibernation partition for
Microsoft  APM and also for Intel Rapid Start

So I patched 2 header files so that fdisk recognize this partition type variation.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: replace username with tag in logger test
Karel Zak [Tue, 6 Oct 2015 09:06:21 +0000 (11:06 +0200)] 
tests: replace username with tag in logger test

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: add missing files
Karel Zak [Tue, 6 Oct 2015 08:46:37 +0000 (10:46 +0200)] 
tests: add missing files

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agotests: update and extend logger tests
Karel Zak [Tue, 6 Oct 2015 08:17:11 +0000 (10:17 +0200)] 
tests: update and extend logger tests

Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agologger: fix messages separation on UNIX socket
Karel Zak [Tue, 6 Oct 2015 07:16:33 +0000 (09:16 +0200)] 
logger: fix messages separation on UNIX socket

The function write_output() add additional \n after each message on
TYPE_TPC. This is required by syslog daemons, otherwise you will see
multiple log messages merged together in your log file, for example:

  Oct  6 09:01:40 ws kzak: AAA<14>Oct  6 09:01:40 kzak: BBB

for

  printf "AAA\nBBB\n" | logger -p info -u <any-socket>

Unfortunately, the connection initialization functions keep the
default ALL_TYPES as connection type and nowhere in the control struct
is info about the final real connection type. The problem is invisible
when you specify --tpc or --udp on logger command line.

Addresses: https://github.com/karelzak/util-linux/issues/225
Signed-off-by: Karel Zak <kzak@redhat.com>
8 years agouuidd: improve socket activation error messaging
Sami Kerola [Sat, 5 Sep 2015 18:56:36 +0000 (19:56 +0100)] 
uuidd: improve socket activation error messaging

Tell more exactly what is wrong and how, and give hint how to recover
when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
8 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>
8 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>
8 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>
8 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>
8 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)

8 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)

8 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)

8 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)

8 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>
8 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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

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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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)

8 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)

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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>
8 years agoFix typos in --target
Frederick Grose [Fri, 14 Aug 2015 13:37:07 +0000 (09:37 -0400)] 
Fix typos in --target

8 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>
8 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>
8 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