[PATCHES] Small cleanup for nfs4_acls.c

Christof Schmitt cs at samba.org
Mon Aug 24 18:59:00 UTC 2015


On Mon, Aug 24, 2015 at 07:25:24AM +0200, Volker Lendecke wrote:
> On Sun, Aug 23, 2015 at 10:00:24PM -0700, Christof Schmitt wrote:
> > On Sun, Aug 23, 2015 at 09:53:10PM +0200, Ralph Boehme wrote:
> > > Hi Christof,
> > > 
> > > all reviewed-by: me.
> > > 
> > > -Ralph
> > 
> > Thank you. Pushed to autobuild.
> 
> I had pushed them too. But for me they failed to build
> because nfs4acls can't find sid2gid & friends. Does that
> succeed for you?

It only worked since i forgot to enable the picky checks in the build.
The problem was the removal of the passdb/lookup_sid.h include that is
still required. See the attached updated patches.

Christof
-------------- next part --------------
From 1f966157f3415040439bb289ddafea528caa7bbf Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Thu, 13 Aug 2015 11:03:48 -0700
Subject: [PATCH 1/3] nfs4_acl: Remove unused includes

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 source3/modules/nfs4_acls.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 26a98b7..797fd7f 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -23,11 +23,8 @@
 #include "librpc/gen_ndr/ndr_security.h"
 #include "../libcli/security/dom_sid.h"
 #include "../libcli/security/security.h"
-#include "dbwrap/dbwrap.h"
-#include "dbwrap/dbwrap_open.h"
 #include "system/filesys.h"
 #include "passdb/lookup_sid.h"
-#include "util_tdb.h"
 #include "lib/param/loadparm.h"
 
 #undef DBGC_CLASS
-- 
1.7.1


From 309bdfcb98594a70b04d8d5b3b9c337d652a94f5 Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Thu, 13 Aug 2015 11:09:03 -0700
Subject: [PATCH 2/3] nfs4acl: Print unknown config settings as a warning

While touching the messages, also remove the use of the unneeded define
for "nfs4".

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 source3/modules/nfs4_acls.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 797fd7f..04445c4 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -85,8 +85,7 @@ static int smbacl4_get_vfs_params(
 	enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "mode",
 			       enum_smbacl4_modes, e_simple);
 	if (enumval == -1) {
-		DEBUG(10, ("value for %s:mode unknown\n",
-			   SMBACL4_PARAM_TYPE_NAME));
+		DBG_WARNING("value for nfs4:mode unknown\n");
 		return -1;
 	}
 	params->mode = (enum smbacl4_mode_enum)enumval;
@@ -97,8 +96,7 @@ static int smbacl4_get_vfs_params(
 	enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "acedup",
 			       enum_smbacl4_acedups, e_dontcare);
 	if (enumval == -1) {
-		DEBUG(10, ("value for %s:acedup unknown\n",
-			   SMBACL4_PARAM_TYPE_NAME));
+		DBG_WARNING("value for nfs4:acedup unknown\n");
 		return -1;
 	}
 	params->acedup = (enum smbacl4_acedup_enum)enumval;
-- 
1.7.1


From 84cac498b0e61e90316e644c6fabaa6b1d1d51a5 Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Thu, 13 Aug 2015 11:10:42 -0700
Subject: [PATCH 3/3] nfs4acl: Remove SMBACL4_PARAM_TYPE_NAME

Use "nfs4" instead, which is easier to read in the code.

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 source3/modules/nfs4_acls.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 04445c4..39b21c2 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -30,8 +30,6 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_ACLS
 
-#define SMBACL4_PARAM_TYPE_NAME "nfs4"
-
 extern const struct generic_mapping file_generic_mapping;
 
 struct SMB4ACE_T
@@ -82,7 +80,7 @@ static int smbacl4_get_vfs_params(
 
 	ZERO_STRUCTP(params);
 
-	enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "mode",
+	enumval = lp_parm_enum(SNUM(conn), "nfs4", "mode",
 			       enum_smbacl4_modes, e_simple);
 	if (enumval == -1) {
 		DBG_WARNING("value for nfs4:mode unknown\n");
@@ -90,10 +88,9 @@ static int smbacl4_get_vfs_params(
 	}
 	params->mode = (enum smbacl4_mode_enum)enumval;
 
-	params->do_chown = lp_parm_bool(SNUM(conn), SMBACL4_PARAM_TYPE_NAME,
-		"chown", true);
+	params->do_chown = lp_parm_bool(SNUM(conn), "nfs4", "chown", true);
 
-	enumval = lp_parm_enum(SNUM(conn), SMBACL4_PARAM_TYPE_NAME, "acedup",
+	enumval = lp_parm_enum(SNUM(conn), "nfs4", "acedup",
 			       enum_smbacl4_acedups, e_dontcare);
 	if (enumval == -1) {
 		DBG_WARNING("value for nfs4:acedup unknown\n");
-- 
1.7.1



More information about the samba-technical mailing list