Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/fs/puffs/h_dtfs Check directory write access for DELET...
details: https://anonhg.NetBSD.org/src/rev/fc71e6668135
branches: trunk
changeset: 773343:fc71e6668135
user: njoly <njoly%NetBSD.org@localhost>
date: Tue Jan 31 18:56:07 2012 +0000
description:
Check directory write access for DELETE operation. And while here,
small indentation adjust.
diffstat:
tests/fs/puffs/h_dtfs/dtfs_vnops.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (33 lines):
diff -r 8ace044383b2 -r fc71e6668135 tests/fs/puffs/h_dtfs/dtfs_vnops.c
--- a/tests/fs/puffs/h_dtfs/dtfs_vnops.c Tue Jan 31 16:30:40 2012 +0000
+++ b/tests/fs/puffs/h_dtfs/dtfs_vnops.c Tue Jan 31 18:56:07 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_vnops.c,v 1.8 2011/03/01 15:19:49 pooka Exp $ */
+/* $NetBSD: dtfs_vnops.c,v 1.9 2012/01/31 18:56:07 njoly Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -63,6 +63,14 @@
dfd = dtfs_dirgetbyname(df, pcn->pcn_name, pcn->pcn_namelen);
if (dfd) {
+ if ((pcn->pcn_flags & NAMEI_ISLASTCN) &&
+ (pcn->pcn_nameiop == NAMEI_DELETE)) {
+ rv = puffs_access(VDIR, pn_dir->pn_va.va_mode,
+ pn_dir->pn_va.va_uid, pn_dir->pn_va.va_gid,
+ PUFFS_VWRITE, pcn->pcn_cred);
+ if (rv)
+ return rv;
+ }
puffs_newinfo_setcookie(pni, dfd->dfd_node);
puffs_newinfo_setvtype(pni, dfd->dfd_node->pn_va.va_type);
puffs_newinfo_setsize(pni, dfd->dfd_node->pn_va.va_size);
@@ -76,7 +84,7 @@
if ((pcn->pcn_flags & NAMEI_ISLASTCN)
&& (pcn->pcn_nameiop == NAMEI_CREATE ||
- pcn->pcn_nameiop == NAMEI_RENAME)) {
+ pcn->pcn_nameiop == NAMEI_RENAME)) {
rv = puffs_access(VDIR, pn_dir->pn_va.va_mode,
pn_dir->pn_va.va_uid, pn_dir->pn_va.va_gid,
PUFFS_VWRITE, pcn->pcn_cred);
Home |
Main Index |
Thread Index |
Old Index