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.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user