Commit Graph

9803 Commits

Author SHA1 Message Date
Karel Zak dd49c7d6d6 libfdisk: (gpt) reorder only when necessary
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-02 14:51:00 +02:00
Karel Zak 2eca78be47 mount: remove XFS from man page, xfsprogs provides xfs(5)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-02 10:56:24 +02:00
Karel Zak e03b613e8d 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>
2015-09-01 12:37:18 +02:00
Karel Zak bc8ec36f62 tests: (blkid) update drbdmanage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 14:10:24 +02:00
Karel Zak 5cea5be05f libfdisk: (bsd) add note about non-written parental MBR
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 13:24:33 +02:00
Karel Zak 7caa6b37be libblkid: use 'VERSION' rather than 'PERSISTENCE_VERSION'
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 13:23:55 +02:00
Karel Zak 7430affdd9 libblkid: (drbdmanage) improve version setting code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 11:49:45 +02:00
Karel Zak 928f209cea libmount: fix compiler warning [-Wdiscarded-qualifiers]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 11:38:58 +02:00
Chen Qi 1b76608ef8 login: replace siginterrupt with sigaction
[kzak@redhat.com: - POSIX.1-2008 marks siginterrupt() as obsolete]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2015-08-31 11:34:36 +02:00
Chen Qi 37edac9a0c 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>
2015-08-31 11:27:45 +02:00
Karel Zak 9ad7c4c8ed tests: (cal) update US week numbers
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 10:46:56 +02:00
Sami Kerola 03f8bc1f32 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>
2015-08-31 10:15:12 +02:00
Sami Kerola e1abe57e18 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>
2015-08-31 10:15:11 +02:00
Sami Kerola efafeaf684 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>
2015-08-31 10:15:09 +02:00
Karel Zak 32c9ce4baf lib/sysfs: make sysfs_next_subsystem() more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 10:11:01 +02:00
Andreas Henriksson 56e78cb532 lsblk: fix resource leak [coverity scan]
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-31 10:09:45 +02:00
Andreas Henriksson 74819b5f64 lib/strutil: fix parse_switch resource leak [coverity scan]
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-31 10:09:43 +02:00
Karel Zak 9c9ebb988e 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
2015-08-28 10:13:42 +02:00
Karel Zak 268a62bf38 docs: fix typo
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-27 23:07:15 +02:00
Kees Cook 930f9ea0d8 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>
2015-08-27 10:05:19 -07:00
Karel Zak eac8f358b7 docs: add notest about drone.io and travis-ci
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-27 16:04:42 +02:00
Karel Zak 1198e39051 libblkid: (drbdmanage) add magic strings array terminator
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-27 11:07:39 +02:00
Karel Zak d92b8c3ba1 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>
2015-08-27 10:49:39 +02:00
Karel Zak 0a9e11af22 Merge branch 'master' of https://github.com/yurchor/util-linux
* 'master' of https://github.com/yurchor/util-linux:
  Fix trivial typos
2015-08-26 10:52:49 +02:00
Yuri Chornoivan 75a8e726e9 Fix trivial typos 2015-08-25 20:02:53 +03:00
Karel Zak 3a131296d1 dmesg: highlight -T issues in docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-25 15:43:03 +02:00
Karel Zak 049bfa066c 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>
2015-08-25 15:34:09 +02:00
Karel Zak 0e58e16936 build-sys: release++ (v2.27-rc2)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 12:38:48 +02:00
Karel Zak 5a2fee2def docs: update v2.27-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 12:37:13 +02:00
Karel Zak 8e79900b7f docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 12:33:52 +02:00
Karel Zak 540afa68ec po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 12:27:54 +02:00
Takeshi Hamasaki 8164f783f2 po: update ja.po (from translationproject.org) 2015-08-24 12:23:20 +02:00
Lauri Nurmi 4f0fec5898 po: update fi.po (from translationproject.org) 2015-08-24 12:23:20 +02:00
Karel Zak 2a908d5e43 tests: update static build test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 12:17:35 +02:00
Karel Zak 6fe71fc2e8 docs: add hint about chfn & chsh bug and thanks to qualys
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 11:40:19 +02:00
Philipp Marek 2dc8cfb9a8 libblkid: added drbdmanage control volume detection.
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 11:01:34 +02:00
Andreas Henriksson 3baf5ac739 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>
2015-08-24 10:55:44 +02:00
Andreas Henriksson ec3d3e67d9 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>
2015-08-24 10:55:41 +02:00
Andreas Henriksson 88294abaf9 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>
2015-08-24 10:55:39 +02:00
Sami Kerola 624e147ba2 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>
2015-08-24 10:55:37 +02:00
Karel Zak 3e16df1558 chfn: document CHFN_RESTRICT /etc/login.defs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-24 10:46:48 +02:00
Karel Zak bde91c85bd 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>
2015-08-24 10:05:55 +02:00
Karel Zak 3db75b1a8e tests: add blkid script to test whole-disk MBR devices
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-21 11:51:49 +02:00
Karel Zak d9579859c2 libmount: (monitor) fix docs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-19 15:27:20 +02:00
Karel Zak ac09539c69 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-19 15:27:02 +02:00
Karel Zak 992ec00039 Merge branch 'master' of https://github.com/FGrose/util-linux
* 'master' of https://github.com/FGrose/util-linux:
  Fix typos in --target
2015-08-17 12:12:28 +02:00
Karel Zak 9ac77b8a78 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>
2015-08-17 11:54:26 +02:00
Frederick Grose 8fef799d8b Fix typos in --target 2015-08-14 09:37:07 -04:00
Karel Zak 5b7be9900a docs: add lsblk vs. btrfs to TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-13 11:49:20 +02:00
Karel Zak f19c632804 docs: add mount --namespace to TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-13 11:41:49 +02:00