[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre2-2013-gb5b72c3

Gerald Carter jerry at samba.org
Wed Apr 23 18:50:21 GMT 2008


The branch, v3-2-stable has been updated
       via  b5b72c3784d4de77f4cd221fc3f2ca99753b8b5b (commit)
       via  5f4b77eb63f72a3004c0c7e760e85fa08c339a7d (commit)
       via  c174826ee57b1b3b34eec080ca6474c9cc34cfa0 (commit)
       via  d14b5874eeaeec57834926ae487675dd5f877494 (commit)
       via  85d1b1022642d4a3b2e08aa0418761f990705ee2 (commit)
       via  e3d871fd023681f12d2d676ae01c13f3b7ac64b2 (commit)
       via  e209c8bd1c399b6561083d938bf73b0e99d685ce (commit)
       via  50484870c4a95df8416c474b29108c6d1988796e (commit)
       via  ec529a01511e9daf8485c51e1bc126f00dcfccb7 (commit)
       via  f2a098f49f4e261b8d4fb069d4e147f90ac6e9e6 (commit)
       via  e6b201327042867fcf0f63f6bde9ca9ab2ac97f6 (commit)
       via  6369f12301c192502891848d3c6a87d75c3b2eb3 (commit)
       via  d47a4dacd1cbb4fa04179d5bf51b216115b93f54 (commit)
       via  66b3aa66d41584de5831be23c2b37c8a7874beb9 (commit)
       via  bb972ecec6f6c3e835df724a99a30895f60c1cf3 (commit)
       via  e71ceebea239d3331a1c7f413da6b867acb11cd1 (commit)
       via  ce0a5aae3e4fdae1dfcaf211f8642dcd8580df7d (commit)
       via  473d520bac3ddeb30ab850eb8916086783ae26e1 (commit)
       via  68b91c5d666edeb1e9994ff09905671fb041603b (commit)
       via  adc0349dc3033ce1dfbc07c67b20a57406bff771 (commit)
       via  40331fba56cb79ff109ee092c028feffb819cc66 (commit)
      from  f6c725bc75cd5e6256536fe6fbf9a49566a5716f (commit)

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


- Log -----------------------------------------------------------------
commit b5b72c3784d4de77f4cd221fc3f2ca99753b8b5b
Author: Michael Adam <obnox at samba.org>
Date:   Sun Apr 20 22:17:39 2008 +0200

    libwbclient: change wbcResolveWinsByIP() to take char ** instead of const char **
    
    Fix a compile warning. This seems the right thing since the data is created
    by talloc_strdup...
    
    Michael
    (cherry picked from commit f81da8e8ed8e2d75c77bd8b5e7fdd7c53bab7e49)

commit 5f4b77eb63f72a3004c0c7e760e85fa08c339a7d
Author: Michael Adam <obnox at samba.org>
Date:   Sun Apr 20 22:13:40 2008 +0200

    libwbclient: fix wbcResolveWinsByName() to take char * instead of const char **
    
    This fixes a compile warning and seems the correct thing to me as
    the returned data is talloc_strdup't, so not const anyways.
    
    Michael
    (cherry picked from commit 13cfa7f48a541a934a129fab0544cbf66029c4c7)

commit c174826ee57b1b3b34eec080ca6474c9cc34cfa0
Author: Charles <neologix at free.fr>
Date:   Tue Mar 11 19:49:08 2008 +0100

    The attached patch removes some global variables, and make them local to main().
    (cherry picked from commit 50cab87d3ee6d701dd8847f4e0a058f5e2d80e0f)

commit d14b5874eeaeec57834926ae487675dd5f877494
Author: Charles <neologix at free.fr>
Date:   Sun Mar 9 19:52:29 2008 +0100

    Fix return code.
    (cherry picked from commit 98b643366044f471ad69c9e5aac06022f30742d9)

commit 85d1b1022642d4a3b2e08aa0418761f990705ee2
Author: Charles <neologix at free.fr>
Date:   Sun Mar 9 13:50:56 2008 +0100

    smbget: Make global variables static.
    (cherry picked from commit c430b7831d5dc6f81cfd18ee2bf24bc3f276fe5d)

commit e3d871fd023681f12d2d676ae01c13f3b7ac64b2
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Mar 5 17:30:18 2008 +0100

    Fix formatting.
    (cherry picked from commit e2345ce90c3f1548f63d720c5943c8d61fdc899a)

commit e209c8bd1c399b6561083d938bf73b0e99d685ce
Author: Charles <neologix at free.fr>
Date:   Wed Mar 5 15:20:29 2008 +0100

    Add --update option to smbget.
    (cherry picked from commit 3cfa35fca64b059b307668ca0113503679e0b1fa)

commit 50484870c4a95df8416c474b29108c6d1988796e
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 18 00:30:50 2008 -0700

    Janitor for tridge. Keep lib/replace in sync with the gcc4
    changes.
    Jeremy.
    (cherry picked from commit b496f133228b74bf613dab81167a5b9670511c51)

commit ec529a01511e9daf8485c51e1bc126f00dcfccb7
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 17 09:24:54 2008 -0700

    Fix the problem when -L is used with IPv6 addresses. Don't try to
    connect on port 139 with IPv6. Found by David Holder @ Erion.
    Karolin please merge to 3.2-stable.
    Jeremy.
    (cherry picked from commit c003e66ff10b23bb30aef0071ba7a3ae9579174e)

commit f2a098f49f4e261b8d4fb069d4e147f90ac6e9e6
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 17 08:02:46 2008 -0700

    Fix gcc uninitialized variable used warning.
    Jeremy.
    (cherry picked from commit b95f2adeb5e2f7ce71e46e6a6165159483c9a702)

commit e6b201327042867fcf0f63f6bde9ca9ab2ac97f6
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 11 17:41:49 2008 -0700

    Fix bug #5386, don't keep printing the same waiting
    error message.
    Jeremy.
    (cherry picked from commit 12e6818df1c77810a59a2896f8c44c91fc24e7ae)

commit 6369f12301c192502891848d3c6a87d75c3b2eb3
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 11 17:23:48 2008 -0700

    Quieten valgrind message on make valgrindtest. This doesn't
    seem to be valid (vl - feel free to confirm).
    Jeremy.
    (cherry picked from commit 43b0254d93540eeaddaa32d76dd9271f4dc2ebff)

commit d47a4dacd1cbb4fa04179d5bf51b216115b93f54
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Apr 8 15:08:47 2008 -0700

    Check x_fflush returns.
    Jeremy.
    (cherry picked from commit 5525dc5f09a79d30f6c52fc3a88c8bce3060e642)

commit 66b3aa66d41584de5831be23c2b37c8a7874beb9
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 27 14:23:20 2008 -0700

    Fix for termination problems when no interfaces found - bug #5267.
    Jeremy.
    (cherry picked from commit 4b03f4eb2da7a523967ace3d13e79406ade07d47)

commit bb972ecec6f6c3e835df724a99a30895f60c1cf3
Author: Gerald W. Carter <jerry at samba.org>
Date:   Wed Apr 23 11:26:35 2008 -0500

    Use wbinfo --online-status in make test rather than --sequence
    (cherry picked from commit f8c364da94fac96450116be980e38ddddd3f304a)

commit e71ceebea239d3331a1c7f413da6b867acb11cd1
Author: Gerald W. Carter <jerry at samba.org>
Date:   Tue Apr 22 15:29:53 2008 -0500

    Mark a domain offline in the wbcDomainInfo structure using the domain_flags.
    
    Use the existing domain_flags fiueld in wbcDomainInfo to set a bit if the
    domain is marked as offline by Winbind.
    (cherry picked from commit 59cfba2c3d6d4594f08cbe3b7295ab36a7cfb044)

commit ce0a5aae3e4fdae1dfcaf211f8642dcd8580df7d
Author: Gerald W. Carter <jerry at samba.org>
Date:   Tue Apr 22 12:22:59 2008 -0500

    Rename WBC_DOMAIN_XXX domain flags to WBC_DOMINFO_DOMAIN_XXX
    
    Better consistency with the othre classes of WBC_DOMINDO_XXX_YYYY flags.
    (cherry picked from commit 1cb2305fc96be0c190621f7c86c0476e4ea1fff7)

commit 473d520bac3ddeb30ab850eb8916086783ae26e1
Author: Gerald W. Carter <jerry at samba.org>
Date:   Thu Apr 17 18:07:18 2008 +0200

    Convert "wbinfo -m" to use wbcListTrusts() API call.
    (cherry picked from commit 2fbe8437efe232b6f53af6fafed5995fe7e26820)

commit 68b91c5d666edeb1e9994ff09905671fb041603b
Author: Gerald W. Carter <jerry at samba.org>
Date:   Thu Apr 17 18:06:10 2008 +0200

    Add wbcListTrusts() API call to libwbclient.so
    (cherry picked from commit 5c454e77cf664fee65fcb03e5811764c92e73696)

commit adc0349dc3033ce1dfbc07c67b20a57406bff771
Author: Gerald W. Carter <jerry at samba.org>
Date:   Wed Apr 16 15:48:00 2008 +0200

    Fix out of tree build.  Remove the embedded srcdir path from talloc and tdb.
    (cherry picked from commit 359921acd436684a0b4cf76ba15f82a224d2c337)

commit 40331fba56cb79ff109ee092c028feffb819cc66
Author: Gerald W. Carter <jerry at samba.org>
Date:   Mon Mar 31 14:33:53 2008 -0500

    Patch from Nicholas Brealey <nick at brealey.org> to distinguish between WinXP and WinXP64.
    
    Defines a new value for the %a variable when detecting a Windows XP 64-bit client.
    (cherry picked from commit 0c94918fb52c5345ce30490046b79f81712c30bf)

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

Summary of changes:
 source/Makefile.in                     |    4 +-
 source/client/client.c                 |    8 +
 source/configure.in                    |    4 +-
 source/include/smb.h                   |    2 +-
 source/lib/replace/libreplace_cc.m4    |    3 +-
 source/lib/replace/replace.c           |    2 +-
 source/lib/replace/replace.h           |    2 +-
 source/lib/talloc/libtalloc.m4         |    8 +-
 source/lib/util.c                      |    5 +-
 source/lib/xfile.c                     |   12 +-
 source/librpc/ndr/ndr_basic.c          |    4 +-
 source/locking/brlock.c                |    5 +
 source/nmbd/nmbd.c                     |   30 +++--
 source/nsswitch/libwbclient/wbc_util.c |  240 ++++++++++++++++++++++++++++++-
 source/nsswitch/libwbclient/wbclient.h |   36 ++++-
 source/nsswitch/wbinfo.c               |  196 ++++++++++++---------------
 source/script/tests/test_wbinfo_s3.sh  |    6 +-
 source/utils/net_rpc_samsync.c         |   11 +-
 source/utils/smbget.c                  |   54 +++++--
 source/winbindd/winbindd_misc.c        |   18 ++-
 20 files changed, 470 insertions(+), 180 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index b697772..5b2966a 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -150,7 +150,7 @@ LIBTDB_SHARED_TARGET=@LIBTDB_SHARED_TARGET@
 LIBTDB_STATIC_TARGET=@LIBTDB_STATIC_TARGET@
 LIBTDB=$(LIBTDB_STATIC_TARGET) @LIBTDB_SHARED@
 LIBTDB_SYMS=$(srcdir)/exports/libtdb.syms
-LIBTDB_HEADERS=@tdbdir@/include/tdb.h
+LIBTDB_HEADERS=$(srcdir)/@tdbdir@/include/tdb.h
 
 LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
 LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
@@ -2118,7 +2118,7 @@ installlibtalloc: installdirs libtalloc
 	-$(INSTALLLIBCMD_SH) $(LIBTALLOC_SHARED_TARGET) $(DESTDIR)$(LIBDIR)
 	-$(INSTALLLIBCMD_A) $(LIBTALLOC_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
 	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
-	-$(INSTALLCMD) -m $(INSTALLPERMS_DATA) @tallocdir@/talloc.h $(DESTDIR)${prefix}/include
+	-$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/@tallocdir@/talloc.h $(DESTDIR)${prefix}/include
 
 installlibtdb: installdirs libtdb
 	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
diff --git a/source/client/client.c b/source/client/client.c
index 882ed4d..276ffb9 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -4514,6 +4514,8 @@ static int process(const char *base_directory)
 
 static int do_host_query(const char *query_host)
 {
+	struct sockaddr_storage ss;
+
 	cli = cli_cm_open(talloc_tos(), NULL,
 			query_host, "IPC$", true, smb_encrypt);
 	if (!cli)
@@ -4521,6 +4523,12 @@ static int do_host_query(const char *query_host)
 
 	browse_host(true);
 
+	if (interpret_string_addr(&ss, query_host, 0) && (ss.ss_family != AF_INET)) {
+		d_printf("%s is an IPv6 address -- no workgroup available\n",
+			query_host);
+		return 1;
+	}
+
 	if (port != 139) {
 
 		/* Workgroups simply don't make sense over anything
diff --git a/source/configure.in b/source/configure.in
index 7d6b189..f2b60a0 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -33,9 +33,9 @@ AC_SUBST(TALLOC_OBJS)
 
 # TODO: These should come from m4_include(lib/tdb/libtdb.m4)
 # but currently this fails: things have to get merged from s4.
-tdbdir="${srcdir-.}/lib/tdb"
+tdbdir="lib/tdb"
 AC_SUBST(tdbdir)
-TDB_CFLAGS="-I$tdbdir/include"
+TDB_CFLAGS="-I${srcdir-.}/$tdbdir/include"
 AC_SUBST(TDB_CFLAGS)
 TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
 TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o"
diff --git a/source/include/smb.h b/source/include/smb.h
index 4a086e1..598708b 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -1580,7 +1580,7 @@ enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PAS
 /* Remote architectures we know about. */
 enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
 			RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
-			RA_SAMBA, RA_CIFSFS};
+			RA_SAMBA, RA_CIFSFS, RA_WINXP64};
 
 /* case handling */
 enum case_handling {CASE_LOWER,CASE_UPPER};
diff --git a/source/lib/replace/libreplace_cc.m4 b/source/lib/replace/libreplace_cc.m4
index bf50568..0ce0958 100644
--- a/source/lib/replace/libreplace_cc.m4
+++ b/source/lib/replace/libreplace_cc.m4
@@ -132,7 +132,8 @@ AC_CHECK_SIZEOF(off_t)
 AC_CHECK_SIZEOF(size_t)
 AC_CHECK_SIZEOF(ssize_t)
 
-AC_CHECK_TYPE(intptr_t, unsigned long long)
+AC_CHECK_TYPE(intptr_t, long long)
+AC_CHECK_TYPE(uintptr_t, unsigned long long)
 AC_CHECK_TYPE(ptrdiff_t, unsigned long long)
 
 if test x"$ac_cv_type_long_long" != x"yes";then
diff --git a/source/lib/replace/replace.c b/source/lib/replace/replace.c
index 6930f9b..443da2a 100644
--- a/source/lib/replace/replace.c
+++ b/source/lib/replace/replace.c
@@ -458,7 +458,7 @@ char *rep_strcasestr(const char *haystack, const char *needle)
 	for (s=haystack;*s;s++) {
 		if (toupper(*needle) == toupper(*s) &&
 		    strncasecmp(s, needle, nlen) == 0) {
-			return (char *)((intptr_t)s);
+			return (char *)((uintptr_t)s);
 		}
 	}
 	return NULL;
diff --git a/source/lib/replace/replace.h b/source/lib/replace/replace.h
index 5fe7939..bf95169 100644
--- a/source/lib/replace/replace.h
+++ b/source/lib/replace/replace.h
@@ -499,7 +499,7 @@ typedef int bool;
   Also, please call this via the discard_const_p() macro interface, as that
   makes the return type safe.
 */
-#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
 
 /** Type-safe version of discard_const */
 #define discard_const_p(type, ptr) ((type *)discard_const(ptr))
diff --git a/source/lib/talloc/libtalloc.m4 b/source/lib/talloc/libtalloc.m4
index d2e8eba..fd2b4b2 100644
--- a/source/lib/talloc/libtalloc.m4
+++ b/source/lib/talloc/libtalloc.m4
@@ -1,10 +1,10 @@
 dnl find the talloc sources. This is meant to work both for 
 dnl talloc standalone builds, and builds of packages using talloc
 tallocdir=""
-tallocpaths="$srcdir $srcdir/lib/talloc $srcdir/talloc $srcdir/../talloc"
+tallocpaths=". lib/talloc talloc ../talloc"
 for d in $tallocpaths; do
-	if test -f "$d/talloc.c"; then
-		tallocdir="$d"		
+	if test -f "$srcdir/$d/talloc.c"; then
+		tallocdir="$d"
 		AC_SUBST(tallocdir)
 		break;
 	fi
@@ -15,7 +15,7 @@ fi
 TALLOC_OBJ="talloc.o"
 AC_SUBST(TALLOC_OBJ)
 
-TALLOC_CFLAGS="-I$tallocdir"
+TALLOC_CFLAGS="-I$srcdir/$tallocdir"
 AC_SUBST(TALLOC_CFLAGS)
 
 TALLOC_LIBS=""
diff --git a/source/lib/util.c b/source/lib/util.c
index 3b2d375..db0da54 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -2087,7 +2087,7 @@ void ra_lanman_string( const char *native_lanman )
 	if ( strcmp( native_lanman, "Windows 2002 5.1" ) == 0 )
 		set_remote_arch( RA_WINXP );
 	else if ( strcmp( native_lanman, "Windows XP 5.2" ) == 0 )
-		set_remote_arch( RA_WINXP );
+		set_remote_arch( RA_WINXP64 );
 	else if ( strcmp( native_lanman, "Windows Server 2003 5.2" ) == 0 )
 		set_remote_arch( RA_WIN2K3 );
 }
@@ -2128,6 +2128,9 @@ void set_remote_arch(enum remote_arch_types type)
 	case RA_WINXP:
 		remote_arch_str = "WinXP";
 		break;
+	case RA_WINXP64:
+		remote_arch_str = "WinXP64";
+		break;
 	case RA_WIN2K3:
 		remote_arch_str = "Win2K3";
 		break;
diff --git a/source/lib/xfile.c b/source/lib/xfile.c
index ee6e581..d20a95b 100644
--- a/source/lib/xfile.c
+++ b/source/lib/xfile.c
@@ -47,7 +47,7 @@ XFILE *x_stderr = &_x_stderr;
 /* simulate setvbuf() */
 int x_setvbuf(XFILE *f, char *buf, int mode, size_t size)
 {
-	x_fflush(f);
+	if (x_fflush(f) != 0) return -1;
 	if (f->bufused) return -1;
 
 	/* on files being read full buffering is the only option */
@@ -150,7 +150,7 @@ int x_fclose(XFILE *f)
 	int ret;
 
 	/* make sure we flush any buffered data */
-	x_fflush(f);
+	(void)x_fflush(f);
 
 	ret = close(f->fd);
 	f->fd = -1;
@@ -189,7 +189,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
 
 		if (n == 0) {
 			/* it's full, flush it */
-			x_fflush(f);
+			if (x_fflush(f) != 0) {
+				return -1;
+			}
 			continue;
 		}
 
@@ -204,7 +206,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
 		int i;
 		for (i=(size*nmemb)-1; i>=0; i--) {
 			if (*(i+(const char *)p) == '\n') {
-				x_fflush(f);
+				if (x_fflush(f) != 0) {
+					return -1;
+				}
 				break;
 			}
 		}
diff --git a/source/librpc/ndr/ndr_basic.c b/source/librpc/ndr/ndr_basic.c
index f342c6e..c8fa70b 100644
--- a/source/librpc/ndr/ndr_basic.c
+++ b/source/librpc/ndr/ndr_basic.c
@@ -196,7 +196,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, u
 */
 _PUBLIC_ enum ndr_err_code ndr_pull_pointer(struct ndr_pull *ndr, int ndr_flags, void* *v)
 {
-	intptr_t h;
+	uintptr_t h;
 	NDR_PULL_ALIGN(ndr, sizeof(h));
 	NDR_PULL_NEED_BYTES(ndr, sizeof(h));
 	memcpy(&h, ndr->data+ndr->offset, sizeof(h));
@@ -393,7 +393,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, u
 */
 _PUBLIC_ enum ndr_err_code ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v)
 {
-	intptr_t h = (intptr_t)v;
+	uintptr_t h = (intptr_t)v;
 	NDR_PUSH_ALIGN(ndr, sizeof(h));
 	NDR_PUSH_NEED_BYTES(ndr, sizeof(h));
 	memcpy(ndr->data+ndr->offset, &h, sizeof(h));
diff --git a/source/locking/brlock.c b/source/locking/brlock.c
index 940dfbf..032aaa5 100644
--- a/source/locking/brlock.c
+++ b/source/locking/brlock.c
@@ -749,6 +749,11 @@ NTSTATUS brl_lock(struct messaging_context *msg_ctx,
 	}
 #endif
 
+#ifdef DEVELOPER
+	/* Quieten valgrind on test. */
+	memset(&lock, '\0', sizeof(lock));
+#endif
+
 	lock.context.smbpid = smbpid;
 	lock.context.pid = pid;
 	lock.context.tid = br_lck->fsp->conn->cnum;
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 234c4d5..9396219 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -170,6 +170,7 @@ static void reload_interfaces(time_t t)
 {
 	static time_t lastt;
 	int n;
+	bool print_waiting_msg = true;
 	struct subnet_record *subrec;
 
 	if (t && ((t - lastt) < NMBD_INTERFACES_RELOAD)) {
@@ -182,12 +183,12 @@ static void reload_interfaces(time_t t)
 		return;
 	}
 
+  try_again:
+
 	/* the list of probed interfaces has changed, we may need to add/remove
 	   some subnets */
 	load_interfaces();
 
-  try_again:
-
 	/* find any interfaces that need adding */
 	for (n=iface_count() - 1; n >= 0; n--) {
 		char str[INET6_ADDRSTRLEN];
@@ -278,29 +279,40 @@ static void reload_interfaces(time_t t)
 
 	/* We need to wait if there are no subnets... */
 	if (FIRST_SUBNET == NULL) {
-		void (*saved_handler)(int);
 
-		DEBUG(0,("reload_interfaces: "
-			"No subnets to listen to. Waiting..\n"));
+		if (print_waiting_msg) {
+			DEBUG(0,("reload_interfaces: "
+				"No subnets to listen to. Waiting..\n"));
+			print_waiting_msg = false;
+		}
 
 		/*
 		 * Whilst we're waiting for an interface, allow SIGTERM to
 		 * cause us to exit.
 		 */
 
-		saved_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL );
+		BlockSignals(false, SIGTERM);
 
 		/* We only count IPv4 interfaces here. */
-		while (iface_count_v4() == 0) {
+		while (iface_count_v4() == 0 && !got_sig_term) {
 			sleep(5);
 			load_interfaces();
 		}
 
 		/*
-		 * We got an interface, restore our normal term handler.
+		 * Handle termination inband.
+		 */
+
+		if (got_sig_term) {
+			got_sig_term = 0;
+			terminate();
+		}
+
+		/*
+		 * We got an interface, go back to blocking term.
 		 */
 
-		CatchSignal( SIGTERM, SIGNAL_CAST saved_handler );
+		BlockSignals(true, SIGTERM);
 		goto try_again;
 	}
 }
diff --git a/source/nsswitch/libwbclient/wbc_util.c b/source/nsswitch/libwbclient/wbc_util.c
index edcad28..3afd8a2 100644
--- a/source/nsswitch/libwbclient/wbc_util.c
+++ b/source/nsswitch/libwbclient/wbc_util.c
@@ -3,7 +3,7 @@
 
    Winbind client API
 
-   Copyright (C) Gerald (Jerry) Carter 2007
+   Copyright (C) Gerald (Jerry) Carter 2007-2008
 
 
    This library is free software; you can redistribute it and/or
@@ -170,11 +170,11 @@ wbcErr wbcDomainInfo(const char *domain, struct wbcDomainInfo **dinfo)
 	BAIL_ON_WBC_ERROR(wbc_status);
 
 	if (response.data.domain_info.native_mode)
-		info->flags |= WBC_DOMINFO_NATIVE;
+		info->domain_flags |= WBC_DOMINFO_DOMAIN_NATIVE;
 	if (response.data.domain_info.active_directory)
-		info->flags |= WBC_DOMINFO_AD;
+		info->domain_flags |= WBC_DOMINFO_DOMAIN_AD;
 	if (response.data.domain_info.primary)
-		info->flags |= WBC_DOMINFO_PRIMARY;
+		info->domain_flags |= WBC_DOMINFO_DOMAIN_PRIMARY;
 
 	*dinfo = info;
 
@@ -197,12 +197,12 @@ wbcErr wbcDomainInfo(const char *domain, struct wbcDomainInfo **dinfo)
  * @return #wbcErr
  *
  **/
-wbcErr wbcResolveWinsByName(const char *name, const char **ip)
+wbcErr wbcResolveWinsByName(const char *name, char **ip)
 {
 	struct winbindd_request request;
 	struct winbindd_response response;
 	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
-	const char *ipaddr;
+	char *ipaddr;
 
 	ZERO_STRUCT(request);
 	ZERO_STRUCT(response);
@@ -237,12 +237,12 @@ wbcErr wbcResolveWinsByName(const char *name, const char **ip)
  * @return #wbcErr
  *
  **/
-wbcErr wbcResolveWinsByIP(const char *ip, const char **name)
+wbcErr wbcResolveWinsByIP(const char *ip, char **name)
 {
 	struct winbindd_request request;
 	struct winbindd_response response;
 	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
-	const char *name_str;
+	char *name_str;
 
 	ZERO_STRUCT(request);
 	ZERO_STRUCT(response);
@@ -268,3 +268,227 @@ wbcErr wbcResolveWinsByIP(const char *ip, const char **name)
  done:
 	return wbc_status;
 }
+
+/**
+ */
+
+static wbcErr process_domain_info_string(TALLOC_CTX *ctx, 
+					 struct wbcDomainInfo *info,
+					 char *info_string)
+{
+	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
+	char *r = NULL;
+	char *s = NULL;
+
+	if (!info || !info_string) {
+		wbc_status = WBC_ERR_INVALID_PARAM;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+
+	r = info_string;
+
+	/* Short Name */
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	info->short_name = talloc_strdup(ctx, r);
+	BAIL_ON_PTR_ERROR(info->short_name, wbc_status);
+
+
+	/* DNS Name */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	info->dns_name = talloc_strdup(ctx, r);
+	BAIL_ON_PTR_ERROR(info->dns_name, wbc_status);
+
+	/* SID */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	wbc_status = wbcStringToSid(r, &info->sid);
+	BAIL_ON_WBC_ERROR(wbc_status);
+	
+	/* Trust type */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	if (strcmp(r, "None") == 0) {
+		info->trust_type = WBC_DOMINFO_TRUSTTYPE_NONE;
+	} else if (strcmp(r, "External") == 0) {
+		info->trust_type = WBC_DOMINFO_TRUSTTYPE_EXTERNAL;
+	} else if (strcmp(r, "Forest") == 0) {
+		info->trust_type = WBC_DOMINFO_TRUSTTYPE_FOREST;
+	} else if (strcmp(r, "In Forest") == 0) {
+		info->trust_type = WBC_DOMINFO_TRUSTTYPE_IN_FOREST;
+	} else {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+
+	/* Transitive */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	if (strcmp(r, "Yes") == 0) {
+		info->trust_flags |= WBC_DOMINFO_TRUST_TRANSITIVE;		
+	}
+	
+	/* Incoming */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	if (strcmp(r, "Yes") == 0) {
+		info->trust_flags |= WBC_DOMINFO_TRUST_INCOMING;		
+	}
+
+	/* Outgoing */
+	r = s;
+	if ((s = strchr(r, '\\')) == NULL) {
+		wbc_status = WBC_ERR_INVALID_RESPONSE;
+		BAIL_ON_WBC_ERROR(wbc_status);
+	}
+	*s = '\0';
+	s++;
+
+	if (strcmp(r, "Yes") == 0) {
+		info->trust_flags |= WBC_DOMINFO_TRUST_OUTGOING;		


-- 
Samba Shared Repository


More information about the samba-cvs mailing list