diff --git a/src/fuse_operations.c b/src/fuse_operations.c index 3ba81cb..d9172ae 100644 --- a/src/fuse_operations.c +++ b/src/fuse_operations.c @@ -48,6 +48,12 @@ int auto_create_perm = GRANT_TEMP; +/* + * Sets the default permission granted by file creation. + * + * @param val: the default permission to grant. Should be one of GRANT_TEMP, + * GRANT_TEM and 0. When set to 0, grants no permissions. + */ void set_auto_create_perm(int val) { auto_create_perm = val; } static void *xmp_init(struct fuse_conn_info *conn, struct fuse_config *cfg) { @@ -397,8 +403,8 @@ static int xmp_chmod(const char *path, mode_t mode, struct fuse_file_info *fi) { } /** - * This filesystem is not designed for multiuser operation (e.g. with - * allow_other) so there is little point in having chown implemnted + * This filesystem is not designed for multiuser operation (with + * allow_other option) so there is little point in having chown implemnted */ static int xmp_chown(const char *path, uid_t uid, gid_t gid, struct fuse_file_info *fi) { @@ -466,8 +472,6 @@ static int xmp_create(const char *path, mode_t mode, pi = get_process_info(fc->pid); - // fprintf(stderr, "%s, %d\n", path, ask_access(path, pi)); - if (auto_create_perm != 0) { if (!interactive_access(path, pi, auto_create_perm)) { free(pi.name); diff --git a/src/fuse_operations.h b/src/fuse_operations.h index 98b3db3..674f2e6 100644 --- a/src/fuse_operations.h +++ b/src/fuse_operations.h @@ -14,6 +14,13 @@ #include const struct fuse_operations *get_fuse_operations(); + +/* + * Sets the default permission granted by file creation. + * + * @param val: the default permission to grant. Should be one of GRANT_TEMP, + * GRANT_TEM and 0. When set to 0, grants no permissions. + */ void set_auto_create_perm(int val); #endif