Module Name: src
Committed By: pooka
Date: Wed Jul 14 17:10:14 UTC 2010
Modified Files:
src/tests/fs/puffs/h_dtfs: dtfs_vnops.c
Log Message:
Return correct error values from a bunch of questionable renames.
There's no substitute for single-stepping do_sys_rename() into ffs
when trying to figure out what error should come from what layer...
well, at least apart from TNT.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.4 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.5
--- src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.4 Wed Jul 14 16:59:35 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_vnops.c Wed Jul 14 17:10:14 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_vnops.c,v 1.4 2010/07/14 16:59:35 pooka Exp $ */
+/* $NetBSD: dtfs_vnops.c,v 1.5 2010/07/14 17:10:14 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -314,6 +314,13 @@
if (pn_sfile->pn_va.va_type == VDIR) {
if (dtfs_isunder(pn_tdir, pn_sfile))
return EINVAL;
+
+ if ((pcn_src->pcn_namelen == 1 && pcn_src->pcn_name[0]=='.') ||
+ opc == src ||
+ PCNISDOTDOT(pcn_src) ||
+ PCNISDOTDOT(pcn_targ)) {
+ return EINVAL;
+ }
}
dfd_src = dtfs_dirgetbyname(DTFS_PTOF(pn_sdir),