<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Apply by doing:
	cd /usr/src
	patch -p0 &lt; 003_fdalloc2.patch

And then rebuild your kernel.

Index: sys/kern/kern_exec.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_exec.c,v
retrieving revision 1.66
diff -u -r1.66 kern_exec.c
--- sys/kern/kern_exec.c	14 Mar 2002 17:17:23 -0000	1.66
+++ sys/kern/kern_exec.c	8 May 2002 20:18:41 -0000
@@ -534,9 +534,6 @@
 			 * allocated.  We do not want userland to accidentally
 			 * allocate descriptors in this range which has implied
 			 * meaning to libc.
-			 *
-			 * XXX - Shouldn't the exec fail if we can't allocate
-			 *       resources here?
 			 */
 			if (fp == NULL) {
 				short flags = FREAD | (i == 0 ? 0 : FWRITE);
@@ -544,7 +541,7 @@
 				int indx;
 
 				if ((error = falloc(p, &amp;fp, &amp;indx)) != 0)
-					break;
+					goto exec_abort;
 #ifdef DIAGNOSTIC
 				if (indx != i)
 					panic("sys_execve: falloc indx != i");
@@ -552,13 +549,13 @@
 				if ((error = cdevvp(getnulldev(), &amp;vp)) != 0) {
 					fdremove(p-&gt;p_fd, indx);
 					closef(fp, p);
-					break;
+					goto exec_abort;
 				}
 				if ((error = VOP_OPEN(vp, flags, p-&gt;p_ucred, p)) != 0) {
 					fdremove(p-&gt;p_fd, indx);
 					closef(fp, p);
 					vrele(vp);
-					break;
+					goto exec_abort;
 				}
 				if (flags &amp; FWRITE)
 					vp-&gt;v_writecount++;
</pre></body></html>