linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
@ 2019-06-24  7:11 Steve French
  2019-06-24 18:23 ` Steve French
  2019-06-24 19:06 ` Pavel Shilovsky
  0 siblings, 2 replies; 8+ messages in thread
From: Steve French @ 2019-06-24  7:11 UTC (permalink / raw)
  To: CIFS

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

See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)

where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.

Followon patches will add the support for chmod and query_info (stat)



-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-add-new-mount-option-to-retrieve-mode-from-spec.patch --]
[-- Type: text/x-patch, Size: 3763 bytes --]

From 952f30b31c903f8f6f4ca023061c108d16cc6df6 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 24 Jun 2019 02:01:42 -0500
Subject: [PATCH] smb3: add new mount option to retrieve mode from special ACE

There is a special ACE used by some servers to allow the mode
bits to be stored.  This can be especially helpful in scenarios
in which the client is trusted, and access checking on the
client vs the POSIX mode bits is sufficient.

Add mount option to allow enabling this behavior.
Follow on patch will add the support to add chmod and queryinfo
(stat) support for retrieving the POSIX mode bits from the
special ACE, SID: S-1-5-88-3

See e.g.
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/cifs_fs_sb.h | 1 +
 fs/cifs/cifsfs.c     | 2 ++
 fs/cifs/cifsglob.h   | 2 +-
 fs/cifs/connect.c    | 6 ++++++
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index afa56237a0c3..744e48bdcb6c 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -52,6 +52,7 @@
 #define CIFS_MOUNT_UID_FROM_ACL 0x2000000 /* try to get UID via special SID */
 #define CIFS_MOUNT_NO_HANDLE_CACHE 0x4000000 /* disable caching dir handles */
 #define CIFS_MOUNT_NO_DFS 0x8000000 /* disable DFS resolving */
+#define CIFS_MOUNT_MODE_FROM_ACE 0x10000000 /* retrieve mode from special ACE */
 
 struct cifs_sb_info {
 	struct rb_root tlink_tree;
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index dc5fd7a648f0..e33da73bd300 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -526,6 +526,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
 		seq_puts(s, ",nobrl");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_HANDLE_CACHE)
 		seq_puts(s, ",nohandlecache");
+	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_ACE)
+		seq_puts(s, ",modefromace");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
 		seq_puts(s, ",cifsacl");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 16f240911192..2c87547e42ab 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -618,7 +618,7 @@ struct smb_vol {
 			 CIFS_MOUNT_MULTIUSER | CIFS_MOUNT_STRICT_IO | \
 			 CIFS_MOUNT_CIFS_BACKUPUID | CIFS_MOUNT_CIFS_BACKUPGID | \
 			 CIFS_MOUNT_UID_FROM_ACL | CIFS_MOUNT_NO_HANDLE_CACHE | \
-			 CIFS_MOUNT_NO_DFS)
+			 CIFS_MOUNT_NO_DFS | CIFS_MOUNT_MODE_FROM_ACE)
 
 /**
  * Generic VFS superblock mount flags (s_flags) to consider when
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b8a60060d329..f7bc85775f96 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -175,6 +175,7 @@ static const match_table_t cifs_mount_option_tokens = {
 	{ Opt_serverino, "serverino" },
 	{ Opt_noserverino, "noserverino" },
 	{ Opt_rwpidforward, "rwpidforward" },
+	{ Opt_modeace, "modefromace" },
 	{ Opt_cifsacl, "cifsacl" },
 	{ Opt_nocifsacl, "nocifsacl" },
 	{ Opt_acl, "acl" },
@@ -1830,6 +1831,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
 		case Opt_rwpidforward:
 			vol->rwpidforward = 1;
 			break;
+		case Opt_modeace:
+			vol->mode_ace = 1;
+			break;
 		case Opt_cifsacl:
 			vol->cifs_acl = 1;
 			break;
@@ -3976,6 +3980,8 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL;
 	if (pvolume_info->rwpidforward)
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RWPIDFORWARD;
+	if (pvolume_info->mode_ace)
+		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MODE_FROM_ACE;
 	if (pvolume_info->cifs_acl)
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_ACL;
 	if (pvolume_info->backupuid_specified) {
-- 
2.20.1


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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24  7:11 [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE Steve French
@ 2019-06-24 18:23 ` Steve French
  2019-06-24 21:36   ` ronnie sahlberg
  2019-06-24 19:06 ` Pavel Shilovsky
  1 sibling, 1 reply; 8+ messages in thread
From: Steve French @ 2019-06-24 18:23 UTC (permalink / raw)
  To: CIFS

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

I missed a couple lines in the earlier version of this patch that I
sent last night - updated one attached.


On Mon, Jun 24, 2019 at 2:11 AM Steve French <smfrench@gmail.com> wrote:
>
> See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
>
> where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
>
> Followon patches will add the support for chmod and query_info (stat)
>
>
>
> --
> Thanks,
>
> Steve



-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-add-new-mount-option-to-retrieve-mode-from-spec.patch --]
[-- Type: text/x-patch, Size: 4327 bytes --]

From 0576e2962ca7b30521c236f3d0fd7cea9ff55e1b Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 24 Jun 2019 02:01:42 -0500
Subject: [PATCH] smb3: add new mount option to retrieve mode from special ACE

There is a special ACE used by some servers to allow the mode
bits to be stored.  This can be especially helpful in scenarios
in which the client is trusted, and access checking on the
client vs the POSIX mode bits is sufficient.

Add mount option to allow enabling this behavior.
Follow on patch will add support for chmod and queryinfo
(stat) by retrieving the POSIX mode bits from the special
ACE, SID: S-1-5-88-3

See e.g.
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/cifs_fs_sb.h | 1 +
 fs/cifs/cifsfs.c     | 2 ++
 fs/cifs/cifsglob.h   | 3 ++-
 fs/cifs/connect.c    | 8 +++++++-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index afa56237a0c3..744e48bdcb6c 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -52,6 +52,7 @@
 #define CIFS_MOUNT_UID_FROM_ACL 0x2000000 /* try to get UID via special SID */
 #define CIFS_MOUNT_NO_HANDLE_CACHE 0x4000000 /* disable caching dir handles */
 #define CIFS_MOUNT_NO_DFS 0x8000000 /* disable DFS resolving */
