]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
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>
9 years agolib/timeutils: fix indention [smatch scan]
Karel Zak [Wed, 5 Aug 2015 10:39:00 +0000 (12:39 +0200)] 
lib/timeutils: fix indention [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotailf: fix open() return value check [coverity scan]
Karel Zak [Wed, 5 Aug 2015 09:55:56 +0000 (11:55 +0200)] 
tailf: fix open() return value check [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosetterm: remove dead code [coverity scan]
Karel Zak [Wed, 5 Aug 2015 09:51:04 +0000 (11:51 +0200)] 
setterm: remove dead code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agoagetty: cleanup plymouth usage [coverity scan]
Karel Zak [Wed, 5 Aug 2015 09:45:57 +0000 (11:45 +0200)] 
agetty: cleanup plymouth usage [coverity scan]

* use macros for paths
* check open() return value

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agortcwake: improve open() usage [coverity scan]
Karel Zak [Wed, 5 Aug 2015 09:32:59 +0000 (11:32 +0200)] 
rtcwake: improve open() usage [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agosfdisk: clarification for sfdisk man page
Ian Wienand [Wed, 5 Aug 2015 07:21:27 +0000 (09:21 +0200)] 
sfdisk: clarification for sfdisk man page

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249893
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsipc: cleanup usernames
Karel Zak [Tue, 4 Aug 2015 12:22:31 +0000 (14:22 +0200)] 
lsipc: cleanup usernames

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsipc: check scols_line_refer_data() return code
Karel Zak [Tue, 4 Aug 2015 12:05:33 +0000 (14:05 +0200)] 
lsipc: check scols_line_refer_data() return code

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsipc: don't duplicate already allocated data
Karel Zak [Tue, 4 Aug 2015 11:57:45 +0000 (13:57 +0200)] 
lsipc: don't duplicate already allocated data

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: add --disable-assert
Karel Zak [Tue, 4 Aug 2015 11:40:44 +0000 (13:40 +0200)] 
build-sys: add --disable-assert

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibmount: cleanup assert() usage
Karel Zak [Tue, 4 Aug 2015 11:21:42 +0000 (13:21 +0200)] 
libmount: cleanup assert() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: cleanup assert() usage
Karel Zak [Tue, 4 Aug 2015 11:03:14 +0000 (13:03 +0200)] 
libfdisk: cleanup assert() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibblkid: remove dead code [coverity scan]
Karel Zak [Tue, 4 Aug 2015 10:31:39 +0000 (12:31 +0200)] 
libblkid: remove dead code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomkfs.minix: add hint for scanners [coverity scan]
Karel Zak [Tue, 4 Aug 2015 09:42:27 +0000 (11:42 +0200)] 
mkfs.minix: add hint for scanners [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomkfs.minix: use xalloc
Karel Zak [Tue, 4 Aug 2015 09:39:49 +0000 (11:39 +0200)] 
mkfs.minix: use xalloc

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agomkfs.cramfs: remove dead code [coverity scan]
Karel Zak [Tue, 4 Aug 2015 09:26:45 +0000 (11:26 +0200)] 
mkfs.cramfs: remove dead code [coverity scan]

There two possible ways, print error and exit on too long names or
truncate the filename -- but it's impossible to do both in the same
code :-) It seems that code already assumes warning on long names, so
let's remove errx() and keep the behavior in dependence on -E.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agofsck.minix: be more paranoid with block buffers [coverity scan]
Karel Zak [Tue, 4 Aug 2015 09:15:53 +0000 (11:15 +0200)] 
fsck.minix: be more paranoid with block buffers [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agocfdisk: check return value [coverity scan]
Karel Zak [Tue, 4 Aug 2015 08:59:52 +0000 (10:59 +0200)] 
cfdisk: check return value [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsipc: ifdef SHM_* macros
Karel Zak [Mon, 3 Aug 2015 11:20:56 +0000 (13:20 +0200)] 
lsipc: ifdef SHM_* macros

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: fix minix tests filenames
Karel Zak [Mon, 3 Aug 2015 10:51:13 +0000 (12:51 +0200)] 
tests: fix minix tests filenames

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: try mkfs & mount all supported minix versions
Karel Zak [Mon, 3 Aug 2015 09:53:45 +0000 (11:53 +0200)] 
tests: try mkfs & mount all supported minix versions

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobash-completion: update few options changed since v2.26
Sami Kerola [Sun, 2 Aug 2015 20:24:08 +0000 (21:24 +0100)] 
bash-completion: update few options changed since v2.26

Attempt to find and update all changes to command line options that has
not been reflected in bash-completion files in between versions v2.26 to
v2.27-rc1.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: fix minix test
Karel Zak [Mon, 3 Aug 2015 10:31:40 +0000 (12:31 +0200)] 
tests: fix minix test

- run the test with UID=0 only. The minix FS inode contains UID and
  GID, so the final image checksum depends on user...

- always use subtest name for the images

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agotests: add fsck.minix checks
Sami Kerola [Sun, 2 Aug 2015 18:29:00 +0000 (19:29 +0100)] 
tests: add fsck.minix checks

The debian bug was fixed in commit 730ae9c89971, and the rest are about
having test coverity for various file name lenghts and minix fs versions.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agotests: add way to control mkfs.minix time stamps
Sami Kerola [Sun, 2 Aug 2015 18:28:59 +0000 (19:28 +0100)] 
tests: add way to control mkfs.minix time stamps

Needed in order to create reproducable file systems image files, so that
out come of mkfs.minix can be checksum'ed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: re-fix block count maths
Sami Kerola [Sat, 1 Aug 2015 18:01:00 +0000 (19:01 +0100)] 
mkfs.minix: re-fix block count maths

Error, that Joshua Hudson already pointed out, creapped back to commit
da41ff5 when changes were applied from mailbox rather than git remote, as
the corrected change had included some accidental rubbish.

Reference: http://www.spinics.net/lists/util-linux-ng/msg11764.html
Reference: http://www.spinics.net/lists/util-linux-ng/msg11848.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agounshare: remove angular brackets from literal argument in usage text
Benno Schulenberg [Sat, 1 Aug 2015 08:23:11 +0000 (10:23 +0200)] 
unshare: remove angular brackets from literal argument in usage text

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agodocs: fix some grammar and punctuation in the 2.27 release notes
Benno Schulenberg [Sat, 1 Aug 2015 08:23:10 +0000 (10:23 +0200)] 
docs: fix some grammar and punctuation in the 2.27 release notes

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agomount: remove duplications of --help and --version from usage text
Benno Schulenberg [Sat, 1 Aug 2015 08:23:09 +0000 (10:23 +0200)] 
mount: remove duplications of --help and --version from usage text

And slice up the affected portions.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agolslocks: slice up the recently modified usage text
Benno Schulenberg [Sat, 1 Aug 2015 08:23:08 +0000 (10:23 +0200)] 
lslocks: slice up the recently modified usage text

For ease of translation when it changes.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agotextual: adjust grammar and punctuation of some messages
Benno Schulenberg [Sat, 1 Aug 2015 08:23:07 +0000 (10:23 +0200)] 
textual: adjust grammar and punctuation of some messages

Also equalize three messages to one other one,
and fix a typo in USE_COLORS_BY_DEFAULT.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
9 years agobuild-sys: mark script(1) as Linux only due to signalfd()
Karel Zak [Fri, 31 Jul 2015 13:27:10 +0000 (15:27 +0200)] 
build-sys: mark script(1) as Linux only due to signalfd()

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agobuild-sys: release++ (v2.27-rc1) v2.27-rc1
Karel Zak [Fri, 31 Jul 2015 10:08:18 +0000 (12:08 +0200)] 
build-sys: release++ (v2.27-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: add v2.27-ReleaseNotes
Karel Zak [Fri, 31 Jul 2015 10:06:38 +0000 (12:06 +0200)] 
docs: add v2.27-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: update AUTHORS file
Karel Zak [Fri, 31 Jul 2015 09:02:35 +0000 (11:02 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agopo: merge changes
Karel Zak [Fri, 31 Jul 2015 08:56:34 +0000 (10:56 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolsblk: Display mountpoint even for top-level device
Milan Broz [Thu, 30 Jul 2015 14:18:28 +0000 (16:18 +0200)] 
lsblk: Display mountpoint even for top-level device

If a filesystem is mounted on top-level block device
with existing partitions, the mountpoint is not displayed
in the lsblk output.

This situation can happen by a configuration mistake
and lsblk could be used to detect such a mistake.

This patch allows searching for a mountpoint for all displayed
devices, not only for leaf nodes.
(It should be pretty cheap operation, mtab is parsed only once.)

For example: lsblk /dev/loop1
NAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop1       7:1    0  128M  0 loop /mnt/tst
└─loop1p1 259:0    0  127M  0 loop

Signed-off-by: Milan Broz <gmazyland@gmail.com>
9 years agosfdisk: don't print extra linebreaks on --quiet
Karel Zak [Thu, 30 Jul 2015 11:22:35 +0000 (13:22 +0200)] 
sfdisk: don't print extra linebreaks on --quiet

Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agolibfdisk: allow to change partition type for extended partitions
Karel Zak [Thu, 30 Jul 2015 10:55:56 +0000 (12:55 +0200)] 
libfdisk: allow to change partition type for extended partitions

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1248115
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agohexdump: fix man page (-x vs. default output)
Karel Zak [Thu, 30 Jul 2015 09:49:15 +0000 (11:49 +0200)] 
hexdump: fix man page (-x vs. default output)

Reported-by: Reuti <reuti@staff.uni-marburg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
9 years agodocs: make fsck.minix(8) more pretty
Sami Kerola [Wed, 24 Jun 2015 08:15:19 +0000 (09:15 +0100)] 
docs: make fsck.minix(8) more pretty

Use real table to device list, add missing new paragraph markers, remove
braces that cause reader to wonder if test is meant or not, squeeze error
code list, move references to bottom of the manual, and use mail or web
address macro when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agofsck.minix: introduce long options to the command
Sami Kerola [Wed, 24 Jun 2015 08:15:18 +0000 (09:15 +0100)] 
fsck.minix: introduce long options to the command

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agofsck.minix: add minix v3 support
Sami Kerola [Wed, 24 Jun 2015 08:15:17 +0000 (09:15 +0100)] 
fsck.minix: add minix v3 support

Relates-to: a2657ae3ffb56616ac9c921886bcca8ef242499f
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agofsck.minix: rename device file descriptor variable
Sami Kerola [Wed, 24 Jun 2015 08:15:16 +0000 (09:15 +0100)] 
fsck.minix: rename device file descriptor variable

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: refactor root block content creation
Sami Kerola [Wed, 24 Jun 2015 08:15:15 +0000 (09:15 +0100)] 
mkfs.minix: refactor root block content creation

This does not belong to main() function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: check requested blocks will not exceed available on device
Sami Kerola [Wed, 24 Jun 2015 08:15:14 +0000 (09:15 +0100)] 
mkfs.minix: check requested blocks will not exceed available on device

Earlier user could define more blocks than device, or backing file for
loopback file system, had available.  That lead to a system crash with
following commands;

fallocate --length 64KiB test-file
mkfs.minix -3 -i 842160 test-file 104882174
mkdir test-file.d
mount test-file test-file.d
cp /etc/service test-file.d
Killed
sudo umount test-file.d

The minix driver should probably not hang the whole kernel, but the least
that mkfs.minix ought to do is not to let users to get that condition
quite as easily.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: check user input carefully
Sami Kerola [Wed, 24 Jun 2015 08:15:13 +0000 (09:15 +0100)] 
mkfs.minix: check user input carefully

File name lenght and version input needs to be checked against each
other, which will determine what version of file system is in question.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: add fs_control structure, and remove most global variables
Sami Kerola [Wed, 24 Jun 2015 08:15:12 +0000 (09:15 +0100)] 
mkfs.minix: add fs_control structure, and remove most global variables

This allows better code structure in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: remove unuseful code
Sami Kerola [Wed, 24 Jun 2015 08:15:11 +0000 (09:15 +0100)] 
mkfs.minix: remove unuseful code

Checks about inodes vs block sizes does not add much robustness.  Both
values are derived at compilation time from struct minix_inode size, and
they form full definition circle.

Bad block check for none-block devices should not be supressed, user
requested it so let him have it.

Check for st_rdev == 0x0300 || st_rdev == 0x0340 was unreachable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: use is_mounted() from libcommon
Sami Kerola [Wed, 24 Jun 2015 08:15:10 +0000 (09:15 +0100)] 
mkfs.minix: use is_mounted() from libcommon

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: introduce long options to the command
Sami Kerola [Wed, 24 Jun 2015 08:15:09 +0000 (09:15 +0100)] 
mkfs.minix: introduce long options to the command

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
9 years agomkfs.minix: increase maximum minix v2 and v3 file system sizes
Joshua Hudson [Wed, 24 Jun 2015 08:15:08 +0000 (09:15 +0100)] 
mkfs.minix: increase maximum minix v2 and v3 file system sizes

mkfs.minix misbehaves when attempting to create a large v2 or v3
filesystem.  I finally traced it down to attempting to create too many
inodes so that the first zone is past 65535 blocks in.  This obviously
doesn't work as the on-disk superblock says this is a 16 bit integer.

I wrote a patch that catches this, clamps to the absolute v2/v3 limit
(like it already does for v1), and sets the blocks per inode to a more
reasonable ratio when exceeding half a gigabyte.  Having a half-gig
filesystem with most files being smaller than 3k isn't really reasonable.

I suppose if you don't want to adjust inode sizes automatically you could
take that part out, and it will just crab sooner.

Given the non-attention in the code, I suspect nobody ever had cause to
try such a big minix filesystem.  Well I have my reasons involving some
deeply embedded work where ext2 would place too much strain on the
hardware.

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Joshua Hudson <joshudson@gmail.com>