+#if SECURITY_MAC_CHECK_ENFORCE
+ /* 21167099 - only check if we allow write */
+ if (!mac_proc_enforce) {
+ return 0;
+ }
+#endif
+ if (!mac_proc_check_enforce(curp)) {
+ return 0;
+ }
+
+ cred = kauth_cred_proc_ref(curp);
+ MAC_CHECK(proc_check_proc_info, cred, target, callnum, flavor);
+ kauth_cred_unref(&cred);
+
+ return error;