PERFORCE change 41583 for review
Andrew Reisse
areisse at FreeBSD.org
Thu Nov 6 13:55:20 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=41583
Change 41583 by areisse at areisse_ibook on 2003/11/06 05:54:48
change setgroups to use crdup
Affected files ...
.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#7 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#7 (text+ko) ====
@@ -495,7 +495,10 @@
ngrp = uap->gidsetsize;
if (ngrp < 1 || ngrp > NGROUPS)
return (EINVAL);
- new = crget();
+ pcred_writelock(p);
+ old = pc->pc_ucred;
+ new = crdup (old);
+ pcred_unlock(p);
error = copyin((caddr_t)uap->gidset,
(caddr_t)new->cr_groups, ngrp * sizeof(gid_t));
if (error) {
@@ -504,11 +507,6 @@
}
new->cr_ngroups = ngrp;
pcred_writelock(p);
- old = pc->pc_ucred;
- new->cr_uid = old->cr_uid;
-#ifdef MAC
- mac_create_cred (old, new);
-#endif
pc->pc_ucred = new;
pcred_unlock(p);
set_security_token(p);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list