util-linux/lib
Érico Nogueira 692167ff5e lib/pwdutils: use assert to check correct usage.
Since these functions are only used internally, we can make sure they
are being used correctly, and assert() helps in catching remaining
issues. Usage of each changed function has been reviewed:

For xgetpwnam:

- chsh(1) only calls it if a username has been set
- login(1) only calls it if username has been set and is not empty
- su(1) always initializes new_user to "root"
- unshare(1) calls get_user with optarg, so always set as well

For xgetgrnam:

- unshare(1) calls get_group with optarg

For xgetpwuid:

- chsh(1) passes a stack allocated struct for struct passwd

Signed-off-by: Érico Nogueira <erico.erc@gmail.com>
2021-07-29 21:40:33 +02:00
..
Makemodule.am build-sys: keep adoc files in dist_noinst_DATA 2021-05-05 13:35:30 +02:00
blkdev.c lib/blkdev: add support for --lock and LOCK_BLOCK_DEVICE 2020-05-26 17:30:39 +02:00
buffer.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
canonicalize.c include/c: add drop_permissions(), consolidate UID/GID reset 2021-07-20 11:31:43 +02:00
caputils.c lib/caputils: split to multiple functions, add test 2020-11-20 11:21:41 +01:00
color-names.c lib/color-names: add "white" between human-readable 2020-03-10 09:45:33 +01:00
colors.c misc: fix typos [codespell] 2019-09-12 19:41:46 +01:00
cpuset.c taskset: fix cpuset list parser 2019-03-20 13:12:25 +01:00
crc32.c lib/crc32: prefix public functions 2016-10-19 12:11:59 +02:00
crc32c.c lib: Add simple crc32c() function 2017-11-16 11:44:39 +01:00
encode.c [clang-tidy] do not use else after return 2020-04-20 13:20:59 -07:00
env.c misc: fix typos [codespell] 2020-11-04 11:42:25 +00:00
exec_shell.c cast NULL to char * when using execl 2020-10-29 19:49:07 +02:00
fileutils.c login: add callback for close_range() 2021-07-20 11:59:53 +02:00
idcache.c [clang-tidy] do not return in void functions 2020-04-19 14:03:21 -07:00
ismounted.c [clang-tidy] fix wrong *cmp usage 2020-04-20 13:21:00 -07:00
jsonwrt.c lib/jsonwrt: don't use ctype.h for ASCII chars 2021-05-06 16:35:50 +02:00
langinfo.c lib: add missing license headers 2019-11-08 10:40:42 +01:00
linux_version.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
loopdev.c losetup: use LOOP_CONFIGURE in a more robust way 2021-07-29 11:57:17 +02:00
mangle.c include: add some missing licence stuff to header files 2020-01-13 10:39:52 +01:00
match.c lib/match: make match_fstype() case insensitive 2017-08-31 14:15:23 +02:00
mbsalign.c lib/mbsalign: add function to calculate width 2020-04-22 12:22:29 +02:00
mbsedit.c lib/mbsedit: check wctomb() return code [coverity scan] 2017-10-11 14:40:37 +02:00
md5.c lib/md5: use ul_/UL_ prefix 2017-12-12 12:06:15 +01:00
meson.build meson: generate man pages from asciidoc 2021-04-06 15:32:46 +02:00
monotonic.c dmesg: adjust timestamps according to suspended time 2020-06-04 10:57:36 +02:00
pager.c lib/pager: fix improper use of negative value [coverity scan] 2020-10-16 11:30:08 +02:00
path.c lib/path: (test) fix ul_new_path() use 2021-07-20 11:30:00 +02:00
plymouth-ctrl.c lib: style cosmetics plymouth-ctrl.c 2017-06-15 09:13:04 +02:00
procutils.c lib/procutils: improve proc_is_procfs(), add test 2020-11-20 10:40:31 +01:00
pty-session.c lib/pty-session: fix time_t=long assumptions 2021-05-06 10:22:07 +02:00
pwdutils.c lib/pwdutils: use assert to check correct usage. 2021-07-29 21:40:33 +02:00
randutils.c libuuid: check quality of random bytes 2020-11-08 11:48:23 +00:00
selinux-utils.c lib/selinux-utils: tiny cleanup 2021-01-13 15:04:02 +01:00
sha1.c lib/sha1: use proper WORDS_BIGENDIAN macro 2018-01-02 11:08:03 +01:00
signames.c lib/signames: change license to public domain 2020-11-19 12:04:08 +01:00
strutils.c include/strutils: consolidate string to number conversion 2021-07-20 11:50:52 +02:00
strv.c lib/strv: add strv_extendv() 2015-10-01 14:43:05 +02:00
swapprober.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
sysfs.c lib/path: improve ul_path_readlink() to be more robust 2021-07-20 11:24:12 +02:00
terminal-colors.d.5.adoc build-sys: make man pages location independent 2021-03-31 11:50:47 +02:00
timer.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
timeutils.c Fixed wrongful time_t=long assumptions in hwclock.c and timeutils.c 2021-04-29 11:56:37 +00:00
ttyutils.c [clang-tidy] do not use else after return 2020-04-20 13:20:59 -07:00