[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Apr 26 22:39:01 UTC 2022


The branch, master has been updated
       via  eed6869da75 smbd: Slightly simplify call_trans2qpipeinfo()
       via  f2eee5c5b31 smbd: Remove unused arguments from dup_file_fsp()
       via  734e4377550 smbd: fd_handle.h does not need includes.h
       via  54050236963 ldb: Avoid an "else"
       via  6bf8243cc7e lib: Remove smb_threads from includes.h
       via  fb36f23a201 lib: Remove an unneeded includes.h
       via  5f2ef356b2c lib: Remove an unneeded includes.h
       via  8a3e3a0d603 lib: Remove an unneeded includes.h
       via  aa27b6626d4 lib: Remove an unneeded includes.h
       via  d2f3ac2fb7a lib: Remove an unused includes.h
       via  ce0f483a291 passdb: Introduce helper variables in make_pdb_method_name()
       via  9ab0f91b349 passdb: Split lines in make_pdb_method_name()
       via  894a1c19364 ldb: Introduce "colon" variable in ldb_module_connect_backend()
       via  41a9d958a69 ldb: Save a few lines with TALLOC_FREE()
       via  ef846e660a2 ldb: Avoid "==true/false" in a boolean expression
       via  4ef1b0963c9 ldap_server: Fix typos
       via  22032eefdb7 passdb: Fix a typo
       via  cdef977031e dsdb: Fix a typo
       via  830b561cc9b vfs: Remove unused last_lock_failure from files_struct
      from  28fc44f2852 s3:passdb: Also allow to handle UPNs in lookup_name_smbconf()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit eed6869da75c299a4551db0853eb70ba9633a5d0
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 21 15:48:09 2022 +0200

    smbd: Slightly simplify call_trans2qpipeinfo()
    
    Pass down "fsp" and "info_level", no need to parse this inside
    call_trans2qpipeinfo() when the caller also has to do it.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Apr 26 22:38:59 UTC 2022 on sn-devel-184

commit f2eee5c5b3179315c12c7ed2b509c43f636c19e3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 23 14:01:33 2022 +0200

    smbd: Remove unused arguments from dup_file_fsp()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 734e43775509f9a23b7d97eecf5b095167a4694c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Apr 21 12:20:20 2022 +0200

    smbd: fd_handle.h does not need includes.h
    
    Move includes.h for struct files_struct to fd_handle.c. Both
    printing.c and smb1_utils.c depended on fd_handle.h to include the
    prototypes. Do that explicitly in those files.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 540502369633ed163b682af916e94019907024d7
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 20 07:53:38 2022 +0200

    ldb: Avoid an "else"
    
    We return in the if-branch, easier to read this way.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6bf8243cc7e49be07cc0f30b61581908df8ae7d9
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 21:24:36 2022 +0200

    lib: Remove smb_threads from includes.h
    
    Only used in libsmb_context.c
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fb36f23a201b057f1f6851bc6b65714c0ccb364e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 21:30:08 2022 +0200

    lib: Remove an unneeded includes.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 5f2ef356b2c89383b4cfb4a7fcc1bde868461144
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 21:21:57 2022 +0200

    lib: Remove an unneeded includes.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 8a3e3a0d6034f206a8517c6b1ea5b4eec47ee5e0
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 21:17:17 2022 +0200

    lib: Remove an unneeded includes.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit aa27b6626d47bd8ccb8d8172512842e6b3897df4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 21:07:30 2022 +0200

    lib: Remove an unneeded includes.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d2f3ac2fb7a41825f85f9ca3102b61cad4f77430
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 19 20:55:03 2022 +0200

    lib: Remove an unused includes.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ce0f483a291ac01a6fc8ee3a94fddc485b24c808
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 9 08:59:43 2022 +0200

    passdb: Introduce helper variables in make_pdb_method_name()
    
    Easier debugging
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9ab0f91b349c80f9cce32216c329798150b30f93
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 9 09:18:52 2022 +0200

    passdb: Split lines in make_pdb_method_name()
    
    Looks nicer
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 894a1c19364f21c56ee8e88fb11ecd38848df50e
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 9 08:15:54 2022 +0200

    ldb: Introduce "colon" variable in ldb_module_connect_backend()
    
    Easier debugging, avoid a second call to strchr()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 41a9d958a6974b9bc8896c0d3c66fc29f9c02cff
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 9 09:32:58 2022 +0200

    ldb: Save a few lines with TALLOC_FREE()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ef846e660a27e5b6f2a3e3814ab2f4a45e11b10c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 10 18:22:55 2022 +0200

    ldb: Avoid "==true/false" in a boolean expression
    
    That's what we have boolean variables and expressions for
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4ef1b0963c908af0eab382c77247496e3fd23227
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 10 19:20:53 2022 +0200

    ldap_server: Fix typos
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 22032eefdb7c1c739d2fd358bbffa594f33eecff
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 10 20:08:49 2022 +0200

    passdb: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cdef977031e6171735c2f75403aaf325ac53e8e6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 10 20:14:38 2022 +0200

    dsdb: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 830b561cc9b25837005f25aa473a9a823aa01b7c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Apr 17 13:08:39 2022 +0200

    vfs: Remove unused last_lock_failure from files_struct
    
    Save 72 bytes per open file handle
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb-samba/ldb_ildap.c                          |  3 +-
 lib/ldb/common/ldb.c                               |  5 +--
 lib/ldb/common/ldb_dn.c                            | 32 +++++++++---------
 lib/ldb/common/ldb_modules.c                       |  6 ++--
 lib/util/smb_threads.c                             |  6 +++-
 lib/util/talloc_keep_secret.c                      |  4 ++-
 lib/util/talloc_stack.c                            |  8 ++++-
 lib/util/unix_privs.c                              |  4 ++-
 lib/util/util_ldb.c                                |  5 +--
 source3/include/includes.h                         |  2 --
 source3/include/vfs.h                              |  3 +-
 source3/libsmb/libsmb_context.c                    |  2 ++
 source3/passdb/machine_account_secrets.c           |  2 +-
 source3/passdb/pdb_interface.c                     | 17 ++++++----
 source3/printing/printing.c                        |  1 +
 source3/smbd/fd_handle.c                           |  1 +
 source3/smbd/fd_handle.h                           |  7 ++--
 source3/smbd/files.c                               |  2 --
 source3/smbd/proto.h                               |  2 --
 source3/smbd/smb1_trans2.c                         | 38 +++++++++-------------
 source3/smbd/smb1_utils.c                          |  9 ++---
 .../dsdb/samdb/ldb_modules/partition_metadata.c    |  2 +-
 source4/include/includes.h                         |  4 ---
 source4/ldap_server/ldap_backend.c                 |  2 +-
 source4/ldap_server/ldap_extended.c                |  2 +-
 25 files changed, 87 insertions(+), 82 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c
index 2c32395db70..b15f38b3843 100644
--- a/lib/ldb-samba/ldb_ildap.c
+++ b/lib/ldb-samba/ldb_ildap.c
@@ -872,7 +872,8 @@ failed:
 	talloc_free(module);
 	if (NT_STATUS_IS_LDAP(status)) {
 		return NT_STATUS_LDAP_CODE(status);
-	} else if (NT_STATUS_EQUAL(status, NT_STATUS_WRONG_PASSWORD)
+	}
+	if (NT_STATUS_EQUAL(status, NT_STATUS_WRONG_PASSWORD)
 		   || NT_STATUS_EQUAL(status, NT_STATUS_NO_SUCH_USER)
 		   || NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)
 		   || NT_STATUS_EQUAL(status, NT_STATUS_ACCOUNT_LOCKED_OUT)) {
diff --git a/lib/ldb/common/ldb.c b/lib/ldb/common/ldb.c
index 0fec89a52a8..c2599a096b9 100644
--- a/lib/ldb/common/ldb.c
+++ b/lib/ldb/common/ldb.c
@@ -312,10 +312,7 @@ void ldb_asprintf_errstring(struct ldb_context *ldb, const char *format, ...)
 
 void ldb_reset_err_string(struct ldb_context *ldb)
 {
-	if (ldb->err_string) {
-		talloc_free(ldb->err_string);
-		ldb->err_string = NULL;
-	}
+	TALLOC_FREE(ldb->err_string);
 }
 
 
diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index cce5ad5b2ff..fb7a95bf04f 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -298,7 +298,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 	char *parse_dn;
 	bool is_index;
 
-	if (dn == NULL || dn->invalid == true) {
+	if (dn == NULL || dn->invalid) {
 		return false;
 	}
 
@@ -324,7 +324,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 	}
 
 	/* Special DNs case */
-	if (dn->special == true) {
+	if (dn->special) {
 		return true;
 	}
 
@@ -350,7 +350,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 	d = dt = data;
 
 	while (*p) {
-		if (in_extended == true) {
+		if (in_extended) {
 
 			if (!in_ex_name && !in_ex_value) {
 
@@ -437,8 +437,8 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 			*d++ = *p++;
 			continue;
 		}
-		if (in_attr == true) {
-			if (trim == true) {
+		if (in_attr) {
+			if (trim) {
 				if (*p == ' ') {
 					p++;
 					continue;
@@ -505,7 +505,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 				goto failed;
 			}
 
-			if (is_oid == true && ( ! (isdigit(*p) || (*p == '.')))) {
+			if (is_oid && ( ! (isdigit(*p) || (*p == '.')))) {
 				/* not a digit nor a dot,
 				 * invalid attribute oid */
 				ldb_dn_mark_invalid(dn);
@@ -521,8 +521,8 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 			continue;
 		}
 
-		if (in_value == true) {
-			if (in_quote == true) {
+		if (in_value) {
+			if (in_quote) {
 				if (*p == '\"') {
 					if (p[-1] != '\\') {
 						p++;
@@ -535,7 +535,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 				continue;
 			}
 
-			if (trim == true) {
+			if (trim) {
 				if (*p == ' ') {
 					p++;
 					continue;
@@ -558,7 +558,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 			*/
 
 			case ',':
-				if (escape == true) {
+				if (escape) {
 					*d++ = *p++;
 					l++;
 					escape = false;
@@ -620,7 +620,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 				accept the base64 encoded binary index
 				values, which contain a '+' or '='
 				which should normally be escaped */
-				if (is_index == true) {
+				if (is_index) {
 					if (t != NULL) {
 						t = NULL;
 					}
@@ -635,7 +635,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 			case '>':
 			case ';':
 				/* a string with not escaped specials is invalid (tested) */
-				if (escape == false) {
+				if (!escape) {
 					ldb_dn_mark_invalid(dn);
 					goto failed;
 				}
@@ -650,7 +650,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 				break;
 
 			case '\\':
-				if (escape == false) {
+				if (!escape) {
 					escape = true;
 					p++;
 					continue;
@@ -666,7 +666,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 				break;
 
 			default:
-				if (escape == true) {
+				if (escape) {
 					if (isxdigit(p[0]) && isxdigit(p[1])) {
 						if (sscanf(p, "%02x", &x) != 1) {
 							/* invalid escaping sequence */
@@ -706,13 +706,13 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
 		}
 	}
 
-	if (in_attr == true || in_quote == true) {
+	if (in_attr || in_quote) {
 		/* invalid dn */
 		ldb_dn_mark_invalid(dn);
 		goto failed;
 	}
 
-	if (in_value == true) {
+	if (in_value) {
 		/* save last element */
 		if (t != NULL) {
 			/* trim back */
diff --git a/lib/ldb/common/ldb_modules.c b/lib/ldb/common/ldb_modules.c
index 4366f05e066..2d0494a2123 100644
--- a/lib/ldb/common/ldb_modules.c
+++ b/lib/ldb/common/ldb_modules.c
@@ -197,9 +197,11 @@ int ldb_module_connect_backend(struct ldb_context *ldb,
 	int ret;
 	char *backend;
 	struct backends_list_entry *be;
+	char *colon = NULL;
 
-	if (strchr(url, ':') != NULL) {
-		backend = talloc_strndup(ldb, url, strchr(url, ':')-url);
+	colon = strchr(url, ':');
+	if (colon != NULL) {
+		backend = talloc_strndup(ldb, url, colon-url);
 	} else {
 		/* Default to tdb */
 		backend = talloc_strdup(ldb, "tdb");
diff --git a/lib/util/smb_threads.c b/lib/util/smb_threads.c
index 58ea2daa675..421dac9109a 100644
--- a/lib/util/smb_threads.c
+++ b/lib/util/smb_threads.c
@@ -23,8 +23,12 @@
  * thread local storage.
  */
 
-#include "includes.h"
+#include "replace.h"
 #include "smb_threads.h"
+#include "smb_threads_internal.h"
+#include "lib/util/debug.h"
+#include "lib/util/fault.h"
+#include "lib/util/memory.h"
 
 /*********************************************************
  Functions to vector the locking primitives used internally
diff --git a/lib/util/talloc_keep_secret.c b/lib/util/talloc_keep_secret.c
index d6aa38265f6..70d449b5f12 100644
--- a/lib/util/talloc_keep_secret.c
+++ b/lib/util/talloc_keep_secret.c
@@ -15,7 +15,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "includes.h"
+#include "replace.h"
+#include <talloc.h>
+#include "lib/util/fault.h"
 #include "talloc_keep_secret.h"
 
 static int talloc_keep_secret_destructor(void *ptr)
diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index 4971150e0d5..fdd0a30441d 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -37,7 +37,13 @@
  * called after the parent would set the talloc_tos() to the wrong value.
  */
 
-#include "includes.h"
+#include "replace.h"
+#include <talloc.h>
+#include "lib/util/talloc_stack.h"
+#include "lib/util/smb_threads.h"
+#include "lib/util/smb_threads_internal.h"
+#include "lib/util/fault.h"
+#include "lib/util/debug.h"
 
 struct talloc_stackframe {
 	int talloc_stacksize;
diff --git a/lib/util/unix_privs.c b/lib/util/unix_privs.c
index 3b00df5349b..9f284328524 100644
--- a/lib/util/unix_privs.c
+++ b/lib/util/unix_privs.c
@@ -19,7 +19,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
+#include <talloc.h>
+#include "lib/util/fault.h"
 #include "system/passwd.h"
 
 #ifdef HAVE_UNISTD_H
diff --git a/lib/util/util_ldb.c b/lib/util/util_ldb.c
index 25ae5106892..bf6fe996c4c 100644
--- a/lib/util/util_ldb.c
+++ b/lib/util/util_ldb.c
@@ -20,9 +20,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
+#include "replace.h"
 #include <ldb.h>
-#include "../lib/util/util_ldb.h"
+#include "lib/util/util_ldb.h"
+#include "lib/util/debug.h"
 
 /*
  * search the LDB for the specified attributes - va_list variant
diff --git a/source3/include/includes.h b/source3/include/includes.h
index ee0628eb31a..bb93aad02a0 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -269,8 +269,6 @@ typedef char fstring[FSTRING_LEN];
 
 #include "../lib/util/samba_modules.h"
 #include "../lib/util/talloc_stack.h"
-#include "../lib/util/smb_threads.h"
-#include "../lib/util/smb_threads_internal.h"
 
 /* samba_setXXid functions. */
 #include "../lib/util/setid.h"
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 2694cb5dffc..e3d7fee90ff 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -367,6 +367,8 @@
  * Version 47 - Add SMB_VFS_FSTATAT
  * Version 47 - Change SMB_VFS_GET_REAL_FILENAME to return NTSTATUS
  * Version 47 - remove st_ex_itime from struct stat_ex
+ * Version 47 - remove (unused) struct lock_struct last_lock_failure
+		from files_struct.
  */
 
 #define SMB_VFS_INTERFACE_VERSION 47
@@ -457,7 +459,6 @@ typedef struct files_struct {
 	struct fsp_lease *lease;
 	int sent_oplock_break;
 	struct tevent_timer *oplock_timeout;
-	struct lock_struct last_lock_failure;
 	int current_lock_count; /* Count the number of outstanding locks and pending locks. */
 
 	uint64_t posix_flags;
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index 23155fe263f..b92f14e9d4e 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -31,6 +31,8 @@
 #include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec.h"
 #include "lib/param/param.h"
+#include "../lib/util/smb_threads.h"
+#include "../lib/util/smb_threads_internal.h"
 
 /*
  * Is the logging working / configfile read ?
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index f98f0c98674..35f72c219f4 100644
--- a/source3/passdb/machine_account_secrets.c
+++ b/source3/passdb/machine_account_secrets.c
@@ -462,7 +462,7 @@ bool secrets_delete_domain_sid(const char *domain)
 /************************************************************************
  Set the machine trust account password, the old pw and last change
  time, domain SID and salting principals based on values passed in
- (added to supprt the secrets_tdb_sync module on secrets.ldb)
+ (added to support the secrets_tdb_sync module on secrets.ldb)
 ************************************************************************/
 
 bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const char *domain,
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index b83cef1de37..118a5d76926 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -177,7 +177,8 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected
 
 	DEBUG(5,("Found pdb backend %s\n", module_name));
 
-	if ( !NT_STATUS_IS_OK( nt_status = entry->init(methods, module_location) ) ) {
+	nt_status = entry->init(methods, module_location);
+	if (!NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(0,("pdb backend %s did not correctly init (error was %s)\n", 
 			selected, nt_errstr(nt_status)));
 		SAFE_FREE(module_name);
@@ -198,20 +199,22 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected
 static struct pdb_methods *pdb_get_methods_reload( bool reload ) 
 {
 	static struct pdb_methods *pdb = NULL;
+	const char *backend = lp_passdb_backend();
+	NTSTATUS status = NT_STATUS_OK;
 
 	if ( pdb && reload ) {
 		if (pdb->free_private_data != NULL) {
 			pdb->free_private_data( &(pdb->private_data) );
 		}
-		if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
-			return NULL;
-		}
+		status = make_pdb_method_name(&pdb, backend);
 	}
 
 	if ( !pdb ) {
-		if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
-			return NULL;
-		}
+		status = make_pdb_method_name(&pdb, backend);
+	}
+
+	if (!NT_STATUS_IS_OK(status)) {
+		return NULL;
 	}
 
 	return pdb;
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 67d798fbb21..82903359fc3 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "smbd/globals.h"
 #include "system/syslog.h"
 #include "system/filesys.h"
 #include "printing.h"
diff --git a/source3/smbd/fd_handle.c b/source3/smbd/fd_handle.c
index 94d15ef848b..e599181fe6b 100644
--- a/source3/smbd/fd_handle.c
+++ b/source3/smbd/fd_handle.c
@@ -17,6 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "includes.h"
 #include "fd_handle.h"
 
 struct fd_handle {
diff --git a/source3/smbd/fd_handle.h b/source3/smbd/fd_handle.h
index 052db1d40c5..dc0e5e43940 100644
--- a/source3/smbd/fd_handle.h
+++ b/source3/smbd/fd_handle.h
@@ -20,9 +20,10 @@
 #ifndef FD_HANDLE_H
 #define FD_HANDLE_H
 
-#include "includes.h"
-#include "smbd/smbd.h"
-#include "smbd/globals.h"
+#include "replace.h"
+#include <talloc.h>
+
+struct fd_handle;
 
 struct fd_handle *fd_handle_create(TALLOC_CTX *mem_ctx);
 
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 2e513dd6299..0c82de8b48c 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -1361,10 +1361,8 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
 ****************************************************************************/
 
 NTSTATUS dup_file_fsp(
-	struct smb_request *req,
 	files_struct *from,
 	uint32_t access_mask,
-	uint32_t create_options,
 	files_struct *to)
 {
 	size_t new_refcount;
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 9510f70529d..b78111c25c2 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -416,10 +416,8 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
 				   uint64_t persistent_id,
 				   uint64_t volatile_id);
 NTSTATUS dup_file_fsp(
-	struct smb_request *req,
 	files_struct *from,
 	uint32_t access_mask,
-	uint32_t create_options,
 	files_struct *to);
 NTSTATUS file_name_hash(connection_struct *conn,
 			const char *name, uint32_t *p_name_hash);
diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c
index 8142729f03c..5edba322839 100644
--- a/source3/smbd/smb1_trans2.c
+++ b/source3/smbd/smb1_trans2.c
@@ -1862,6 +1862,8 @@ static void call_trans2setfsinfo(connection_struct *conn,
 
 static void call_trans2qpipeinfo(connection_struct *conn,
 				 struct smb_request *req,
+				 files_struct *fsp,
+				 uint16_t info_level,
 				 unsigned int tran_call,
 				 char **pparams, int total_params,
 				 char **ppdata, int total_data,
@@ -1871,27 +1873,12 @@ static void call_trans2qpipeinfo(connection_struct *conn,
 	char *pdata = *ppdata;
 	unsigned int data_size = 0;
 	unsigned int param_size = 2;
-	uint16_t info_level;
-	files_struct *fsp;
-
-	if (!params) {
-		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return;
-	}
-
-	if (total_params < 4) {
-		reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
-		return;
-	}
 
-	fsp = file_fsp(req, SVAL(params,0));
 	if (!fsp_is_np(fsp)) {
 		reply_nterror(req, NT_STATUS_INVALID_HANDLE);
 		return;
 	}
 
-	info_level = SVAL(params,2);
-
 	*pparams = (char *)SMB_REALLOC(*pparams,2);
 	if (*pparams == NULL) {
 		reply_nterror(req, NT_STATUS_NO_MEMORY);
@@ -1973,17 +1960,24 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
 			return;
 		}
 
+		fsp = file_fsp(req, SVAL(params,0));
+		info_level = SVAL(params,2);
+
 		if (IS_IPC(conn)) {
-			call_trans2qpipeinfo(conn, req,	tran_call,
-					     pparams, total_params,
-					     ppdata, total_data,
-					     max_data_bytes);
+			call_trans2qpipeinfo(
+				conn,
+				req,
+				fsp,
+				info_level,
+				tran_call,
+				pparams,
+				total_params,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list