Date: Wed, 16 Sep 2015 04:23:09 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287847 - stable/10/sys/kern Message-ID: <201509160423.t8G4N9qn078014@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Sep 16 04:23:08 2015 New Revision: 287847 URL: https://svnweb.freebsd.org/changeset/base/287847 Log: MFC r287599: Correct handling of open("name", O_DIRECTORY | O_CREAT). PR: 202892 Modified: stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Wed Sep 16 04:20:39 2015 (r287846) +++ stable/10/sys/kern/vfs_vnops.c Wed Sep 16 04:23:08 2015 (r287847) @@ -188,7 +188,10 @@ vn_open_cred(struct nameidata *ndp, int restart: fmode = *flagp; - if (fmode & O_CREAT) { + if ((fmode & (O_CREAT | O_EXCL | O_DIRECTORY)) == (O_CREAT | + O_EXCL | O_DIRECTORY)) + return (EINVAL); + else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) { ndp->ni_cnd.cn_nameiop = CREATE; /* * Set NOCACHE to avoid flushing the cache when
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509160423.t8G4N9qn078014>