PERFORCE change 156338 for review

Robert Watson rwatson at FreeBSD.org
Sun Jan 18 09:38:36 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=156338

Change 156338 by rwatson at rwatson_freebsd_capabilities on 2009/01/18 17:38:12

	Explicitly check process state to set sb_mode for stat.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_procdesc.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_procdesc.c#6 (text+ko) ====

@@ -426,8 +426,11 @@
 	pd = (struct procdesc *)fp->f_data;
 	sx_slock(&proctree_lock);
 	if (pd->pd_proc != NULL) {
-		sb->st_mode = S_IFREG | S_IRWXU;
 		PROC_LOCK(pd->pd_proc);
+		if (pd->pd_proc->p_state != PRS_ZOMBIE)
+			sb->st_mode = S_IFREG | S_IRWXU;
+		else
+			sb->st_mode = S_IFREG;
 		sb->st_uid = pd->pd_proc->p_ucred->cr_ruid;
 		sb->st_gid = pd->pd_proc->p_ucred->cr_rgid;
 		PROC_UNLOCK(pd->pd_proc);


More information about the p4-projects mailing list