Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Sep 2006 10:36:25 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 106545 for review
Message-ID:  <200609231036.k8NAaP5M047498@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106545

Change 106545 by rdivacky@rdivacky_witten on 2006/09/23 10:35:33

	Return EINVAL instead of EACCESS if invalid access mode is entered.

Affected files ...

.. //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#4 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#4 (text+ko) ====

@@ -49,6 +49,7 @@
 #include <sys/syscallsubr.h>
 #include <sys/sysproto.h>
 #include <sys/tty.h>
+#include <sys/unistd.h>
 #include <sys/vnode.h>
 
 #include <ufs/ufs/extattr.h>
@@ -480,6 +481,10 @@
 	char *path;
 	int error;
 
+	/* linux convention */
+	if (args->flags & ~(F_OK | X_OK | W_OK | R_OK))
+		return (EINVAL);
+
 	LCONVPATHEXIST(td, args->path, &path);
 
 #ifdef DEBUG
@@ -488,6 +493,7 @@
 #endif
 	error = kern_access(td, path, UIO_SYSSPACE, args->flags);
 	LFREEPATH(path);
+
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609231036.k8NAaP5M047498>