+#define CIFS_MOUNT_MODE_FROM_ACE 0x10000000 /* retrieve mode from special ACE */
 
 struct cifs_sb_info {
 	struct rb_root tlink_tree;
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index dc5fd7a648f0..e33da73bd300 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -526,6 +526,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
 		seq_puts(s, ",nobrl");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_HANDLE_CACHE)
 		seq_puts(s, ",nohandlecache");
+	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_ACE)
+		seq_puts(s, ",modefromace");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
 		seq_puts(s, ",cifsacl");
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 16f240911192..90867264ba4e 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -550,6 +550,7 @@ struct smb_vol {
 	bool override_gid:1;
 	bool dynperm:1;
 	bool noperm:1;
+	bool mode_ace:1;
 	bool no_psx_acl:1; /* set if posix acl support should be disabled */
 	bool cifs_acl:1;
 	bool backupuid_specified; /* mount option  backupuid  is specified */
@@ -618,7 +619,7 @@ struct smb_vol {
 			 CIFS_MOUNT_MULTIUSER | CIFS_MOUNT_STRICT_IO | \
 			 CIFS_MOUNT_CIFS_BACKUPUID | CIFS_MOUNT_CIFS_BACKUPGID | \
 			 CIFS_MOUNT_UID_FROM_ACL | CIFS_MOUNT_NO_HANDLE_CACHE | \
-			 CIFS_MOUNT_NO_DFS)
+			 CIFS_MOUNT_NO_DFS | CIFS_MOUNT_MODE_FROM_ACE)
 
 /**
  * Generic VFS superblock mount flags (s_flags) to consider when
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b8a60060d329..54e2b2652c3d 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -96,7 +96,7 @@ enum {
 	Opt_multiuser, Opt_sloppy, Opt_nosharesock,
 	Opt_persistent, Opt_nopersistent,
 	Opt_resilient, Opt_noresilient,
-	Opt_domainauto, Opt_rdma,
+	Opt_domainauto, Opt_rdma, Opt_modeace,
 
 	/* Mount options which take numeric value */
 	Opt_backupuid, Opt_backupgid, Opt_uid,
