Commit Graph

9755 Commits

Author SHA1 Message Date
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
Karel Zak 2279ab60ba 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
2015-08-12 22:53:47 +02:00
Karel Zak 2aedcdf4bf 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
2015-08-12 11:09:04 +02:00
Karel Zak a4839bc781 lsipc: add more resource to the limits list
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-12 10:21:48 +02:00
Borut Mrak e7d53b984a mount.8: also note diratime does not override noatime. 2015-08-11 03:00:29 +02:00
Borut Mrak 6e73b6113b 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.
2015-08-11 02:51:36 +02:00
Sami Kerola cdf6406dde 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>
2015-08-10 22:12:03 +01:00
Sami Kerola 70e3fcf293 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>
2015-08-10 21:48:42 +01:00
Sami Kerola d883d64d96 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>
2015-08-10 21:48:38 +01:00
Sami Kerola 3a41cdd7b5 colcrt: use #define in place of magic constants
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-09 18:59:52 +01:00
Sami Kerola ee24ab6f1e misc: fix redundant assignment and reassignments before use [cppcheck]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-08 07:46:39 +01:00
Sami Kerola 6e93ae8414 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>
2015-08-07 21:34:42 +01:00
Karel Zak 41e554e303 libmount: fix typo in mnt_optstr_prepend_option()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:39:06 +02:00
Karel Zak 28bad822c4 logger: improve readability [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:23:34 +02:00
Karel Zak 7ff635bff4 misc: fix indention [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:22:05 +02:00
Karel Zak d43ec106e4 tools: add hexdump badconv() to noreturn smatch list
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 13:18:40 +02:00
Karel Zak 8f2a465073 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>
2015-08-05 13:09:12 +02:00
Karel Zak e820595b81 libfdisk: (gpt) fix label pointer usage [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:59:16 +02:00
Karel Zak 06fb6eabeb libfdisk: remove impossible condition [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:55:30 +02:00
Karel Zak 1c736ff38b libfdisk: make context->label usage more robust [smatch scan] 2015-08-05 12:54:49 +02:00
Karel Zak 2bf68c9334 libblkid: fix inconsistent indenting [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:48:54 +02:00
Karel Zak 941c734c56 libmount: variable dereferenced before check [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:46:56 +02:00
Karel Zak ffab025db8 cfdisk, sfdisk: remove unused variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:41:46 +02:00
Karel Zak 06df240c92 tools: add err_oom() to smatch no_return_funcs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:41:17 +02:00
Karel Zak 09db9538d7 lib/blkdev: use 64-bit to count size in bytes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:40:35 +02:00
Karel Zak 9d8260761c lib/timeutils: fix indention [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:39:00 +02:00
Karel Zak c6556f7ca8 tailf: fix open() return value check [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 11:55:56 +02:00
Karel Zak 2660801513 setterm: remove dead code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 11:51:04 +02:00
Karel Zak a359830c1a agetty: cleanup plymouth usage [coverity scan]
* use macros for paths
* check open() return value

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 11:48:01 +02:00
Karel Zak 6b497c0e19 rtcwake: improve open() usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 11:33:29 +02:00
Ian Wienand 11aa2aa290 sfdisk: clarification for sfdisk man page
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249893
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 09:21:27 +02:00
Karel Zak 71b63dc14f lsipc: cleanup usernames
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:22:31 +02:00
Karel Zak fadf556a70 lsipc: check scols_line_refer_data() return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:05:33 +02:00
Karel Zak cdb4a9464d lsipc: don't duplicate already allocated data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:57:45 +02:00
Karel Zak 2c6567799d build-sys: add --disable-assert
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:40:44 +02:00
Karel Zak cba392b661 libmount: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:21:42 +02:00
Karel Zak 1c3c92cd8d libfdisk: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:03:14 +02:00
Karel Zak e97c021472 libblkid: remove dead code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 12:31:39 +02:00
Karel Zak 70e0513563 mkfs.minix: add hint for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:42:27 +02:00
Karel Zak cd16685e94 mkfs.minix: use xalloc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:39:49 +02:00
Karel Zak 101c80f316 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>
2015-08-04 11:33:57 +02:00
Karel Zak 1e9d849b8d fsck.minix: be more paranoid with block buffers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:15:53 +02:00
Karel Zak 4c166c2200 cfdisk: check return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 10:59:52 +02:00
Karel Zak 21ce5a5d70 lsipc: ifdef SHM_* macros
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 13:20:56 +02:00
Karel Zak dc5c91f648 tests: fix minix tests filenames
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 12:51:13 +02:00
Karel Zak 45caf6eea8 tests: try mkfs & mount all supported minix versions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 12:35:29 +02:00
Sami Kerola 24bdce6ea8 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>
2015-08-03 12:35:18 +02:00
Karel Zak 39c795d8b7 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>
2015-08-03 12:31:40 +02:00
Sami Kerola 6fb15a2dcf tests: add fsck.minix checks
The debian bug was fixed in commit 730ae9c899, 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>
2015-08-03 11:27:38 +02:00