]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysusers: make sure to reset the returned value when EOF is reached in fget*ent_sane...
authorFranck Bui <fbui@suse.com>
Wed, 18 Apr 2018 16:32:21 +0000 (18:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 18 Apr 2018 16:32:21 +0000 (18:32 +0200)
commit80359410c4056ffa9113837cebac8bdfde3f3ac2
treea6b09971e307c1bb9b8bbc4b2b4507b7c9041d08
parent613bddf7d1140be34569a68b49eda7415e67e070
sysusers: make sure to reset the returned value when EOF is reached in fget*ent_sane() wrappers (#8737)

To indicate that the there're no more entries, these wrappers return false but
did leave the passed pointed unmodified.

However EOF is not an error and is a very common case so initialize the output
argument to NULL even in this case so callers don't need to do that.

Fixes: #8721
src/basic/user-util.c
test/TEST-21-SYSUSERS/test-12.expected-group [new file with mode: 0644]
test/TEST-21-SYSUSERS/test-12.expected-passwd [new file with mode: 0644]
test/TEST-21-SYSUSERS/test-12.initial-group [new file with mode: 0644]
test/TEST-21-SYSUSERS/test-12.initial-passwd [new file with mode: 0644]
test/TEST-21-SYSUSERS/test-12.input [new file with mode: 0644]