@@ -175,6 +175,7 @@ static const match_table_t cifs_mount_option_tokens = {
 	{ Opt_serverino, "serverino" },
 	{ Opt_noserverino, "noserverino" },
 	{ Opt_rwpidforward, "rwpidforward" },
+	{ Opt_modeace, "modefromace" },
 	{ Opt_cifsacl, "cifsacl" },
 	{ Opt_nocifsacl, "nocifsacl" },
 	{ Opt_acl, "acl" },
@@ -1830,6 +1831,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
 		case Opt_rwpidforward:
 			vol->rwpidforward = 1;
 			break;
+		case Opt_modeace:
+			vol->mode_ace = 1;
+			break;
 		case Opt_cifsacl:
 			vol->cifs_acl = 1;
 			break;
@@ -3976,6 +3980,8 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL;
 	if (pvolume_info->rwpidforward)
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RWPIDFORWARD;
+	if (pvolume_info->mode_ace)
+		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MODE_FROM_ACE;
 	if (pvolume_info->cifs_acl)
 		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_ACL;
 	if (pvolume_info->backupuid_specified) {
-- 
2.20.1


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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24  7:11 [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE Steve French
  2019-06-24 18:23 ` Steve French
@ 2019-06-24 19:06 ` Pavel Shilovsky
  2019-06-24 20:25   ` Steve French
  1 sibling, 1 reply; 8+ messages in thread
From: Pavel Shilovsky @ 2019-06-24 19:06 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS

Can't we use the existing idfromsid for this purpose? We already have
a plenty of mount options and the list keeps growing.

--
Best regards,
Pavel Shilovsky

пн, 24 июн. 2019 г. в 00:20, Steve French <smfrench@gmail.com>:
>
> See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
>
> where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
>
> Followon patches will add the support for chmod and query_info (stat)
>
>
>
> --
> Thanks,
>
> Steve

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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24 19:06 ` Pavel Shilovsky
@ 2019-06-24 20:25   ` Steve French
  2019-07-04 20:52     ` Pavel Shilovsky
  2019-07-04 22:03     ` Aurélien Aptel
  0 siblings, 2 replies; 8+ messages in thread
From: Steve French @ 2019-06-24 20:25 UTC (permalink / raw)
  To: Pavel Shilovsky; +Cc: CIFS

On Mon, Jun 24, 2019 at 2:07 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> Can't we use the existing idfromsid for this purpose? We already have
> a plenty of mount options and the list keeps growing.

That is a good question - and I am open to suggestions to remove some
mount options but
the general problem is that that mount option name could be very confusing -
"idsfromsid" doesn't really imply anything about how we handle
mode bits (we could save mode bits even if saving uid owner without
using the "idsfromsid"
mechanism) we want to allow:

1) query mode from special sid if present
or
2) query mode from ACL (only check for perms on the three
user-owner/group-owner/EVERYONE SIDs), in this case we may chose to
mount noperm
or
3) the default today - we set mode for files and directories to the
permissions supplied as "file_mode" and "dir_mode")
We by default do:
      vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
and we can mount with noperm to disable the client perm checks if the
checks on the client are not useful
or
4) set the permissions (temporarily) locally only and cache them
(dynperm) - typically not recommended.

Where I would like to get to is that we focus strongly on only the
first two common use cases:
1) "client focused perm checks"   -  get/set mode from special SID
(server permission checks are not important in this case)
2) "server focused perm checks" - get/set the three ACEs
(user-owner/group-owner/EVERYONE) in the ACL

I would like to default to idsfromsid (setting the owner with  if
looking up owner from Winbind or SSSD or falling back
to S-1-22-1 (Unmapped user's special SID) or S-1-5-88-1  (MS-NFS and
Apple style unmapped user's special SID).

In a way I would like to remove "idsfromsid" (and do it by default),
and add the new mount point to distinguish between

"client centric" mode bit evaluation (special mode SID)
vs.
"server centric" ACL evaluation (where mode bits are mapped into the 3
usual ACEs - user/group/other)



> пн, 24 июн. 2019 г. в 00:20, Steve French <smfrench@gmail.com>:
> >
> > See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
> >
> > where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
> >
> > Followon patches will add the support for chmod and query_info (stat)
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve



-- 
Thanks,

Steve

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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24 18:23 ` Steve French
@ 2019-06-24 21:36   ` ronnie sahlberg
  0 siblings, 0 replies; 8+ messages in thread
From: ronnie sahlberg @ 2019-06-24 21:36 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS

Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>

On Tue, Jun 25, 2019 at 7:22 AM Steve French <smfrench@gmail.com> wrote:
>
> I missed a couple lines in the earlier version of this patch that I
> sent last night - updated one attached.
>
>
> On Mon, Jun 24, 2019 at 2:11 AM Steve French <smfrench@gmail.com> wrote:
> >
> > See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
> >
> > where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
> >
> > Followon patches will add the support for chmod and query_info (stat)
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve
>
>
>
> --
> Thanks,
>
> Steve

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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24 20:25   ` Steve French
@ 2019-07-04 20:52     ` Pavel Shilovsky
  2019-07-06  2:11       ` Steve French
  2019-07-04 22:03     ` Aurélien Aptel
  1 sibling, 1 reply; 8+ messages in thread
From: Pavel Shilovsky @ 2019-07-04 20:52 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS

These are good points and I agree with the plan.

I would rename the option:

"modefromace" -> ""modefromsid"

to make the naming consistent with the existing "idsfromsid" and match
the behavior closely: a mode is still technically from the special SID
and that SID is from the special ACE. Other than that the patch looks
good.

--
Best regards,
Pavel Shilovsky

пн, 24 июн. 2019 г. в 13:25, Steve French <smfrench@gmail.com>:
>
> On Mon, Jun 24, 2019 at 2:07 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
> >
> > Can't we use the existing idfromsid for this purpose? We already have
> > a plenty of mount options and the list keeps growing.
>
> That is a good question - and I am open to suggestions to remove some
> mount options but
> the general problem is that that mount option name could be very confusing -
> "idsfromsid" doesn't really imply anything about how we handle
> mode bits (we could save mode bits even if saving uid owner without
> using the "idsfromsid"
> mechanism) we want to allow:
>
> 1) query mode from special sid if present
> or
> 2) query mode from ACL (only check for perms on the three
> user-owner/group-owner/EVERYONE SIDs), in this case we may chose to
> mount noperm
> or
> 3) the default today - we set mode for files and directories to the
> permissions supplied as "file_mode" and "dir_mode")
> We by default do:
>       vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
> and we can mount with noperm to disable the client perm checks if the
> checks on the client are not useful
> or
> 4) set the permissions (temporarily) locally only and cache them
> (dynperm) - typically not recommended.
>
> Where I would like to get to is that we focus strongly on only the
> first two common use cases:
> 1) "client focused perm checks"   -  get/set mode from special SID
> (server permission checks are not important in this case)
> 2) "server focused perm checks" - get/set the three ACEs
> (user-owner/group-owner/EVERYONE) in the ACL
>
> I would like to default to idsfromsid (setting the owner with  if
> looking up owner from Winbind or SSSD or falling back
> to S-1-22-1 (Unmapped user's special SID) or S-1-5-88-1  (MS-NFS and
> Apple style unmapped user's special SID).
>
> In a way I would like to remove "idsfromsid" (and do it by default),
> and add the new mount point to distinguish between
>
> "client centric" mode bit evaluation (special mode SID)
> vs.
> "server centric" ACL evaluation (where mode bits are mapped into the 3
> usual ACEs - user/group/other)
>
>
>
> > пн, 24 июн. 2019 г. в 00:20, Steve French <smfrench@gmail.com>:
> > >
> > > See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
> > >
> > > where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
> > >
> > > Followon patches will add the support for chmod and query_info (stat)
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Steve
>
>
>
> --
> Thanks,
>
> Steve

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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-06-24 20:25   ` Steve French
  2019-07-04 20:52     ` Pavel Shilovsky
@ 2019-07-04 22:03     ` Aurélien Aptel
  1 sibling, 0 replies; 8+ messages in thread
From: Aurélien Aptel @ 2019-07-04 22:03 UTC (permalink / raw)
  To: Steve French, Pavel Shilovsky; +Cc: CIFS

Steve French <smfrench@gmail.com> writes:
> Where I would like to get to is that we focus strongly on only the
> first two common use cases:
> 1) "client focused perm checks"   -  get/set mode from special SID
> (server permission checks are not important in this case)
> 2) "server focused perm checks" - get/set the three ACEs
> (user-owner/group-owner/EVERYONE) in the ACL

The 2) part is not really documented and is more complex than it
seems. We know how the SID are created but not the actual ACL/ACE for
each SID. I've almost completely reversed engineered it (except for the
one bit).

