public inbox for linux-cifs@vger.kernel.org
 help / color / mirror / Atom feed
* cifs: Fix chmod with modefromsid when an older ACE already exists.
@ 2021-03-26 12:11 Shyam Prasad N
  2021-03-26 15:51 ` Aurélien Aptel
  0 siblings, 1 reply; 5+ messages in thread
From: Shyam Prasad N @ 2021-03-26 12:11 UTC (permalink / raw)
  To: Steve French, CIFS

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

Found a regression in modefromsid with my last fix in cifsacl.
Tested against mode check tests for both cifsacl and modefromsid this time.

-- 
Regards,
Shyam

[-- Attachment #2: 0001-cifs-Fix-chmod-with-modefromsid-when-an-older-ACE-al.patch --]
[-- Type: application/octet-stream, Size: 1245 bytes --]

From df12f866d57ec57d8e24ee9217d878b975128aa5 Mon Sep 17 00:00:00 2001
From: Shyam Prasad N <sprasad@microsoft.com>
Date: Fri, 26 Mar 2021 10:28:16 +0000
Subject: [PATCH] cifs: Fix chmod with modefromsid when an older ACE already
 exists.

My recent fixes to cifsacl to maintain inherited ACEs had
regressed modefromsid when an older ACL already exists.

The cifsacl fix that caused this regression:
cifs: Retain old ACEs when converting between mode bits and ACL.

Fixing it here.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/cifs/cifsacl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 2be22a5c690f..d178cf85e926 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -1130,8 +1130,7 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
 		}
 
 		/* If it's any one of the ACE we're replacing, skip! */
-		if (!mode_from_sid &&
-				((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
+		if (((compare_sids(&pntace->sid, &sid_unix_NFS_mode) == 0) ||
 				(compare_sids(&pntace->sid, pownersid) == 0) ||
 				(compare_sids(&pntace->sid, pgrpsid) == 0) ||
 				(compare_sids(&pntace->sid, &sid_everyone) == 0) ||
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-26 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-26 12:11 cifs: Fix chmod with modefromsid when an older ACE already exists Shyam Prasad N
2021-03-26 15:51 ` Aurélien Aptel
2021-03-26 15:54   ` Steve French
2021-03-26 16:08     ` Steve French
2021-03-26 16:10   ` Paulo Alcantara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox