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:
@@ -258,8 +258,7 @@ static int varlink_new(Varlink **ret) {
|
||||
|
||||
.state = _VARLINK_STATE_INVALID,
|
||||
|
||||
.ucred.uid = UID_INVALID,
|
||||
.ucred.gid = GID_INVALID,
|
||||
.ucred = UCRED_INVALID,
|
||||
|
||||
.timestamp = USEC_INFINITY,
|
||||
.timeout = VARLINK_DEFAULT_TIMEOUT_USEC
|
||||
@@ -2106,8 +2105,8 @@ static int count_connection(VarlinkServer *server, struct ucred *ucred) {
|
||||
|
||||
int varlink_server_add_connection(VarlinkServer *server, int fd, Varlink **ret) {
|
||||
_cleanup_(varlink_unrefp) Varlink *v = NULL;
|
||||
struct ucred ucred = UCRED_INVALID;
|
||||
bool ucred_acquired;
|
||||
struct ucred ucred;
|
||||
int r;
|
||||
|
||||
assert_return(server, -EINVAL);
|
||||
|
||||
Reference in New Issue
Block a user