Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/v7fs Check parent directory write permission for DELE...
details: https://anonhg.NetBSD.org/src/rev/65306e90c27d
branches: trunk
changeset: 773074:65306e90c27d
user: njoly <njoly%NetBSD.org@localhost>
date: Fri Jan 27 12:22:02 2012 +0000
description:
Check parent directory write permission for DELETE operation.
ok uch@.
diffstat:
sys/fs/v7fs/v7fs_vnops.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (32 lines):
diff -r 6acaa20544ed -r 65306e90c27d sys/fs/v7fs/v7fs_vnops.c
--- a/sys/fs/v7fs/v7fs_vnops.c Fri Jan 27 08:47:52 2012 +0000
+++ b/sys/fs/v7fs/v7fs_vnops.c Fri Jan 27 12:22:02 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v7fs_vnops.c,v 1.6 2011/07/30 03:53:18 uch Exp $ */
+/* $NetBSD: v7fs_vnops.c,v 1.7 2012/01/27 12:22:02 njoly Exp $ */
/*-
* Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.6 2011/07/30 03:53:18 uch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.7 2012/01/27 12:22:02 njoly Exp $");
#if defined _KERNEL_OPT
#include "opt_v7fs.h"
#endif
@@ -161,6 +161,13 @@
return error;
}
+ if ((nameiop == DELETE) && islastcn) {
+ if ((error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred))) {
+ DPRINTF("access denied. (%s)\n", name);
+ return error;
+ }
+ }
+
/* Entry found. Allocate v-node */
// Check permissions?
vpp = 0;
Home |
Main Index |
Thread Index |
Old Index