I've documented all here: https://github.com/aaptel/nfs-acl-test

The is one permission -- the S (SYNCHRONIZE) flag -- which doesn't seem
to be consistent in how it is granted/denied. But its purpose is not
clear on files/dir so it's probably irrelevant: we just need to
reimplement the unix_to_acl() func that I wrote.

I've contacted dochelp regarding this, and here is what they have to
say (note "UUUA" is Unmapped UNIX User Access):

>  I have been combing the source and could not find where a mapping is done yet for the mode
>  you are asking about.
>
> ...
>
>  After conferring with our NFS experts, the key perspective that I’d like to share is that
>  we do document (outside of the protocol documents) that UUUA is intended for an end-to-end
>  NFS-only access.
>  The UUUA mode is intended for use when the Windows NFS Server is the only accessor to the
>  files. We make no statements as to the behavior of any other accessor or how they
>  can/should decode the DACL. 
>  We do not expect a client to ever come across the NFS specific DACL in a well configured
>  system. 
>  With that perspective, we had some archived content which describes some “Mapping of NFS
>  Mode Bits to Windows ACL”. To understand part of what Windows does under the hood, you
>  many find useful to consult the obsoleted [MS-FSSO] which is under Windows Protocols
>  Archive Documents. Keep in mind that archived documents are for “convenience” only. We do
>  not answer questions or service those types of documents. 
>  [MS-FSSO]: File Access Services System Overview
>  https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/WinArchive/%5bMS-FSSO%5d.pdf

