Add description to set_auto_perm

This commit is contained in:
fedir 2025-05-23 19:14:18 +02:00
parent 77775e4097
commit 9b0eb10965
Signed by: fedir
GPG Key ID: C959EE85F0C9362C
2 changed files with 15 additions and 4 deletions

View File

@ -48,6 +48,12 @@
int auto_create_perm = GRANT_TEMP; 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; } void set_auto_create_perm(int val) { auto_create_perm = val; }
static void *xmp_init(struct fuse_conn_info *conn, struct fuse_config *cfg) { 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 * This filesystem is not designed for multiuser operation (with
* allow_other) so there is little point in having chown implemnted * 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, static int xmp_chown(const char *path, uid_t uid, gid_t gid,
struct fuse_file_info *fi) { 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); pi = get_process_info(fc->pid);
// fprintf(stderr, "%s, %d\n", path, ask_access(path, pi));
if (auto_create_perm != 0) { if (auto_create_perm != 0) {
if (!interactive_access(path, pi, auto_create_perm)) { if (!interactive_access(path, pi, auto_create_perm)) {
free(pi.name); free(pi.name);

View File

@ -14,6 +14,13 @@
#include <fuse3/fuse.h> #include <fuse3/fuse.h>
const struct fuse_operations *get_fuse_operations(); 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); void set_auto_create_perm(int val);
#endif #endif