From 3787dcad77a1b18c87a757ad37d81554a864d400 Mon Sep 17 00:00:00 2001 From: jpandre Date: Sat, 17 Jan 2009 14:29:15 +0000 Subject: [PATCH] Fixed checking access to parent directory for removing an extended attribute --- src/ntfs-3g.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index dd51d3e4..2edaa8d8 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -4,7 +4,7 @@ * Copyright (c) 2005-2007 Yura Pakhuchiy * Copyright (c) 2005 Yuval Fledel * Copyright (c) 2006-2008 Szabolcs Szakacsits - * Copyright (c) 2007-2008 Jean-Pierre Andre + * Copyright (c) 2007-2009 Jean-Pierre Andre * * This file is originated from the Linux-NTFS project. * @@ -2365,6 +2365,13 @@ static int ntfs_fuse_removexattr(const char *path, const char *name) if (strncmp(name, nf_ns_xattr_preffix, nf_ns_xattr_preffix_len) || strlen(name) == (size_t)nf_ns_xattr_preffix_len) return -ENODATA; +#if POSIXACLS + /* parent directory must be executable */ + if (ntfs_fuse_fill_security_context(&security) + && !ntfs_allowed_dir_access(&security,path,S_IEXEC)) { + return (-errno); + } +#endif ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni) return -errno;