X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fmount.c;h=834d5855303d7b42c59f3afa71e2696980312c99;hp=b9da36e172f5f1e5e11702a56325db4f57941409;hb=1596d7ad7bf93f0e326b070a173a59004ab9b649;hpb=eb8d4725743de9b18d739dc436251f2c529cdfcb diff --git a/src/mount.c b/src/mount.c index b9da36e1..834d5855 100644 --- a/src/mount.c +++ b/src/mount.c @@ -746,6 +746,28 @@ static int wimfs_access(const char *path, int mask) return 0; } +static int wimfs_chmod(const char *path, mode_t mask) +{ + struct dentry *dentry; + struct wimfs_context *ctx = wimfs_get_context(); + struct inode *inode; + struct stat stbuf; + int ret; + + ret = lookup_resource(ctx->wim, path, + get_lookup_flags(ctx) | LOOKUP_FLAG_DIRECTORY_OK, + &dentry, NULL, NULL); + if (ret != 0) + return ret; + inode = dentry->d_inode; + inode_to_stbuf(inode, NULL, &stbuf); + if (mask == stbuf.st_mode) + return 0; + else + return -EPERM; + +} + static void inode_update_lte_ptr(struct inode *inode, struct lookup_table_entry *old_lte, struct lookup_table_entry *new_lte) @@ -1747,6 +1769,7 @@ static int wimfs_write(const char *path, const char *buf, size_t size, static struct fuse_operations wimfs_operations = { .access = wimfs_access, + .chmod = wimfs_chmod, .destroy = wimfs_destroy, #if 0 .fallocate = wimfs_fallocate,