Cheers,

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)

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

* Re: [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE
  2019-07-04 20:52     ` Pavel Shilovsky
@ 2019-07-06  2:11       ` Steve French
  0 siblings, 0 replies; 8+ messages in thread
From: Steve French @ 2019-07-06  2:11 UTC (permalink / raw)
  To: Pavel Shilovsky; +Cc: CIFS

Updated "modefromace" to "modefromsid"

On Thu, Jul 4, 2019 at 3:52 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
>
> These are good points and I agree with the plan.
>
> I would rename the option:
>
> "modefromace" -> ""modefromsid"
>
> to make the naming consistent with the existing "idsfromsid" and match
> the behavior closely: a mode is still technically from the special SID
> and that SID is from the special ACE. Other than that the patch looks
> good.
>
> --
> Best regards,
> Pavel Shilovsky
>
> пн, 24 июн. 2019 г. в 13:25, Steve French <smfrench@gmail.com>:
> >
> > On Mon, Jun 24, 2019 at 2:07 PM Pavel Shilovsky <piastryyy@gmail.com> wrote:
> > >
> > > Can't we use the existing idfromsid for this purpose? We already have
> > > a plenty of mount options and the list keeps growing.
> >
> > That is a good question - and I am open to suggestions to remove some
> > mount options but
> > the general problem is that that mount option name could be very confusing -
> > "idsfromsid" doesn't really imply anything about how we handle
> > mode bits (we could save mode bits even if saving uid owner without
> > using the "idsfromsid"
> > mechanism) we want to allow:
> >
> > 1) query mode from special sid if present
> > or
> > 2) query mode from ACL (only check for perms on the three
> > user-owner/group-owner/EVERYONE SIDs), in this case we may chose to
> > mount noperm
> > or
> > 3) the default today - we set mode for files and directories to the
> > permissions supplied as "file_mode" and "dir_mode")
> > We by default do:
> >       vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR;
> > and we can mount with noperm to disable the client perm checks if the
> > checks on the client are not useful
> > or
> > 4) set the permissions (temporarily) locally only and cache them
> > (dynperm) - typically not recommended.
> >
> > Where I would like to get to is that we focus strongly on only the
> > first two common use cases:
> > 1) "client focused perm checks"   -  get/set mode from special SID
> > (server permission checks are not important in this case)
> > 2) "server focused perm checks" - get/set the three ACEs
> > (user-owner/group-owner/EVERYONE) in the ACL
> >
> > I would like to default to idsfromsid (setting the owner with  if
> > looking up owner from Winbind or SSSD or falling back
> > to S-1-22-1 (Unmapped user's special SID) or S-1-5-88-1  (MS-NFS and
> > Apple style unmapped user's special SID).
> >
> > In a way I would like to remove "idsfromsid" (and do it by default),
> > and add the new mount point to distinguish between
> >
> > "client centric" mode bit evaluation (special mode SID)
> > vs.
> > "server centric" ACL evaluation (where mode bits are mapped into the 3
> > usual ACEs - user/group/other)
> >
> >
> >
> > > пн, 24 июн. 2019 г. в 00:20, Steve French <smfrench@gmail.com>:
> > > >
> > > > See e.g. https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh509017(v=ws.10)
> > > >
> > > > where it describes use of an ACE with special SID S-1-5-88-3 to store the mode.
> > > >
> > > > Followon patches will add the support for chmod and query_info (stat)
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Steve
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve



-- 
Thanks,

Steve

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

end of thread, other threads:[~2019-07-06  2:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24  7:11 [SMB3][PATCH] add mount option to allow retrieving POSIX mode from special ACE Steve French
2019-06-24 18:23 ` Steve French
2019-06-24 21:36   ` ronnie sahlberg
2019-06-24 19:06 ` Pavel Shilovsky
2019-06-24 20:25   ` Steve French
2019-07-04 20:52     ` Pavel Shilovsky
2019-07-06  2:11       ` Steve French
2019-07-04 22:03     ` Aurélien Aptel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).