Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libperfuse rmdir dir/.. must return an error. Use ENOTEM...



details:   https://anonhg.NetBSD.org/src/rev/83b86a68f513
branches:  trunk
changeset: 802206:83b86a68f513
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Sep 05 15:20:16 2014 +0000

description:
rmdir dir/.. must return an error. Use ENOTEMPRY like FFS does.

diffstat:

 lib/libperfuse/ops.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r f24fad18f107 -r 83b86a68f513 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Fri Sep 05 11:27:57 2014 +0000
+++ b/lib/libperfuse/ops.c      Fri Sep 05 15:20:16 2014 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.72 2014/09/03 23:59:58 enami Exp $ */
+/*  $NetBSD: ops.c,v 1.73 2014/09/05 15:20:16 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2352,6 +2352,12 @@
            (PERFUSE_NODE_DATA(targ)->pnd_flags & PND_REMOVED))
                return ENOENT;
 
+       /*
+        * Attempt to rmdir dir/.. shoud raise ENOTEMPTY
+        */
+       if (PERFUSE_NODE_DATA(targ)->pnd_nodeid == pnd->pnd_parent_nodeid)
+               return ENOTEMPTY;
+
        node_ref(opc);
        node_ref(targ);
 



Home | Main Index | Thread Index | Old Index