From: Miklos Szeredi Date: Mon, 1 Aug 2005 13:36:53 +0000 (+0000) Subject: fix X-Git-Tag: fuse_2_4_0_pre2~31 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=009b878e22fae96037da5332937c436d48d7989e;p=qemu-gpiodev%2Flibfuse.git fix --- diff --git a/ChangeLog b/ChangeLog index aa6d1fd..dbf7e1e 100644 --- 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 diff --git a/configure.in b/configure.in index 8c2ea11..3055b01 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/include/fuse.h b/include/fuse.h index b7b7ef3..bb700a7 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -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 */ diff --git a/kernel/configure.ac b/kernel/configure.ac index 30e4a10..7e7cf2b 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -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 diff --git a/kernel/dir.c b/kernel/dir.c index 26d2dfc..a7a6945 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -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;