From e40c942f3a95d513d5ff01cff18af25b06943159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 1 Oct 2010 10:41:32 +0200 Subject: [PATCH] Checked Posix ACL versions --- libntfs-3g/security.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/security.c b/libntfs-3g/security.c index ecf3ca07..138764ba 100644 --- a/libntfs-3g/security.c +++ b/libntfs-3g/security.c @@ -2995,7 +2995,9 @@ int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, count = 0; isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != const_cpu_to_le16(0); newpxdesc = (struct POSIX_SECURITY*)NULL; - if (!deflt || isdir || !size) { + if ((!value + || (((const struct POSIX_ACL*)value)->version == POSIX_VERSION)) + && (!deflt || isdir || (!size && !value))) { cached = fetch_cache(scx, ni); if (cached) { uid = cached->uid;