summaryrefslogtreecommitdiffstats
path: root/src/core/dynamic-user.c
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2019-02-01 22:52:00 +0100
committerTopi Miettinen <toiwoton@gmail.com>2019-02-02 15:25:32 +0100
commita21760454db4b19e7299ead712fb895d8704b37d (patch)
tree2a24bf42e1983c4d81a17c29dca1e1477a2b4894 /src/core/dynamic-user.c
parentbacklight: handle loading truncated file (diff)
downloadsystemd-a21760454db4b19e7299ead712fb895d8704b37d.tar.xz
systemd-a21760454db4b19e7299ead712fb895d8704b37d.zip
Detect file truncation earlier in a few places
Users of read_one_line_file() for APIVFS entries are ignored as they are assumed to never get truncated.
Diffstat (limited to 'src/core/dynamic-user.c')
-rw-r--r--src/core/dynamic-user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/dynamic-user.c b/src/core/dynamic-user.c
index 530df70b80..7b00ee4bda 100644
--- a/src/core/dynamic-user.c
+++ b/src/core/dynamic-user.c
@@ -707,7 +707,7 @@ int dynamic_user_lookup_uid(Manager *m, uid_t uid, char **ret) {
xsprintf(lock_path, "/run/systemd/dynamic-uid/" UID_FMT, uid);
r = read_one_line_file(lock_path, &user);
- if (r == -ENOENT)
+ if (IN_SET(r, -ENOENT, 0))
return -ESRCH;
if (r < 0)
return r;