[SCM] Samba Shared Repository - branch v4-1-stable updated

Karolin Seeger kseeger at samba.org
Tue Jun 23 12:21:07 MDT 2015


The branch, v4-1-stable has been updated
       via  f14dcca VERSION: Disable git snapshots for the 4.1.19 release.
       via  45bd969 WHATSNEW: Add release notes for Samba 4.1.19.
       via  43e2626 s3: libsmbclient: Re-resolving targetcli on every read/write/lseek/ftruncate/close is both incorrect and slow.
       via  f8c27d1 nsswitch: Extend idmap_rfc2307 testcase for reverse lookup
       via  2070fa2 idmap_rfc2307: Fix wbinfo --gid-to-sid query
       via  1da224b s4.2/fsmo.py: fixed fsmo transfer exception
       via  3e5744d s3: IPv6 enabled DNS connections for ADS client
       via  a6d7aa5 Add IPv6 support for determining FQDN during ADS join.
       via  ccf557c Add IPv6 support to ADS client side LDAP connects. Corrected format for IPv6 LDAP URI.
       via  34cffdb s4:torture:smb2:compound: compound read and padding
       via  9ba2dce s3:smb2: add padding to last command in compound requests
       via  db28391 s3: smbcacls: Ensure we read a hex number as %x, not %u.
       via  995bef1 s4: libcli/finddcs_cldap: continue processing CLDAP until all addresses are used
       via  67fbd6d s3:winbindd: make sure we remove pending io requests before closing client sockets
       via  d8626e9 s4:lib/tls: fix build with gnutls 3.4
       via  13d1bdd libads: record service ticket endtime for sealed ldap connections
       via  0372b33 s3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path, then used the result to call XATTR functions directly.
       via  8ac582e s3: smbd: VFS: For all EA and ACL calls use synthetic_smb_fname(), not synthetic_smb_fname_split().
       via  178db7c s3: smbd: VFS: All the places that are currently calling vfs_stat_smb_fname() and vfs_lstat_smb_fname() should be calling vfs_stat_smb_basename().
       via  bb22fea s3: smbd: VFS: Add vfs_stat_smb_basename() - to be called when we *know* stream name parsing has already been done.
       via  18536b8 vfs_gpfs: move failure label before END_PROFILE
       via  007a5fd vfp_gpfs: ensure END_PROFILE is always called
       via  3db0ad9 s3:selftest: run smb2.notify with --signing=required
       via  1b2cf28 s3:smb2_sesssetup: remove unused smbd_smb2_session_setup_* destructors
       via  3af2142 s3:smb2_sesssetup: add smbd_smb2_session_setup_wrap_send/recv()
       via  f28cbf0 s3:smb2_sesssetup: always assign smb2req->session when a session was created.
       via  bd03b6a s3:smb2_sesssetup: let smbd_smb2_logoff_* use smbXsrv_session_shutdown_*
       via  6d611c6 s3:smbXsrv_session: cancel pending requests when we logoff a previous session
       via  75b9a6f s3:smbXsrv_session: add smb2srv_session_shutdown_send/recv helper functions
       via  749e6fd s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_logoff_all_callback()
       via  21fd82d s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_destructor()
       via  5e47040 s4:torture/smb2: add smb2.notify.session-reconnect test
       via  dcea20f s4:torture/smb2: add smb2.notify.invalid-reauth test
       via  712d9e5 s4:torture/smb2: add smb2.notify.close test
       via  bc0966d s4:torture/smb2: verify STATUS_NOTIFY_CLEANUP return value
       via  6caba46 s3:smbd: use STATUS_NOTIFY_CLEANUP on smb2 logoff (explicit and implicit) and tdis
       via  2284593 s3:smbd: use STATUS_NOTIFY_CLEANUP when closing a smb2 directory handle
       via  f362fc9 s3:smbd: add a smbd_notify_cancel_by_map() helper function
       via  33e1a4f smbd:smb2: fix error code when the header says the request is signed but we don't have a sesseion
       via  f687a77 s3:smb2_server: don't rely on the SMB2_HDR_FLAG_SIGNED if signing is required
       via  87b7535 VERSION: Bump version up to 4.1.19...
      from  1a121d1 WHATSNEW: Add release notes for Samba 4.1.18.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-1-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                              |   2 +-
 WHATSNEW.txt                         |  85 ++++++++-
 lib/addns/dns.h                      |   2 +-
 lib/addns/dnssock.c                  | 125 +++++++++-----
 nsswitch/tests/test_idmap_rfc2307.sh |  72 +++++++-
 python/samba/netcmd/fsmo.py          |   1 -
 selftest/knownfail                   |   1 -
 source3/include/libsmb_internal.h    |   5 +
 source3/lib/util.c                   |  52 +++---
 source3/libads/ldap.c                |   8 +-
 source3/libads/sasl.c                |  23 +++
 source3/libsmb/libsmb_file.c         | 202 ++--------------------
 source3/modules/nfs4_acls.c          |   4 +-
 source3/modules/non_posix_acls.c     |   2 +-
 source3/modules/vfs_acl_common.c     |  19 ++-
 source3/modules/vfs_acl_tdb.c        |  16 +-
 source3/modules/vfs_fake_acls.c      |  22 ++-
 source3/modules/vfs_gpfs.c           |   9 +-
 source3/modules/vfs_recycle.c        |   2 +-
 source3/modules/vfs_solarisacl.c     |   2 +-
 source3/modules/vfs_xattr_tdb.c      |   4 +-
 source3/selftest/tests.py            |   5 +-
 source3/smbd/close.c                 |  15 +-
 source3/smbd/globals.h               |   5 +
 source3/smbd/notify.c                |  33 +++-
 source3/smbd/posix_acls.c            |   2 +-
 source3/smbd/proto.h                 |   2 +
 source3/smbd/smb2_server.c           |  20 ++-
 source3/smbd/smb2_sesssetup.c        | 322 ++++++++++++++++++++---------------
 source3/smbd/smbXsrv_session.c       | 191 ++++++++++++++++++++-
 source3/smbd/vfs.c                   |  26 +++
 source3/utils/smbcacls.c             |   2 +-
 source3/winbindd/idmap_rfc2307.c     |   2 +-
 source3/winbindd/winbindd.c          |  26 +++
 source3/winbindd/winbindd.h          |   2 +
 source4/lib/tls/tls.c                |   3 +-
 source4/lib/tls/tls_tstream.c        |   7 +-
 source4/libcli/finddcs_cldap.c       |  42 +++--
 source4/torture/smb2/compound.c      | 239 ++++++++++++++++++++++++++
 source4/torture/smb2/notify.c        | 235 +++++++++++++++++++++++++
 40 files changed, 1369 insertions(+), 468 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 5237bce..610c2c8 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=1
