summaryrefslogtreecommitdiff
path: root/src/basic/socket-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-10-11 15:25:14 +0200
committerLennart Poettering <lennart@poettering.net>2021-10-11 15:37:37 +0200
commita995ce4768928843b4d37ecf46f32fe9e635e38a (patch)
treed39f5ca7fa86da5bd89f815924a44d3fa117e5c4 /src/basic/socket-util.c
parent599be274c13c503806c85073d7beb1a155ac27bd (diff)
downloadsystemd-a995ce4768928843b4d37ecf46f32fe9e635e38a.tar.gz
util: define initializer for 'struct ucred' that properly invalidates all fields
i.e. let's make sure to invalid uid/gid to UID_INVAID + GID_INVALID instead of zero.
Diffstat (limited to 'src/basic/socket-util.c')
-rw-r--r--src/basic/socket-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 1e66f8700b..94ae90929a 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -551,7 +551,7 @@ int getpeername_pretty(int fd, bool include_port, char **ret) {
return -errno;
if (sa.sa.sa_family == AF_UNIX) {
- struct ucred ucred = {};
+ struct ucred ucred = UCRED_INVALID;
/* UNIX connection sockets are anonymous, so let's use
* PID/UID as pretty credentials instead */