disallow creation of files in removed directories
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 3 Mar 1992 08:44:29 +0000 (00:44 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 3 Mar 1992 08:44:29 +0000 (00:44 -0800)
SCCS-vsn: sys/kern/vfs_lookup.c 7.38
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 7.41
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 7.41
SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.81
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.81

usr/src/sys/kern/vfs_lookup.c
usr/src/sys/ufs/ffs/ufs_lookup.c
usr/src/sys/ufs/ffs/ufs_vnops.c
usr/src/sys/ufs/ufs/ufs_lookup.c
usr/src/sys/ufs/ufs/ufs_vnops.c

index 5f65d26..6cfb6f2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)vfs_lookup.c        7.37 (Berkeley) %G%
+ *     @(#)vfs_lookup.c        7.38 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -341,8 +341,7 @@ dirloop:
 #ifdef NAMEI_DIAGNOSTIC
                printf("not found\n");
 #endif
 #ifdef NAMEI_DIAGNOSTIC
                printf("not found\n");
 #endif
-               if (cnp->cn_nameiop == LOOKUP || cnp->cn_nameiop == DELETE ||
-                   error != ENOENT || *cp != 0)
+               if (error != EJUSTRETURN)
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider
index f4a30e7..d20ad16 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lookup.c        7.40 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.41 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -365,6 +365,7 @@ searchloop:
                cnp->cn_flags |= SAVENAME;
                if (!lockparent)
                        IUNLOCK(dp);
                cnp->cn_flags |= SAVENAME;
                if (!lockparent)
                        IUNLOCK(dp);
+               return (EJUSTRETURN);
        }
        /*
         * Insert name into cache (as non-existent) if appropriate.
        }
        /*
         * Insert name into cache (as non-existent) if appropriate.
index 51bc40a..ceef54c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.80 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.81 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -678,8 +678,7 @@ relookup(dvp, vpp, cnp)
                if (*vpp != NULL)
                        panic("leaf should be empty");
 #endif
                if (*vpp != NULL)
                        panic("leaf should be empty");
 #endif
-               if (cnp->cn_nameiop == LOOKUP || cnp->cn_nameiop == DELETE ||
-                   error != ENOENT)
+               if (error != EJUSTRETURN)
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider
index f4a30e7..d20ad16 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_lookup.c        7.40 (Berkeley) %G%
+ *     @(#)ufs_lookup.c        7.41 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -365,6 +365,7 @@ searchloop:
                cnp->cn_flags |= SAVENAME;
                if (!lockparent)
                        IUNLOCK(dp);
                cnp->cn_flags |= SAVENAME;
                if (!lockparent)
                        IUNLOCK(dp);
+               return (EJUSTRETURN);
        }
        /*
         * Insert name into cache (as non-existent) if appropriate.
        }
        /*
         * Insert name into cache (as non-existent) if appropriate.
index 51bc40a..ceef54c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.80 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.81 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -678,8 +678,7 @@ relookup(dvp, vpp, cnp)
                if (*vpp != NULL)
                        panic("leaf should be empty");
 #endif
                if (*vpp != NULL)
                        panic("leaf should be empty");
 #endif
-               if (cnp->cn_nameiop == LOOKUP || cnp->cn_nameiop == DELETE ||
-                   error != ENOENT)
+               if (error != EJUSTRETURN)
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider
                        goto bad;
                /*
                 * If creating and at end of pathname, then can consider