Commit Graph

15567 Commits

Author SHA1 Message Date
Karel Zak b4533177ae agetty: do not use atol()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:26:20 +02:00
Karel Zak 24c17c6294 lscpu: do not use atoi()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:20:49 +02:00
Karel Zak 55cbb788f8 utmpdump: do not use atoi()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:04:24 +02:00
Karel Zak cfc0d463b4 swapon: do not use atoi()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:04:24 +02:00
Karel Zak 70bce9b32f ipcs: do not use atoi()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:04:24 +02:00
Karel Zak a1b3e2ec9d eject: do not use atoi()
* remove unnecessary strtok() use
* remove atoi use()

Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 17:04:24 +02:00
Karel Zak 2ce856993b fsck: do not use atoi()
Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 14:49:35 +02:00
Karel Zak 84825b161b include/strutils: cleanup strto..() functions
* add ul_strtos64() and ul_strtou64()
* add simple test

Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 14:42:15 +02:00
Karel Zak 4077526856 blockdev: improve arguments parsing (remove atoi)
old version:
 # blockdev --setfra 4x096 /dev/sdc

new version:
 # blockdev --setfra 4x096 /dev/sdc
 blockdev: failed to parse command argument: '4x096'

Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 12:32:58 +02:00
Karel Zak 94a5b2e84f cfdisk: do not use atoi()
It's unnecessary to use atoi in this case.

Addresses: https://github.com/karelzak/util-linux/issues/1358
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-22 11:50:06 +02:00
Karel Zak 3e5e56eb0a readprofile: 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:37:48 +02:00
Karel Zak 95bfc92361 wipefs: 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:34:06 +02:00
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
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