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 Return correct error values from a bun...



details:   https://anonhg.NetBSD.org/src/rev/f5ece58d941c
branches:  trunk
changeset: 756368:f5ece58d941c
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jul 14 17:10:14 2010 +0000

description:
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.

diffstat:

 tests/fs/puffs/h_dtfs/dtfs_vnops.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 6a815e221ad2 -r f5ece58d941c tests/fs/puffs/h_dtfs/dtfs_vnops.c
--- a/tests/fs/puffs/h_dtfs/dtfs_vnops.c        Wed Jul 14 16:59:35 2010 +0000
+++ b/tests/fs/puffs/h_dtfs/dtfs_vnops.c        Wed Jul 14 17:10:14 2010 +0000
@@ -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),



Home | Main Index | Thread Index | Old Index