diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 12:26:16 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 12:26:16 +0100 |
commit | c49ab7f2bee8f4452a7230367abc669fd4baa08b (patch) | |
tree | b3469518c4ba669f373cf56a9734dc2778319908 /pflocal | |
parent | e6a1d81533fd25188ec52c2597c590dd2b91b7c0 (diff) | |
download | hurd-c49ab7f2bee8f4452a7230367abc669fd4baa08b.tar.gz hurd-c49ab7f2bee8f4452a7230367abc669fd4baa08b.tar.bz2 hurd-c49ab7f2bee8f4452a7230367abc669fd4baa08b.zip |
pflocal: Avoid setting sock fields on error
Diffstat (limited to 'pflocal')
-rw-r--r-- | pflocal/pf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pflocal/pf.c b/pflocal/pf.c index 37787f91..290c0b3f 100644 --- a/pflocal/pf.c +++ b/pflocal/pf.c @@ -79,10 +79,13 @@ S_socket_create (trivfs_protid_t pf, *port_type = MACH_MSG_TYPE_MAKE_SEND; } - if (pf->user->uids->num > 0) - sock->uid = pf->user->uids->ids[0]; - if (pf->user->gids->num > 0) - sock->gid = pf->user->gids->ids[0]; + if (!err) + { + if (pf->user->uids->num > 0) + sock->uid = pf->user->uids->ids[0]; + if (pf->user->gids->num > 0) + sock->gid = pf->user->gids->ids[0]; + } return err; } |