Commit Graph

15606 Commits

Author SHA1 Message Date
Karel Zak 93d01a6233 lslocks: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:33:36 +02:00
Karel Zak f1de6d6526 kill: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:32:51 +02:00
Karel Zak 2fc2bb7ebd lslogins: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:31:43 +02:00
Karel Zak d8a42b67c8 fsck: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:29:43 +02:00
Karel Zak fe4e122ab3 lsmem: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:29:33 +02:00
Karel Zak 35d458708e lscpu: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:22:04 +02:00
Karel Zak 9bf8088f25 hwclock: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:21:11 +02:00
Karel Zak c9eea1b354 ipcs: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:20:20 +02:00
Karel Zak b0cfd4ba3a libuuid: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:06:40 +02:00
Karel Zak 5aa726461a libmount: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:03:01 +02:00
Karel Zak 0395e8f7d7 libblkid: check errno after strto..()
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 15:00:40 +02:00
Thiébaud Weksteen da277d4eff 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-06-21 14:16:39 +02:00
Karel Zak 1293b0f65d misc: consolidate stat() error message
Let's use the same error message everywhere to reduce number of
strings for translators.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-21 12:40:41 +02:00
Karel Zak c6f3632905 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-06-21 12:39:33 +02:00
Karel Zak 17fc8693cd 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-06-21 12:25:31 +02:00
Karel Zak 0272f2ef98 dmesg: remove condition [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 17:57:13 +02:00
Huang Shijie b366e69b82 lscpu: add more sanity checks for dmi_decode_cputype()
After tested on different platforms, we found dmi_string() may return NULL
in some case.

So add more sanity checks for dmi_decode_cputype().

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
2021-06-18 17:51:11 +02:00
Karel Zak 6eb184299e tools: report and use LDFLAGS in tools/config-gen
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 17:37:38 +02:00
Karel Zak 75cba8d5cd 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-06-18 17:21:13 +02:00
Karel Zak 5a8261020b lib/path: (test) fix ul_new_path() use 2021-06-18 17:02:38 +02:00
Karel Zak 2f38ae595b more: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:58:38 +02:00
Karel Zak 0c753d8d6b wall: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:56:52 +02:00
Karel Zak 94e4a41406 script: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:55:40 +02:00
Karel Zak c7da267442 ldattach: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:52:26 +02:00
Karel Zak 365e006a36 hwclock: fix ul_path_scanf() use
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:50:58 +02:00
Karel Zak ddadf4748d eject: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:49:28 +02:00
Karel Zak e71d44a459 logger: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:43:30 +02:00
Karel Zak fbae144212 libfdisk: add and fix __format__ attributes
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:42:57 +02:00
Karel Zak ea75960d6c findmnt: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:35:33 +02:00
Karel Zak b77e3e34bf libmount: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:34:20 +02:00
Karel Zak 40b55f5a29 include/strutils: fix __format__attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:33:16 +02:00
Karel Zak f5771a085c include/path: add __format__attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:32:37 +02:00
Karel Zak 01085557eb include/c: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 16:29:16 +02:00
Anatoly Pugachev 8c6fb9841c 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-06-18 14:45:31 +02:00
Karel Zak 0197bdb2d0 mount.8: fix overlayfs nfs_export= indention
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 14:37:28 +02:00
Karel Zak 627fb946d5 Merge branch 'man-mount-overlayfs' of https://github.com/iam-TJ/util-linux
* 'man-mount-overlayfs' of https://github.com/iam-TJ/util-linux:
  mount: man-page; add all overlayfs options
2021-06-18 12:33:10 +02:00
Karel Zak d1145efd8a Merge branch 'sys-utils_doc_brackets' of https://github.com/usev6/util-linux
* 'sys-utils_doc_brackets' of https://github.com/usev6/util-linux:
  Fix some brackets in synopses
2021-06-18 12:30:32 +02:00
Karel Zak 4355453406 include/strv: fix format attributes
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-18 12:25:46 +02:00
Christian Bartolomäus 89456be777
Fix some brackets in synopses 2021-06-17 22:27:17 +02:00
Tj 9fd75ae758 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-06-17 13:20:36 +01:00
Alex Xu 637cc045ee 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-06-17 13:59:35 +02:00
Karel Zak 9dbae34c3d 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-06-17 13:28:32 +02:00
Karel Zak 2384fa6e4d mkfs.cramfs: add comment to explain readlink() use
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-17 13:26:50 +02:00
Karel Zak 538f010c8f rename: use readlink() in more robust way
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-17 13:25:43 +02:00
Karel Zak 403cd1086e namei: simplify code
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-17 13:23:53 +02:00
Karel Zak 19f2cebd48 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-06-17 12:21:04 +02:00
Karel Zak 8ff8b02782 hardlink: small regex stuff refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-16 15:58:14 +02:00
Karel Zak d3f77b4b8b sulogin: add missing ifdefs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-16 15:44:02 +02:00
Karel Zak 286865bf7e sulogin: use explicit_bzero() for buffer with password
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-16 15:39:32 +02:00
Karel Zak 59e2df8fe8 login: remove obsolete and confusing comment
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-16 15:13:50 +02:00