-SAMBA_VERSION_RELEASE=18
+SAMBA_VERSION_RELEASE=19
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index a67c16a..f7b50ab 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,85 @@
                    ==============================
+                   Release Notes for Samba 4.1.19
+                            June 23, 2015
+                   ==============================
+
+
+This is the latest stable release of Samba 4.1.
+
+
+Changes since 4.1.18:
+---------------------
+
+o   Jeremy Allison <jra at samba.org>
+    * BUG 11068: s3: smbcacls: Ensure we read a hex number as %x, not %u.
+    * BUG 11249: Make mangled names work with acl_xattr.
+    * BUG 11295: Excessive cli_resolve_path() usage can slow down transmission.
+
+
+o   Ralph Boehme <slow at samba.org>
+    * BUG 11244: Error code path doesn't call END_PROFILE.
+    * BUG 11277: s3:smb2: Add padding to last command in compound requests.
+
+
+o   Alexander Bokovoy <ab at samba.org>
+    * BUG 11284: s4: libcli/finddcs_cldap: Continue processing CLDAP until all
+      addresses are used.
+
+
+o   Evangelos Foutras <evangelos at foutrelis.com>
+    * BUG 8780: s4:lib/tls: Fix build with gnutls 3.4.
+
+
+o   David Holder <david.holder at erion.co.uk>
+    * BUG 11283: s3: IPv6 enabled DNS connections for ADS client.
+
+
+o   Steve Howells <steve.howells at moscowfirst.com>
+    * BUG 10924: s4.2/fsmo.py: Fix fsmo transfer exception.
+
+
+o   Stefan Metzmacher <metze at samba.org>
+    * BUG 11141: s3:winbindd: Make sure we remove pending io requests before
+      closing client sockets.
+    * BUG 11182: Fix panic triggered by smbd_smb2_request_notify_done() ->
+      smbXsrv_session_find_channel() in smbd.
+
+
+o   Christof Schmitt <cs at samba.org>
+    * BUG 11313: idmap_rfc2307: Fix 'wbinfo --gid-to-sid' query.
+
+
+o   Uri Simchoni <urisimchoni at gmail.com>
+    * BUG 11267: libads: Record service ticket endtime for sealed ldap
+      connections.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the Samba 4.1 product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
+======================================================================
+
+                   ==============================
                    Release Notes for Samba 4.1.18
                             May 12, 2015
                    ==============================
