Commit Graph

15551 Commits

Author SHA1 Message Date
Karel Zak c357816caa lslocks: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:34:53 +02:00
Karel Zak 7a50f117a4 kill: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:34:53 +02:00
Karel Zak 21ef212a58 lslogins: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:34:53 +02:00
Karel Zak b2db509d13 fsck: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:34:53 +02:00
Karel Zak 8803c8d4ab lsmem: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:34:53 +02:00
Karel Zak 096487c616 lscpu: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak 8335261c3d hwclock: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak b6cd420e03 ipcs: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak 62aa386c4f libuuid: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak 0729593862 libmount: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak 736b6ab7fd libblkid: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Thiébaud Weksteen 864578ded7 mount.8.adoc: Remove context options exclusion
The exclusivity between the {fscontext, defcontext} and context options
was removed in kernel 2.6.25[1]. No specific verification on these
options is done in mount(8)[2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9180a57a9ab2d5525faf8815a332364ee9e89b7
[2] https://github.com/karelzak/util-linux/blob/master/libmount/src/context_mount.c#L202
2021-07-20 11:33:27 +02:00
Karel Zak b0f8d63e63 fsck.cramfs: use open+fstat rather than stat+open
Fixes: https://github.com/karelzak/util-linux/issues/1353
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:33:27 +02:00
Karel Zak 86328e78ea include/c: add drop_permissions(), consolidate UID/GID reset
Fixes: https://github.com/karelzak/util-linux/issues/1354
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:31:43 +02:00
Karel Zak 155b79d38e dmesg: remove condition [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:31:43 +02:00
Karel Zak b342240e84 tools: report and use LDFLAGS in tools/config-gen
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:46 +02:00
Karel Zak a000aad7a6 build-sys: use $LIBS rather than LDFLAGS
Fixes: https://github.com/karelzak/util-linux/pull/1349
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:00 +02:00
Karel Zak ab26415a03 lib/path: (test) fix ul_new_path() use 2021-07-20 11:30:00 +02:00
Karel Zak 42a9c18706 more: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:00 +02:00
Karel Zak 59bb9ab136 wall: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:00 +02:00
Karel Zak 703ec6fc66 script: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:00 +02:00
Karel Zak 7b18166aa3 ldattach: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:30:00 +02:00
Karel Zak b2bd06d9ca hwclock: fix ul_path_scanf() use
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:29:01 +02:00
Karel Zak 856ec50de5 eject: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak 7bee16f27f logger: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak 609468bc9b libfdisk: add and fix __format__ attributes
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak bda3f658e0 findmnt: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak 292161888c libmount: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak b22ecdd840 include/strutils: fix __format__attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak 2f40ad0608 include/path: add __format__attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:27:34 +02:00
Karel Zak 7e787030bf include/c: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:26:30 +02:00
Anatoly Pugachev 5fc0e55af1 tests: fix lsns test on kernels without USER namespaces
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:26:30 +02:00
Karel Zak ed03caf2c6 mount.8: fix overlayfs nfs_export= indention
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:26:30 +02:00
Karel Zak 421c6766ea include/strv: fix format attributes
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:25:50 +02:00
Christian Bartolomäus b81a870767 Fix some brackets in synopses 2021-07-20 11:25:34 +02:00
Tj c22bb73d3a mount: man-page; add all overlayfs options
The section in man (8) mount for overlay is missing nine options which
aren't documented elsewhere either and are useful features to be aware
of and use.

Fixes #1350.
2021-07-20 11:25:13 +02:00
Alex Xu 33eec71c1a build-sys: Update configure.ac
1. the test incorrectly used AC_COMPILE_IFELSE instead of
   AC_LINK_IFELSE, defeating the purpose of checking -lcrypt.
2. the test did not properly restore LIBS, causing later checks to all
   fail if libcrypt wasn't found.
3. HAVE_LIBCRYPT only controls whether to use -lcrypt, it is not
   needed or used in any source files.

[kzak@redhat.com: - improve commit message
                  - use UL_{SET,RESTORE}_FLAGS() rather than directly
		    modify $LIBS]

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:25:00 +02:00
Karel Zak cff7e7d84b lib/path: improve ul_path_readlink() to be more robust
According to POSIX, readlink() makes no effort to null-terminate buffer
with the result. It seems better to hide this disadvantage in the
ul_path_...() API rather than assume buf[sz] = '\0' everywhere.

Reported-by: Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:24:12 +02:00
Karel Zak f113d46a50 mkfs.cramfs: add comment to explain readlink() use
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:24:12 +02:00
Karel Zak 9461ae9b90 rename: use readlink() in more robust way
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:24:12 +02:00
Karel Zak aec0e37683 namei: simplify code
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:23:40 +02:00
Karel Zak 37bb1b07e0 more: fix setuid/setgid order
The rule is pretty simple, always use setgid() before setuid().

Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:23:12 +02:00
Karel Zak da0c591015 sulogin: add missing ifdefs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:22:23 +02:00
Karel Zak ee0653123c sulogin: use explicit_bzero() for buffer with password
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:20:17 +02:00
Karel Zak 3aef5dcad5 login: remove obsolete and confusing comment
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:16:06 +02:00
Karel Zak 3871a969ed mkswap: fix holes detection (infinite loop and/or stack-buffer-underflow)
Reported-by: Brian Lane <bcl@redhat.com>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1971877
Fix: https://github.com/karelzak/util-linux/issues/1348
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:14:38 +02:00
Karel Zak 612913cda5 lib/loopdev: perform retry on EAGAIN
Suggested-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:14:17 +02:00
Topi Miettinen b1e37433bb mount.8.adoc: document SELinux use of nosuid mount flag
Using mount flag `nosuid` also affects SELinux domain transitions but
this has not been documented well.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2021-07-20 11:13:25 +02:00
Platon Pronko 4b9d512c6f dmesg: fix indentation in man page
Double-semicolon at the end of the option line results in description
being indented extra tab to the right. Replacing them with double-colons
allows all options to be displayed at the same indent level.
2021-07-20 11:13:14 +02:00
Karel Zak 296f21699d lib/path: fix possible leak when use ul_path_read_string() [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-20 11:13:02 +02:00