(__setuid): Actually add the new uid instead of putting it (and other uids) in the gids and leaving the old uids as is.

This commit is contained in:
Miles Bader 1995-12-21 17:43:59 +00:00
parent 8ef76445e8
commit 567676ff81

View File

@ -50,15 +50,15 @@ DEFUN(__setuid, (uid), uid_t uid)
memcpy (&newgen[1], _hurd_id.gen.uids,
_hurd_id.gen.nuids * sizeof (uid_t));
newaux[0] = uid;
memcpy (&newaux[1], _hurd_id.aux.uids,
memcpy (&newaux[1], _hurd_id.aux.uids + 1,
(_hurd_id.aux.nuids - 1) * sizeof (uid_t));
err = __USEPORT (AUTH, __auth_makeauth
(port, NULL, MACH_MSG_TYPE_COPY_SEND, 0,
_hurd_id.gen.uids, _hurd_id.gen.nuids,
_hurd_id.aux.uids, _hurd_id.aux.nuids,
newgen, 1 + _hurd_id.gen.nuids,
newaux, _hurd_id.aux.nuids,
_hurd_id.gen.gids, _hurd_id.gen.ngids,
_hurd_id.aux.gids, _hurd_id.aux.ngids,
&newauth));
}
__mutex_unlock (&_hurd_id.lock);