From: Eric Biggers Date: Sun, 28 Apr 2013 03:29:49 +0000 (-0500) Subject: mount_image.c: Use fuse_context.umask only when available X-Git-Tag: v1.3.3~15 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=b5238e5a022184cbc13ebf510bc5081140867abe;hp=b7fe0893537f2fc6a28a5beae2399af7b65efd74 mount_image.c: Use fuse_context.umask only when available --- diff --git a/src/mount_image.c b/src/mount_image.c index 66e668af..bd27a46a 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -347,6 +347,15 @@ close_wimfs_fd(struct wimfs_fd *fd) return 0; } +static mode_t +fuse_mask_mode(mode_t mode, struct fuse_context *fuse_ctx) +{ +#if FUSE_MAJOR_VERSION > 2 || (FUSE_MAJOR_VERSION == 2 && FUSE_MINOR_VERSION >= 8) + mode &= ~fuse_ctx->umask; +#endif + return mode; +} + /* * Add a new dentry with a new inode to a WIM image. * @@ -385,7 +394,7 @@ create_dentry(struct fuse_context *fuse_ctx, const char *path, if (inode_set_unix_data(new->d_inode, fuse_ctx->uid, fuse_ctx->gid, - mode & ~fuse_ctx->umask, + fuse_mask_mode(mode, fuse_ctx), wimfs_ctx->wim->lookup_table, UNIX_DATA_ALL | UNIX_DATA_CREATE)) {