PERFORCE change 113272 for review
Todd Miller
millert at FreeBSD.org
Sun Jan 21 22:33:08 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113272
Change 113272 by millert at millert_macbook on 2007/01/21 22:27:59
Move the mac_system_check_acct() call before the vnode_put()
so we don't have to do out own vnode locking. Brings the
code more in line with FreeBSD.
Affected files ...
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/kern_descrip.c#10 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/kern_descrip.c#10 (text+ko) ====
@@ -1926,6 +1926,15 @@
tablefull("file");
return (ENFILE);
}
+#ifdef MAC
+ error = mac_file_check_create(proc_ucred(p));
+ if (error) {
+ if (!locked)
+ proc_fdunlock(p);
+ return (error);
+ }
+#endif
+
/*
* Allocate a new file descriptor.
* If the process has file descriptor zero open, add to the list
@@ -1934,12 +1943,6 @@
*/
proc_fdunlock(p);
-#ifdef MAC
- error = mac_file_check_create(proc_ucred(p));
- if (error)
- return (error);
-#endif
-
MALLOC_ZONE(fp, struct fileproc *, sizeof(struct fileproc), M_FILEPROC, M_WAITOK);
MALLOC_ZONE(fg, struct fileglob *, sizeof(struct fileglob), M_FILEGLOB, M_WAITOK);
bzero(fp, sizeof(struct fileproc));
More information about the trustedbsd-cvs
mailing list