Commit b7924cdd authored by Marc Vef's avatar Marc Vef
Browse files

chown() chmod() skeletons added

parent 2746d486
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -33,9 +33,13 @@ int adafs_truncate(const char* p, off_t offset, struct fuse_file_info* fi);
//
int adafs_flush(const char* p, struct fuse_file_info* fi);

// permissions
// access
int adafs_access(const char* p, int mask);

int adafs_chmod(const char* p, mode_t mode, struct fuse_file_info* fi);

int adafs_chown(const char* p, uid_t uid, gid_t gid, struct fuse_file_info* fi);

// file system miscellaneous
int adafs_statfs(const char* p, struct statvfs* statvfs);

+25 −0
Original line number Diff line number Diff line
@@ -30,3 +30,28 @@ int adafs_access(const char* p, int mask) {
    return chk_access(*md, mask);
}

/** Change the permission bits of a file
 *
 * `fi` will always be NULL if the file is not currenly open, but
 * may also be NULL if the file is open.
 */
int adafs_chmod(const char* p, mode_t mode, struct fuse_file_info* fi) {
    ADAFS_DATA->logger->info("##### FUSE FUNC ###### adafs_chmod() enter: name '{}' mode {}", p, mode);


    return 0;
}

/** Change the owner and group of a file
 *
 * `fi` will always be NULL if the file is not currenly open, but
 * may also be NULL if the file is open.
 *
 * Unless FUSE_CAP_HANDLE_KILLPRIV is disabled, this method is
 * expected to reset the setuid and setgid bits.
 */
int adafs_chown(const char* p, uid_t uid, gid_t gid, struct fuse_file_info* fi) {
    ADAFS_DATA->logger->info("##### FUSE FUNC ###### adafs_chown() enter: name '{}' uid {} gid {}", p, uid, gid);

    return 0;
}
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -90,8 +90,10 @@ static void init_adafs_ops(fuse_operations* ops) {

    ops->flush = adafs_flush;

    // access
    // permission
    ops->access = adafs_access;
    ops->chmod = adafs_chmod;
    ops->chown = adafs_chown;

    ops->init = adafs_init;
    ops->destroy = adafs_destroy;