[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated - build_3.2.10_ctdb.58-21-g793c748

Michael Adam obnox at samba.org
Wed Apr 22 09:13:41 GMT 2009


The branch, v3-2-ctdb has been updated
       via  793c7481bf0aff505dae2b745188f818a3a801f4 (commit)
       via  f995a5d45f43a498f6a203971c38591bdc8b30ce (commit)
       via  596c8f2a77ca47887e7b34cfc1a496c29cbad0bf (commit)
       via  837dfb6a14183a354b1bf3602e8a1893baade765 (commit)
       via  416f233b86bdb9e5fa2f53f225a49f5d1693a11c (commit)
       via  f686e8ca1b9d5d248b6e4a8189dc5fb89867d81f (commit)
       via  97a1e028bbd2322db05b1258d065a9af47a566fc (commit)
       via  5de675c09d56eb56f6bdf59606510fe35ef709ad (commit)
       via  ccd28c0b5e03556e7449317e7b22a0efc7ca301b (commit)
       via  420b86426769760d70fb69cc5b5b26e23d77a41a (commit)
       via  a7688cdc0948b5bf8e4fa1e9cad1904d4beaadec (commit)
       via  63b406138ddbc8f98a249d9023afb5f88fa7d8df (commit)
       via  2918181c8c42be87ec5e9d3f7c2f4453d2153a66 (commit)
       via  860d1fbc9ba7c659e89617d668a54b5560a70600 (commit)
       via  523a6c3b64d7a241692503432861e06ffcba8d66 (commit)
       via  6bbdb547e6a366916986887ec2af5045849ad3ba (commit)
       via  1250f2025741c22838b22053c7bde4f9efde5b22 (commit)
      from  5589d41d4ca1ad7db0227a1e7777e59c965b6c7c (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit 793c7481bf0aff505dae2b745188f818a3a801f4
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Apr 17 11:57:41 2009 +0200

    WHATSNEW: Rewording.
    
    Karolin

commit f995a5d45f43a498f6a203971c38591bdc8b30ce
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Apr 17 11:52:02 2009 +0200

    VERSION: Raise version number upt to 3.2.11.
    
    Karolin

commit 596c8f2a77ca47887e7b34cfc1a496c29cbad0bf
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Apr 17 10:42:31 2009 +0200

    WHATSNEW: Update changes since 3.2.10.
    
    Karolin

commit 837dfb6a14183a354b1bf3602e8a1893baade765
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 16 15:14:37 2009 -0700

    When doing a cli_ulogoff don't invalidate the cnum, invalidate the vuid.
    Jeremy.

commit 416f233b86bdb9e5fa2f53f225a49f5d1693a11c
Author: Jim McDonough <jmcd at samba.org>
Date:   Thu Apr 16 16:42:59 2009 +0200

    Don't look up local user for remote changes, even when root.

commit f686e8ca1b9d5d248b6e4a8189dc5fb89867d81f
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 16 01:42:35 2009 +0200

    s3-lsa: Fix Bug #6263. Unexpected LookupSids reply crashes XP pre-SP3.
    
    LookupSids needs to bounce back string sids in case of NT_STATUS_NONE_MAPPED.
    
    Guenther
    (cherry picked from commit 597be402e40ff880b595ae49a8600b932365cbcb)

commit 97a1e028bbd2322db05b1258d065a9af47a566fc
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Apr 15 14:09:32 2009 -0700

    Fix bug #6089 - Winbind samr_OpenDomain not possible with Samba 3.2.6+
    What a difference a name makes... :-). Just because something is missnamed
    SA_RIGHT_SAM_OPEN_DOMAIN, when it should actually be SA_RIGHT_SAM_LOOKUP_DOMAIN,
    don't automatically use it for a security check in _samr_OpenDomain().
    Jeremy.

commit 5de675c09d56eb56f6bdf59606510fe35ef709ad
Author: Guenther Deschner <gd at samba.org>
Date:   Mon Apr 13 09:44:54 2009 -0700

    s3-loadparm: Fix resume command typo for "printing = vlp".

commit ccd28c0b5e03556e7449317e7b22a0efc7ca301b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 11 13:54:06 2009 -0700

    Fix a memleak in an unlikely error path in change_notify_create()

commit 420b86426769760d70fb69cc5b5b26e23d77a41a
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 9 22:46:31 2009 -0700

    Fix bug #6254 - PUT/GET produces an error in IPv6 to a smb-server(3.3)
    has parameter "msdfs root = yes"
    This was broken by the refactoring around create_file().
    MSDFS pathname processing must be done FIRST.
    MSDFS pathnames containing IPv6 addresses can
    be confused with NTFS stream names (they contain
    ":" characters.
    Jeremy.

commit a7688cdc0948b5bf8e4fa1e9cad1904d4beaadec
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Apr 7 20:01:27 2009 +0200

    s3/popt.h: Fix typo.
    
    This used to be commit 8da2fa36 in master.
    
    Karolin
    (cherry picked from commit 3df28fce45ce552df2c0815597fc1808ea08b363)

commit 63b406138ddbc8f98a249d9023afb5f88fa7d8df
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Apr 7 20:00:47 2009 +0200

    s3/loadparm: Fiy typos.
    
    This used to be commit 44588095 in master.
    
    Karolin
    (cherry picked from commit 7648c51afaf844e576935dadc0d66a94e2cad28b)

commit 2918181c8c42be87ec5e9d3f7c2f4453d2153a66
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Apr 7 19:58:47 2009 +0200

    s3/gpo_ldap: Fix typo.
    
    This used to be commit a103222e in master.
    
    Karolin
    (cherry picked from commit a33677c8a80925965a4023785fc3a221d2ed9585)

commit 860d1fbc9ba7c659e89617d668a54b5560a70600
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Apr 7 19:58:14 2009 +0200

    s3/smbconf_reg: Fix typo.
    
    This used to be commit 6343cab3 in master.
    
    Karolin
    (cherry picked from commit 56e877662dd6da64b348803c24e85f60ee6b3d85)

commit 523a6c3b64d7a241692503432861e06ffcba8d66
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 6 12:45:46 2009 +0200

    s3-examples: Fix Bug #6205. Correct sample smb.conf share configuration.
    
    Thanks to Jeffrey Riaboy <dakusan at castledragmire.com>.
    
    Guenther
    (cherry picked from commit 2b1fe2c98f4e0013dee4cbae62dc36cdd4085c7d)

commit 6bbdb547e6a366916986887ec2af5045849ad3ba
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 28 19:58:45 2009 +0100

    Fix smbd crash for close_on_completion
    
    handle_trans() can talloc_free "conn" if the client requests
    close_on_completion. "state" is a talloc_child of conn, so it will be gone when
    we later free state->data et al.

commit 1250f2025741c22838b22053c7bde4f9efde5b22
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Apr 1 20:14:35 2009 -0700

    Allow pdbedit to change a user rid/sid. Based on a fix from Alexander
    Zagrebin <alexz at visp.ru>.
    Jeremy.

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

Summary of changes:
 WHATSNEW.txt                     |   41 +++++++++++++++++++-------
 examples/smb.conf.default        |    2 +-
 source/VERSION                   |    2 +-
 source/include/rpc_secdes.h      |    4 +-
 source/lib/smbconf/smbconf_reg.c |    2 +-
 source/libgpo/gpo_ldap.c         |    2 +-
 source/libsmb/cliconnect.c       |    2 +-
 source/param/loadparm.c          |    6 ++--
 source/passdb/pdb_tdb.c          |   60 ++++++++++++++++++++++++++++++++++++--
 source/popt/popt.h               |    2 +-
 source/rpc_server/srv_lsa_nt.c   |   10 ++++++-
 source/rpc_server/srv_samr_nt.c  |   13 ++------
 source/smbd/ipc.c                |    4 ++
 source/smbd/notify.c             |    1 +
 source/smbd/open.c               |   41 ++++++++++++++-----------
 source/utils/net_rpc.c           |    2 +-
 source/utils/smbpasswd.c         |   16 ++++++----
 17 files changed, 149 insertions(+), 61 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index e7a0fa5..4137597 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,28 +1,47 @@
                    ==============================
-                   Release Notes for Samba 3.2.10
-			    April 1, 2009
+                   Release Notes for Samba 3.2.11
+			   April 17, 2009
                    ==============================
 
 
 This is a maintenance release of the Samba 3.2 series.
 
-In Samba 3.2.9, there is an issue while migrating passdb.tdb files from older
-Samba versions (e.g. 3.2.8). That causes panics of smbd child processes until
-the parent smbd is restarted once after converting the passdb.tdb file. This
-issue is fixed in Samba 3.2.10.
+Major enhancements in 3.2.11 include:
+
+    o Fix domain logins for WinXP clients pre SP3 (bug #6263).
+    o Fix samr_OpenDomain access checks (bug #6089).
+    o Fix smbd crash for close_on_completion.
 
-Sorry for the inconveniences!
 
 ######################################################################
 Changes
 #######
 
-Changes since 3.2.9
--------------------
+Changes since 3.2.10
+--------------------
+
+
+o   Jeremy Allison <jra at samba.org>
+    * BUG 6089: Fix samr_OpenDomain access checks.
+    * BUG 6254: Fix IPv6 PUT/GET errors to an SMB server (3.3) with
+      "msdfs root" set to "yes".
+    * Allow pdbedit to change a user rid/sid.
+    * When doing a cli_ulogoff don't invalidate the cnum, invalidate the vuid.
+
+
+o   Günther Deschner <gd at samba.org>
+    * BUG 6205: Correct sample smb.conf share configuration.
+    * BUG 6263: Fix domain logins for WinXP clients pre SP3.
+    * Fix resume command typo for "printing = vlp".
+
+
+o   Volker Lendecke <vl at samba.org>
+    * Fix smbd crash for close_on_completion.
+    * Fix a memleak in an unlikely error path in change_notify_create().
 
 
-o   Michael Adam <obnox at samba.org>
-    * BUG #6195: Don't let smbd child processes panic.
+o   Jim McDonough <jmcd at samba.org>
+    * Don't look up local user for remote changes, even when root.
 
 
 ######################################################################
diff --git a/examples/smb.conf.default b/examples/smb.conf.default
index 971ca19..b4e3d63 100644
--- a/examples/smb.conf.default
+++ b/examples/smb.conf.default
@@ -204,7 +204,7 @@
 ;   comment = Public Stuff
 ;   path = /home/samba
 ;   public = yes
-;   writable = yes
+;   writable = no
 ;   printable = no
 ;   write list = @staff
 
diff --git a/source/VERSION b/source/VERSION
index 3a34467..f9e5ccf 100644
--- a/source/VERSION
+++ b/source/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=3
 SAMBA_VERSION_MINOR=2
-SAMBA_VERSION_RELEASE=10
+SAMBA_VERSION_RELEASE=11
 
 ########################################################
 # Bug fix releases use a letter for the patch revision #
diff --git a/source/include/rpc_secdes.h b/source/include/rpc_secdes.h
index 649e806..bf5b85f 100644
--- a/source/include/rpc_secdes.h
+++ b/source/include/rpc_secdes.h
@@ -224,7 +224,7 @@ struct standard_mapping {
 #define SA_RIGHT_SAM_INITIALISE_SERVER	0x00000004
 #define SA_RIGHT_SAM_CREATE_DOMAIN	0x00000008
 #define SA_RIGHT_SAM_ENUM_DOMAINS	0x00000010
-#define SA_RIGHT_SAM_OPEN_DOMAIN	0x00000020
+#define SA_RIGHT_SAM_LOOKUP_DOMAIN	0x00000020
 
 #define SA_RIGHT_SAM_ALL_ACCESS		0x0000003F
 
@@ -244,7 +244,7 @@ struct standard_mapping {
 
 #define GENERIC_RIGHTS_SAM_EXECUTE \
 		(STANDARD_RIGHTS_EXECUTE_ACCESS	| \
-		SA_RIGHT_SAM_OPEN_DOMAIN	| \
+		SA_RIGHT_SAM_LOOKUP_DOMAIN	| \
 		SA_RIGHT_SAM_CONNECT_SERVER)            
 
 
diff --git a/source/lib/smbconf/smbconf_reg.c b/source/lib/smbconf/smbconf_reg.c
index 9a78692..ce4a76e 100644
--- a/source/lib/smbconf/smbconf_reg.c
+++ b/source/lib/smbconf/smbconf_reg.c
@@ -193,7 +193,7 @@ static WERROR smbconf_reg_set_value(struct registry_key *key,
 	if (!strequal(subkeyname, GLOBAL_NAME) &&
 	    lp_parameter_is_global(valname))
 	{
-		DEBUG(5, ("Global paramter '%s' not allowed in "
+		DEBUG(5, ("Global parameter '%s' not allowed in "
 			  "service definition ('%s').\n", canon_valname,
 			  subkeyname));
 		werr = WERR_INVALID_PARAM;
diff --git a/source/libgpo/gpo_ldap.c b/source/libgpo/gpo_ldap.c
index 477832a..084017d 100644
--- a/source/libgpo/gpo_ldap.c
+++ b/source/libgpo/gpo_ldap.c
@@ -453,7 +453,7 @@ ADS_STATUS ads_delete_gpo_link(ADS_STRUCT *ads,
 }
 
 /****************************************************************
- get a GROUP_POLICY_OBJECT structure based on different input paramters
+ get a GROUP_POLICY_OBJECT structure based on different input parameters
 ****************************************************************/
 
 ADS_STATUS ads_get_gpo(ADS_STRUCT *ads,
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index c0c39cf..2be220f 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -1096,7 +1096,7 @@ bool cli_ulogoff(struct cli_state *cli)
 		return False;
 	}
 
-        cli->cnum = -1;
+        cli->vuid = -1;
         return True;
 }
 
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index ff2ff75..a17cb1f 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -862,7 +862,7 @@ static const struct enum_list enum_config_backend[] = {
 
 /* Note: We do not initialise the defaults union - it is not allowed in ANSI C
  *
- * The FLAG_HIDE is explicit. Paramters set this way do NOT appear in any edit
+ * The FLAG_HIDE is explicit. Parameters set this way do NOT appear in any edit
  * screen in SWAT. This is used to exclude parameters as well as to squash all
  * parameters that have been duplicated by pseudonyms.
  *
@@ -871,7 +871,7 @@ static const struct enum_list enum_config_backend[] = {
  *	 Set FLAG_SHARE and FLAG_PRINT to specifically display parameters in
  *        respective views.
  *
- * NOTE2: Handling of duplicated (synonym) paramters:
+ * NOTE2: Handling of duplicated (synonym) parameters:
  *	Only the first occurance of a parameter should be enabled by FLAG_BASIC
  *	and/or FLAG_ADVANCED. All duplicates following the first mention should be
  *	set to FLAG_HIDE. ie: Make you must place the parameter that has the preferred
@@ -4524,7 +4524,7 @@ static void init_printer_values(struct service *pService)
 		string_set(&pService->szLpqcommand, "vlp lpq %p");
 		string_set(&pService->szLprmcommand, "vlp lprm %p %j");
 		string_set(&pService->szLppausecommand, "vlp lppause %p %j");
-		string_set(&pService->szLpresumecommand, "vlp lpresum %p %j");
+		string_set(&pService->szLpresumecommand, "vlp lpresume %p %j");
 		string_set(&pService->szQueuepausecommand, "vlp queuepause %p");
 		string_set(&pService->szQueueresumecommand, "vlp queueresume %p");
 		break;
diff --git a/source/passdb/pdb_tdb.c b/source/passdb/pdb_tdb.c
index 56dfa47..806854c 100644
--- a/source/passdb/pdb_tdb.c
+++ b/source/passdb/pdb_tdb.c
@@ -1406,12 +1406,17 @@ static bool tdb_update_ridrec_only( struct samu* newpwd, int flag )
 static bool tdb_update_sam(struct pdb_methods *my_methods, struct samu* newpwd,
 			   int flag)
 {
-	if (!pdb_get_user_rid(newpwd)) {
+	uint32_t oldrid;
+	uint32_t newrid;
+
+	if (!(newrid = pdb_get_user_rid(newpwd))) {
 		DEBUG(0,("tdb_update_sam: struct samu (%s) with no RID!\n",
 			 pdb_get_username(newpwd)));
 		return False;
 	}
 
+	oldrid = newrid;
+
 	/* open the database */
 
 	if ( !tdbsam_open( tdbsam_filename ) ) {
@@ -1424,11 +1429,60 @@ static bool tdb_update_sam(struct pdb_methods *my_methods, struct samu* newpwd,
 		return false;
 	}
 
-	if (!tdb_update_samacct_only(newpwd, flag)
-	    || !tdb_update_ridrec_only(newpwd, flag)) {
+	/* If we are updating, we may be changing this users RID. Retrieve the old RID
+	   so we can check. */
+
+	if (flag == TDB_MODIFY) {
+		struct samu *account = samu_new(talloc_tos());
+		if (account == NULL) {
+			DEBUG(0,("tdb_update_sam: samu_new() failed\n"));
+			goto cancel;
+		}
+		if (!NT_STATUS_IS_OK(tdbsam_getsampwnam(my_methods, account, pdb_get_username(newpwd)))) {
+			DEBUG(0,("tdb_update_sam: tdbsam_getsampwnam() for %s failed\n",
+				pdb_get_username(newpwd)));
+			TALLOC_FREE(account);
+			goto cancel;
+		}
+		if (!(oldrid = pdb_get_user_rid(account))) {
+			DEBUG(0,("tdb_update_sam: pdb_get_user_rid() failed\n"));
+			TALLOC_FREE(account);
+			goto cancel;
+		}
+		TALLOC_FREE(account);
+	}
+
+	/* Update the new samu entry. */
+	if (!tdb_update_samacct_only(newpwd, flag)) {
 		goto cancel;
 	}
 
+	/* Now take care of the case where the RID changed. We need
+	 * to delete the old RID key and add the new. */
+
+	if (flag == TDB_MODIFY && newrid != oldrid) { 
+		fstring keystr;
+
+		/* Delete old RID key */
+		DEBUG(10, ("tdb_update_sam: Deleting key for RID %u\n", oldrid));
+		slprintf(keystr, sizeof(keystr) - 1, "%s%.8x", RIDPREFIX, oldrid);
+		if (!NT_STATUS_IS_OK(dbwrap_delete_bystring(db_sam, keystr))) {
+			DEBUG(0, ("tdb_update_sam: Can't delete %s\n", keystr));
+			goto cancel;
+		}
+		/* Insert new RID key */
+		DEBUG(10, ("tdb_update_sam: Inserting key for RID %u\n", newrid));
+		if (!tdb_update_ridrec_only(newpwd, TDB_INSERT)) {
+			goto cancel;
+		}
+	} else {
+		DEBUG(10, ("tdb_update_sam: %s key for RID %u\n",
+			flag == TDB_MODIFY ? "Updating" : "Inserting", newrid));
+		if (!tdb_update_ridrec_only(newpwd, flag)) {
+			goto cancel;
+		}
+	}
+
 	if (db_sam->transaction_commit(db_sam) != 0) {
 		DEBUG(0, ("Could not commit transaction\n"));
 		return false;
diff --git a/source/popt/popt.h b/source/popt/popt.h
index 08701d7..7b94a98 100644
--- a/source/popt/popt.h
+++ b/source/popt/popt.h
@@ -83,7 +83,7 @@
 #define POPT_ERROR_NOARG	-10	/*!< missing argument */
 #define POPT_ERROR_BADOPT	-11	/*!< unknown option */
 #define POPT_ERROR_OPTSTOODEEP	-13	/*!< aliases nested too deeply */
-#define POPT_ERROR_BADQUOTE	-15	/*!< error in paramter quoting */
+#define POPT_ERROR_BADQUOTE	-15	/*!< error in parameter quoting */
 #define POPT_ERROR_ERRNO	-16	/*!< errno set, use strerror(errno) */
 #define POPT_ERROR_BADNUMBER	-17	/*!< invalid numeric value */
 #define POPT_ERROR_OVERFLOW	-18	/*!< number too large or too small */
diff --git a/source/rpc_server/srv_lsa_nt.c b/source/rpc_server/srv_lsa_nt.c
index 9d411ec..fd6cdfa 100644
--- a/source/rpc_server/srv_lsa_nt.c
+++ b/source/rpc_server/srv_lsa_nt.c
@@ -830,7 +830,15 @@ NTSTATUS _lsa_LookupSids(pipes_struct *p,
 					   &names,
 					   &mapped_count);
 
-	if (NT_STATUS_IS_ERR(status)) {
+	/* Only return here when there is a real error.
+	   NT_STATUS_NONE_MAPPED is a special case as it indicates that none of
+	   the requested sids could be resolved. Older versions of XP (pre SP3)
+	   rely that we return with the string representations of those SIDs in
+	   that case. If we don't, XP crashes - Guenther
+	   */
+
+	if (NT_STATUS_IS_ERR(status) &&
+	    !NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
 		return status;
 	}
 
diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c
index 6e37ea5..f14c53b 100644
--- a/source/rpc_server/srv_samr_nt.c
+++ b/source/rpc_server/srv_samr_nt.c
@@ -620,13 +620,6 @@ NTSTATUS _samr_OpenDomain(pipes_struct *p,
 	if ( !find_policy_by_hnd(p, r->in.connect_handle, (void**)(void *)&info) )
 		return NT_STATUS_INVALID_HANDLE;
 
-	status = access_check_samr_function(info->acc_granted,
-					    SA_RIGHT_SAM_OPEN_DOMAIN,
-					    "_samr_OpenDomain" );
-
-	if ( !NT_STATUS_IS_OK(status) )
-		return status;
-
 	/*check if access can be granted as requested by client. */
 	map_max_allowed_access(p->pipe_user.nt_user_token, &des_access);
 
@@ -2957,7 +2950,7 @@ NTSTATUS _samr_QueryDomainInfo(pipes_struct *p,
 	}
 
 	status = access_check_samr_function(info->acc_granted,
-					    SA_RIGHT_SAM_OPEN_DOMAIN,
+					    SA_RIGHT_SAM_LOOKUP_DOMAIN,
 					    "_samr_QueryDomainInfo" );
 
 	if ( !NT_STATUS_IS_OK(status) )
@@ -3357,7 +3350,7 @@ NTSTATUS _samr_Connect(pipes_struct *p,
 	map_max_allowed_access(p->pipe_user.nt_user_token, &des_access);
 
 	se_map_generic( &des_access, &sam_generic_mapping );
-	info->acc_granted = des_access & (SA_RIGHT_SAM_ENUM_DOMAINS|SA_RIGHT_SAM_OPEN_DOMAIN);
+	info->acc_granted = des_access & (SA_RIGHT_SAM_ENUM_DOMAINS|SA_RIGHT_SAM_LOOKUP_DOMAIN);
 
 	/* get a (unique) handle.  open a policy on it. */
 	if (!create_policy_hnd(p, r->out.connect_handle, free_samr_info, (void *)info))
@@ -3544,7 +3537,7 @@ NTSTATUS _samr_LookupDomain(pipes_struct *p,
 	   Reverted that change so we will work with RAS servers again */
 
 	status = access_check_samr_function(info->acc_granted,
-					    SA_RIGHT_SAM_OPEN_DOMAIN,
+					    SA_RIGHT_SAM_LOOKUP_DOMAIN,
 					    "_samr_LookupDomain");
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index a53bc5b..8e40c30 100644
--- a/source/smbd/ipc.c
+++ b/source/smbd/ipc.c
@@ -658,6 +658,8 @@ void reply_trans(struct smb_request *req)
 		return;
 	}
 
+	talloc_steal(talloc_tos(), state);
+
 	handle_trans(conn, req, state);
 
 	SAFE_FREE(state->data);
@@ -787,6 +789,8 @@ void reply_transs(struct smb_request *req)
          */
         SCVAL(req->inbuf,smb_com,SMBtrans);
 
+	talloc_steal(talloc_tos(), state);
+
 	handle_trans(conn, req, state);
 
 	DLIST_REMOVE(conn->pending_trans, state);
diff --git a/source/smbd/notify.c b/source/smbd/notify.c
index 55a5e69..d1cd8df 100644
--- a/source/smbd/notify.c
+++ b/source/smbd/notify.c
@@ -231,6 +231,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
 	if (asprintf(&fullpath, "%s/%s", fsp->conn->connectpath,
 		     fsp->fsp_name) == -1) {
 		DEBUG(0, ("asprintf failed\n"));
+		TALLOC_FREE(fsp->notify);
 		return NT_STATUS_NO_MEMORY;
 	}
 
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 58d1f6d..535abcc 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -3055,6 +3055,29 @@ NTSTATUS create_file(connection_struct *conn,
 		  (unsigned int)root_dir_fid,
 		  ea_list, sd, fname));
 
+	/* MSDFS pathname processing must be done FIRST.
+	   MSDFS pathnames containing IPv6 addresses can
+	   be confused with NTFS stream names (they contain
+	   ":" characters. JRA. */
+
+	if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) {
+		char *resolved_fname;
+
+		status = resolve_dfspath(talloc_tos(), conn, true, fname,
+					 &resolved_fname);
+
+		if (!NT_STATUS_IS_OK(status)) {
+			/*
+			 * For PATH_NOT_COVERED we had
+			 * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
+			 *		   ERRSRV, ERRbadpath);
+			 * Need to fix in callers
+			 */
+			goto fail;
+		}
+		fname = resolved_fname;
+	}
+
 	/*
 	 * Get the file name.
 	 */
@@ -3182,24 +3205,6 @@ NTSTATUS create_file(connection_struct *conn,
 		}
 	}
 
-	if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) {
-		char *resolved_fname;
-
-		status = resolve_dfspath(talloc_tos(), conn, true, fname,
-					 &resolved_fname);
-
-		if (!NT_STATUS_IS_OK(status)) {
-			/*
-			 * For PATH_NOT_COVERED we had
-			 * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
-			 *		   ERRSRV, ERRbadpath);
-			 * Need to fix in callers
-			 */
-			goto fail;
-		}
-		fname = resolved_fname;
-	}
-
 	/*
 	 * Check if POSIX semantics are wanted.
 	 */
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index 0476394..1eaa1c6 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -6280,7 +6280,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
 	/* SamrConnect2 */
 	nt_status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
 					 pipe_hnd->cli->desthost,
-					 SA_RIGHT_SAM_OPEN_DOMAIN,
+					 SA_RIGHT_SAM_LOOKUP_DOMAIN,
 					 &connect_hnd);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(0, ("Couldn't open SAMR policy handle. Error was %s\n",
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index 041b02a..47377e1 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -430,14 +430,18 @@ static int process_root(int local_flags)
 		}
 		
 		if((local_flags & LOCAL_SET_PASSWORD) && (new_passwd == NULL)) {
-			struct passwd *passwd = getpwnam_alloc(NULL, user_name);
+			struct passwd *passwd;
 
-			if (!passwd) {
-				fprintf(stderr, "Cannot locate Unix account for "
-					"'%s'!\n", user_name);
-				exit(1);
+			if (remote_machine == NULL) {
+				passwd = getpwnam_alloc(NULL, user_name);
+
+				if (!passwd) {
+					fprintf(stderr, "Cannot locate Unix account for "
+						"'%s'!\n", user_name);
+					exit(1);
+				}
+				TALLOC_FREE(passwd);
 			}
-			TALLOC_FREE(passwd);
 
 			new_passwd = prompt_for_new_password(stdin_passwd_get);
 			


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list