fix
authorMiklos Szeredi <miklos@szeredi.hu>
Mon, 1 Aug 2005 13:36:53 +0000 (13:36 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Mon, 1 Aug 2005 13:36:53 +0000 (13:36 +0000)
ChangeLog
configure.in
include/fuse.h
kernel/configure.ac
kernel/dir.c

index aa6d1fd813186619d082b630c43f42b5ee8a1eee..dbf7e1ec7342e66676d6def95e40925c8eef4760 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
 
        * Add ACCESS operation.  This is called from the access() system
        call if 'default_permissions' mount option is not given
+
+       * Perform ACCESS operation in case of open(), if the file wasn't
+       newly created
  
 2005-07-28  Miklos Szeredi <miklos@szeredi.hu>
 
index 8c2ea1119c2a5acd6ea4ea87af5d9cb543b0ed11..3055b01ddf044ec1e059c2698eb2ebc3a2d48e02 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT(fuse, 2.3.1-pre1)
+AC_INIT(fuse, 2.4.0-pre0)
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(include/config.h)
 
index b7b7ef326b596774f6fea3f5ed7c6a883a0ae5c8..bb700a7498d83f1c02be027f57ca7d78d4e1f05a 100644 (file)
@@ -141,10 +141,9 @@ struct fuse_operations {
     /** File open operation
      *
      * No creation, or trunctation flags (O_CREAT, O_EXCL, O_TRUNC)
-     * will be passed to open().  Open should check if the operation
-     * is permitted for the given flags.  Optionally open may also
-     * return an arbitary filehandle in the fuse_file_info structure,
-     * which will be passed to all file operations.
+     * will be passed to open().  Optionally open may return an
+     * arbitary filehandle in the fuse_file_info structure, which will
+     * be passed to all file operations.
      *
      * Changed in version 2.2
      */
@@ -239,10 +238,7 @@ struct fuse_operations {
     /** Remove extended attributes */
     int (*removexattr) (const char *, const char *);
 
-    /** Open direcory
-     *
-     * This method should check if the open operation is permitted for
-     * this  directory
+    /** Open directory
      *
      * Introduced in version 2.3
      */
@@ -311,8 +307,10 @@ struct fuse_operations {
      * Check file access permissions
      * 
      * Need not be implemented.  Will only be called for the access()
-     * system call, and only if 'default_permissions' mount option is
-     * not given.
+     * system call, and for the open() system call, unless a new file
+     * is created (file didn't exist and O_CREAT was given).  If the
+     * 'default_permissions' mount option is given, this method is
+     * never called.
      *
      * Introduced in version 2.4
      */
index 30e4a10069e991638673126fa6e1e7359523a2b1..7e7cf2bc381964822a909cbab616f104215e8a82 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT(fuse-kernel, 2.3.1-pre1)
+AC_INIT(fuse-kernel, 2.4.0-pre0)
 AC_CONFIG_HEADERS([config.h])
 
 AC_PROG_INSTALL
index 26d2dfcfb61d592ee6449ff94a806a4f16f2899f..a7a694569dd2b015a9677d7211e4dec5ac9d0a27 100644 (file)
@@ -552,7 +552,9 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
                        return -EACCES;
 
                err = 0;
-               if (nd->flags & LOOKUP_ACCESS)
+               if (nd && 
+                   ((nd->flags & LOOKUP_ACCESS) ||
+                    ((nd->flags & LOOKUP_OPEN) && mode != 0)))
                        err = fuse_access(inode, mask);
        }
        return err;