@@ -124,10 +205,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
 
-======================================================================
 
                    ==============================
                    Release Notes for Samba 4.1.17
diff --git a/lib/addns/dns.h b/lib/addns/dns.h
index bf2ade3..de1897b 100644
--- a/lib/addns/dns.h
+++ b/lib/addns/dns.h
@@ -222,7 +222,7 @@ struct dns_update_request {
 struct dns_connection {
 	int32_t hType;
 	int s;
-	struct sockaddr RecvAddr;
+	struct sockaddr_storage RecvAddr;
 };
 
 struct dns_buffer {
diff --git a/lib/addns/dnssock.c b/lib/addns/dnssock.c
index 5f99519..bab20a4 100644
--- a/lib/addns/dnssock.c
+++ b/lib/addns/dnssock.c
@@ -27,6 +27,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 #include "system/select.h"
+#include "../lib/util/debug.h"
 
 static int destroy_dns_connection(struct dns_connection *conn)
 {
@@ -40,42 +41,58 @@ static DNS_ERROR dns_tcp_open( const char *nameserver,
 			       TALLOC_CTX *mem_ctx,
 			       struct dns_connection **result )
 {
-	uint32_t ulAddress;
-	struct hostent *pHost;
-	struct sockaddr_in s_in;
+	struct addrinfo hints;
+	struct addrinfo *ai_result = NULL;
+	struct addrinfo *rp;
 	struct dns_connection *conn;
-	int res;
+	int ret;
+	char service[16];
+
+	snprintf(service, sizeof(service), "%d", DNS_TCP_PORT);
 
 	if (!(conn = talloc(mem_ctx, struct dns_connection))) {
 		return ERROR_DNS_NO_MEMORY;
 	}
 
-	if ( (ulAddress = inet_addr( nameserver )) == INADDR_NONE ) {
-		if ( (pHost = gethostbyname( nameserver )) == NULL ) {
-			TALLOC_FREE(conn);
-			return ERROR_DNS_INVALID_NAME_SERVER;
-		}
-		memcpy( &ulAddress, pHost->h_addr, pHost->h_length );
-	}
+	memset(&hints, 0, sizeof(struct addrinfo));
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_socktype = SOCK_STREAM;
+	hints.ai_flags = 0;
+	hints.ai_protocol = IPPROTO_TCP;
 
-	conn->s = socket( PF_INET, SOCK_STREAM, 0 );
-	if (conn->s == -1) {
-		TALLOC_FREE(conn);
-		return ERROR_DNS_CONNECTION_FAILED;
+	ret = getaddrinfo(nameserver, service, &hints, &ai_result);
+	if (ret != 0) {
+		DEBUG(1,("dns_tcp_open: getaddrinfo: %s\n", gai_strerror(ret)));
+		return ERROR_DNS_INVALID_NAME_SERVER;
 	}
 
-	talloc_set_destructor(conn, destroy_dns_connection);
+	for (rp = ai_result; rp != NULL; rp = rp->ai_next) {
+		conn->s = socket(rp->ai_family,
+				rp->ai_socktype,
+				rp->ai_protocol);
+		if (conn->s == -1) {
+			continue;
+		}
+		do {
+			ret = connect(conn->s, rp->ai_addr, rp->ai_addrlen);
+		} while ((ret == -1) && (errno == EINTR));
+		if (ret != -1) {
+			/* Successful connect */
+			break;
+		}
+		close(conn->s);
+	}
 
-	s_in.sin_family = AF_INET;
-	s_in.sin_addr.s_addr = ulAddress;
-	s_in.sin_port = htons( DNS_TCP_PORT );
+	freeaddrinfo(ai_result);
 
-	res = connect(conn->s, (struct sockaddr*)&s_in, sizeof( s_in ));
-	if (res == -1) {
+	/* Failed to connect with any address */
+	if (rp == NULL) {
 		TALLOC_FREE(conn);
 		return ERROR_DNS_CONNECTION_FAILED;
 	}
 
+	talloc_set_destructor(conn, destroy_dns_connection);
+
 	conn->hType = DNS_TCP;
 
 	*result = conn;
@@ -89,44 +106,72 @@ static DNS_ERROR dns_udp_open( const char *nameserver,
 			       TALLOC_CTX *mem_ctx,
 			       struct dns_connection **result )
 {
-	unsigned long ulAddress;
-	struct hostent *pHost;
-	struct sockaddr_in RecvAddr;
+	struct addrinfo hints;
+	struct addrinfo *ai_result = NULL;
+	struct addrinfo *rp;
+	struct sockaddr_storage RecvAddr;
 	struct dns_connection *conn;
+	int ret;
+	socklen_t RecvAddrLen;
+	char service[16];
+
+	snprintf(service, sizeof(service), "%d", DNS_UDP_PORT);
 
 	if (!(conn = talloc(NULL, struct dns_connection))) {
 		return ERROR_DNS_NO_MEMORY;
 	}
 
-	if ( (ulAddress = inet_addr( nameserver )) == INADDR_NONE ) {
-		if ( (pHost = gethostbyname( nameserver )) == NULL ) {
-			TALLOC_FREE(conn);
-			return ERROR_DNS_INVALID_NAME_SERVER;
+	memset(&hints, 0, sizeof(struct addrinfo));
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_socktype = SOCK_DGRAM;
+	hints.ai_flags = 0;
+	hints.ai_protocol = IPPROTO_UDP;
+
+	ret = getaddrinfo(nameserver, service, &hints, &ai_result);
+	if (ret != 0) {
+		DEBUG(1,("dns_ucp_open:getaddrinfo: %s\n", gai_strerror(ret)));
+		TALLOC_FREE(conn);
+		return ERROR_DNS_INVALID_NAME_SERVER;
+	}
+
+	for (rp = ai_result; rp != NULL; rp = rp->ai_next) {
+		conn->s = socket(rp->ai_family,
+				rp->ai_socktype,
+				rp->ai_protocol);
+		if (conn->s == -1) {
+			continue;
 		}
-		memcpy( &ulAddress, pHost->h_addr, pHost->h_length );
+		ret = connect(conn->s, rp->ai_addr, rp->ai_addrlen);
+		if (ret != -1) {
+			/* Successful connect */
+			break;
+		}
+		close(conn->s);
 	}
 
-	/* Create a socket for sending data */
+	freeaddrinfo(ai_result);
 
-	conn->s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
-	if (conn->s == -1) {
+	/* Failed to connect with any address */
+	if (rp == NULL) {
 		TALLOC_FREE(conn);
-		return ERROR_DNS_CONNECTION_FAILED;
+                return ERROR_DNS_CONNECTION_FAILED;
 	}
 
 	talloc_set_destructor(conn, destroy_dns_connection);
 
 	/* Set up the RecvAddr structure with the IP address of
-	   the receiver (in this example case "123.456.789.1")
-	   and the specified port number. */
+	   the receiver and the specified port number. */
 
-	ZERO_STRUCT(RecvAddr);
-	RecvAddr.sin_family = AF_INET;
-	RecvAddr.sin_port = htons( DNS_UDP_PORT );
-	RecvAddr.sin_addr.s_addr = ulAddress;
+	RecvAddrLen = sizeof(RecvAddr);
+	if (getpeername(conn->s,
+			(struct sockaddr *)&RecvAddr,
+			&RecvAddrLen) == -1) {
+		TALLOC_FREE(conn);
+		return ERROR_DNS_CONNECTION_FAILED;
+	}
 
 	conn->hType = DNS_UDP;
-	memcpy( &conn->RecvAddr, &RecvAddr, sizeof( struct sockaddr_in ) );
+	memcpy(&conn->RecvAddr, &RecvAddr, sizeof(struct sockaddr_storage));
 
 	*result = conn;
 	return ERROR_DNS_SUCCESS;
diff --git a/nsswitch/tests/test_idmap_rfc2307.sh b/nsswitch/tests/test_idmap_rfc2307.sh
index b9efd34..fc4c383 100755
--- a/nsswitch/tests/test_idmap_rfc2307.sh
+++ b/nsswitch/tests/test_idmap_rfc2307.sh
@@ -1,21 +1,24 @@
 #!/bin/sh
 # Test id mapping through idmap_rfc2307 module
 if [ $# -lt 9 ]; then
-	echo Usage: $0 DOMAIN USERNAME UID GROUPNAME GID LDAPPREFIX DC_SERVER DC_USERNAME DC_PASSWORD
+	echo Usage: $0 DOMAIN USERNAME UID USERNAME2 UID2 GROUPNAME GID GROUPNAME2 GID2 LDAPPREFIX DC_SERVER DC_USERNAME DC_PASSWORD
 	exit 1
 fi
 
 DOMAIN="$1"
 USERNAME="$2"
 USERUID="$3"
-GROUPNAME="$4"
-GROUPGID="$5"
-LDAPPREFIX="$6"
-DC_SERVER="$7"
-DC_USERNAME="$8"
-DC_PASSWORD="$9"
-
-echo called with: $1 $2 $3 $4 $5 $6 $7 $8 $9
+USERNAME2="$4"
+USERUID2="$5"
+GROUPNAME="$6"
+GROUPGID="$7"
+GROUPNAME2="$8"
+GROUPGID2="$9"
+shift 9
+LDAPPREFIX="$1"
+DC_SERVER="$2"
+DC_USERNAME="$3"
+DC_PASSWORD="$4"
 
 wbinfo="$VALGRIND $BINDIR/wbinfo"
 ldbadd="$BINDIR/ldbadd"
@@ -26,7 +29,9 @@ failed=0
 
 # Delete LDAP records
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$USERNAME,$LDAPPREFIX"
+$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$USERNAME2,$LDAPPREFIX"
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$GROUPNAME,$LDAPPREFIX"
+$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$GROUPNAME2,$LDAPPREFIX"
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "$LDAPPREFIX"
 
 # Add id mapping information to LDAP
@@ -53,6 +58,20 @@ EOF
 testit "add ldap user mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb
 
 cat > $PREFIX/tmpldb <<EOF
+dn: cn=$USERNAME2,$LDAPPREFIX
+objectClass: organizationalPerson
+objectClass: posixAccount
+ou: People
+cn: $USERNAME2
+uid: $USERNAME2
+uidNumber: $USERUID2
+gidNumber: 2
+homeDirectory: /home/admin
+EOF
+
+testit "add second ldap user mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb
+
+cat > $PREFIX/tmpldb <<EOF
 dn: cn=$GROUPNAME,$LDAPPREFIX
 objectClass: posixGroup
 objectClass: groupOfNames
@@ -63,6 +82,17 @@ EOF
 
 testit "add ldap group mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb
 
+cat > $PREFIX/tmpldb <<EOF
+dn: cn=$GROUPNAME2,$LDAPPREFIX
+objectClass: posixGroup
+objectClass: groupOfNames
+cn: $GROUPNAME2
+gidNumber: $GROUPGID2
+member: cn=$USERNAME,$LDAPPREFIX
+EOF
+
+testit "add second ldap group mapping record" $VALGRIND $ldbadd -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD $PREFIX/tmpldb
+
 rm -f $PREFIX/tmpldbmodify
 
 testit "wbinfo --name-to-sid" $wbinfo --name-to-sid "$DOMAIN\\$USERNAME" || failed=$(expr $failed + 1)
@@ -86,9 +116,33 @@ echo "$DOMAIN\\$GROUPNAME resolved to $group_gid"
 
 testit "test $group_gid -eq $GROUPGID" test $group_gid -eq $GROUPGID || failed=$(expr $failed + 1)
 
+# Use different user and group for reverse lookup to not read from cache
+
+testit "$wbinfo --uid-to-sid=$USERUID2" $wbinfo --uid-to-sid=$USERUID2 || failed=$(expr $failed + 1)
+user_sid2=$($wbinfo --uid-to-sid=$USERUID2 | cut -d " " -f1)
+echo "UID $USERUID2 resolved to SID $user_sid2"
+
+testit "$wbinfo --sid-to-name=$user_sid2" $wbinfo --sid-to-name=$user_sid2 || failed=$(expr $failed + 1)
+user_name2=$($wbinfo --sid-to-name=$user_sid2 | cut -d " " -f1)
+echo "SID $user_sid2 resolved to $user_name2"
+
+testit "test $user_name2 = $DOMAIN\\$USERNAME2" test "$(echo $user_name2 | tr A-Z a-z)" = "$(echo $DOMAIN\\$USERNAME2 | tr A-Z a-z)" || failed=$(expr $failed + 1)
+
+testit "$wbinfo --gid-to-sid=$GROUPGID2" $wbinfo --gid-to-sid=$GROUPGID2 || failed=$(expr $failed + 1)
+group_sid2=$($wbinfo --gid-to-sid=$GROUPGID2 | cut -d " " -f1)
+echo "GID $GROUPGID2 resolved to SID $group_sid2"
+
+testit "$wbinfo --sid-to-name=$group_sid2" $wbinfo --sid-to-name=$group_sid2 || failed=$(expr $failed + 1)
+group_name2=$($wbinfo --sid-to-name=$group_sid2 | cut -d " " -f1)
+echo "SID $group_sid2 resolved to $group_name2"
+
+testit "test $group_name2 = $DOMAIN\\$GROUPNAME2" test "$(echo $group_name2 | tr A-Z a-z)" = "$(echo $DOMAIN\\$GROUPNAME2 | tr A-Z a-z)" || failed=$(expr $failed + 1)
+
 # Delete LDAP records
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$USERNAME,$LDAPPREFIX"
+$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$USERNAME2,$LDAPPREFIX"
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$GROUPNAME,$LDAPPREFIX"
+$VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "cn=$GROUPNAME2,$LDAPPREFIX"
 $VALGRIND $ldbdel -H ldap://$DC_SERVER -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD "$LDAPPREFIX"
 
 exit $failed
diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py
index 02721f9..1bc4a96 100644
--- a/python/samba/netcmd/fsmo.py
+++ b/python/samba/netcmd/fsmo.py
@@ -50,7 +50,6 @@ def transfer_role(outf, role, samdb):
         m["becomeDomainMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,
             "becomeDomainMaster")
-        samdb.modify(m)
     elif role == "infrastructure":
         m["becomeInfrastructureMaster"]= ldb.MessageElement(
             "1", ldb.FLAG_MOD_REPLACE,
diff --git a/selftest/knownfail b/selftest/knownfail
index 8d11dfe..104ddbd 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -187,7 +187,6 @@
 ^samba3.smb2.create.open
 ^samba3.smb2.create.leading-slash
 ^samba3.smb2.notify.valid-req
-^samba3.smb2.notify.dir
 ^samba3.smb2.notify.rec
 ^samba3.smb2.durable-open.lock-lease
 ^samba3.smb2.durable-open.reopen4
diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h
index 65fad99..38cd5a1 100644
--- a/source3/include/libsmb_internal.h
+++ b/source3/include/libsmb_internal.h
@@ -100,6 +100,11 @@ struct smbc_dir_list {
  */
 struct _SMBCFILE {
 	int cli_fd;
+	/*
+	 * cache of cli_state we opened cli_fd on.
+	 * Due to DFS can be a subsidiary connection to srv->cli
+	 */
+	struct cli_state *targetcli;
 	char *fname;
 	off_t offset;
 	struct _SMBCSRV *srv;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 9e6ac9c..641a67e 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1827,48 +1827,60 @@ bool unix_wild_match(const char *pattern, const char *string)
 }
 
 /**********************************************************************
- Converts a name to a fully qualified domain name.
- Returns true if lookup succeeded, false if not (then fqdn is set to name)
- Note we deliberately use gethostbyname here, not getaddrinfo as we want
- to examine the h_aliases and I don't know how to do that with getaddrinfo.
+  Converts a name to a fully qualified domain name.
+  Returns true if lookup succeeded, false if not (then fqdn is set to name)
+  Uses getaddrinfo() with AI_CANONNAME flag to obtain the official
+  canonical name of the host. getaddrinfo() may use a variety of sources
+  including /etc/hosts to obtain the domainname. It expects aliases in
+  /etc/hosts to NOT be the FQDN. The FQDN should come first.
 ***********************************************************************/
 
 bool name_to_fqdn(fstring fqdn, const char *name)
 {
 	char *full = NULL;
-	struct hostent *hp = gethostbyname(name);
+	struct addrinfo hints;
+	struct addrinfo *result;
+	int s;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list