svn commit: r240931 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Sep 25 21:11:41 UTC 2012


Author: pjd
Date: Tue Sep 25 21:11:40 2012
New Revision: 240931
URL: http://svn.freebsd.org/changeset/base/240931

Log:
  We cannot open file for reading and executing (O_RDONLY | O_EXEC).
  Well, in theory we can pass those two flags, because O_RDONLY is 0,
  but we won't be able to read from a descriptor opened with O_EXEC.
  
  Update the comment.
  
  Sponsored by:	FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Tue Sep 25 21:00:36 2012	(r240930)
+++ head/sys/kern/kern_exec.c	Tue Sep 25 21:11:40 2012	(r240931)
@@ -441,10 +441,10 @@ interpret:
 	} else {
 		AUDIT_ARG_FD(args->fd);
 		/*
-		 * Some might argue that CAP_READ and/or CAP_MMAP should also
-		 * be required here; such arguments will be entertained.
+		 * Some might argue that CAP_MMAP should also be required here;
+		 * such arguments will be entertained.
 		 *
-		 * Descriptors opened only with O_EXEC or O_RDONLY are allowed.
+		 * Descriptors opened only with O_EXEC are allowed.
 		 */
 		error = fgetvp_exec(td, args->fd, CAP_FEXECVE, &binvp);
 		if (error)


More information about the svn-src-head mailing list