[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Mon Mar 10 11:38:05 MDT 2014


The branch, v4-0-test has been updated
       via  24fec62 s3-spoolssd: Don't register spoolssd if epmd is not running.
       via  9537207 s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
       via  099a02a s3:winbindd: fix _wbint_LookupSids() on error
       via  cc754e6 pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
       via  52990c9 s3: smbd: Ensure brl_get_locks_internal() always returns a valid struct byte_range_lock even if there are no locks.
       via  f4b8045 s3-printing: Fix obvious memory leak in printer_list_get_printer().
       via  a8fb002 rpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE
       via  fd8d469 s3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.
       via  e1f7cbc waf: improve iconv checks
       via  f33c3ad heimdal_build: only enable libintl functions if everything was found
       via  8b062f1 waf:lib/replace fix iconv checks on HP/UX
       via  4aafa69 waf:lib/replace gettext configure checks
       via  e8ab980 waf:lib/replace fix gettext detection
       via  7346b57 waf:lib/replace change detection of gettext
       via  f4e1771 waf:lib/replace fix up libintl related checks
       via  0d2e0d4 waf:lib/replace correct detection of libiconv
      from  68c6cb5 s3: printing: Fix problem with server taking too long to respond to a MSG_PRINTER_DRVUPGRADE message.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 24fec624bc342fd066233657a3cadfe05bd6b20f
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Feb 27 09:58:27 2014 +0100

    s3-spoolssd: Don't register spoolssd if epmd is not running.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10474
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 562ade624a78a11a5af0f26b04df93d76d6166bd)
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Mon Mar 10 18:37:25 CET 2014 on sn-devel-104

commit 953720784a0fe2a73e7db6d617ff181394465094
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Feb 20 11:25:53 2014 +0100

    s3:winbindd: avoid directly asking a trusted domain in wb_lookupsids*()
    
    As a domain member we should always use a DC of our own domain.
    
    It would be possible to pass all sids in one single dcerpc_wbint_LookupSids()
    call. For now we just fix bug.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 66fb0ce9557553a4c01607b517e65ac4c93841d0)

commit 099a02a11db054fb2f42c42ded40ec4bce9b6fb9
Author: Gregor Beck <gbeck at sernet.de>
Date:   Thu Feb 20 13:14:31 2014 +0100

    s3:winbindd: fix _wbint_LookupSids() on error
    
    We need to make sure that r->out.domains remains valid,
    otherwise we're not able to marshall the response.
    
    Note that wbint_LookupSids() has [out,ref] lsa_RefDomainList *domains,
    while lsa_LookupSids() has [out,ref] lsa_RefDomainList **domains.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10458
    Signed-off-by: Gregor Beck <gbeck at sernet.de>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 3413e64149702136429d7b5acaa7a52c49abf564)

commit cc754e627329cdeef5b1c2ce1d8490eec07d7753
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 26 01:20:10 2013 +0200

    pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit f50b561336c7b6c08300e6e477859d1f9fab62c2)

commit 52990c9a211362006ab4d262a8c90bd3891252fb
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Feb 27 16:19:53 2014 -0800

    s3: smbd: Ensure brl_get_locks_internal() always returns a valid struct byte_range_lock even if there are no locks.
    
    brl_get_locks_internal() currently returns NULL when it can't
    find any byte range locks on the file. This is an error - it
    should return a valid struct byte_range_lock containing num_locks == 0
    so it can be cached.
    
    Returning NULL when there are no locks causes POSIX lock
    tests to fail returning NT_STATUS_NO_MEMORY (as it thinks
    it can't allocate the struct) instead of NT_STATUS_OK.
    
    This is a back-port of git commit abf08ed544ce05ea5a6e6ea2e531b6a2d97e15cc
    that went into master.
    
    Fixes bug:
    
    Bug 10431 - STATUS_NO_MEMORY response from Query File Posix Lock request
    
    https://bugzilla.samba.org/show_bug.cgi?id=10431
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f4b804512b2fcc471030911547543f1432057721
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 24 16:18:31 2014 -0800

    s3-printing: Fix obvious memory leak in printer_list_get_printer().
    
    https://bugzilla.samba.org/show_bug.cgi?id=9993
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ira Cooper <ira at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Tue Feb 25 13:19:37 CET 2014 on sn-devel-104
    
    (cherry picked from commit 148bbdd8d04400b5d873f636671dd443952ca04f)

commit a8fb0028fcd59826dccb60604965e335c15f7317
Author: David Disseldorp <ddiss at samba.org>
Date:   Mon Mar 3 19:49:35 2014 +0100

    rpc_client: retry open on STATUS_PIPE_NOT_AVAILABLE
    
    Windows Server starts some named pipe services on demand, and responds
    to initial open requests with STATUS_PIPE_NOT_AVAILABLE. The FssagentRpc
    named pipe on Windows Server 2012 exhibits this behaviour.
    
    This change sees rpcclient retry named pipe open requests when the
    server responds with STATUS_PIPE_NOT_AVAILABLE. The retry logic is
    contained in an asynchronous tevent_timer callback, to allow for
    non-blocking callers.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ebe6627c1f0e6b488a0c456860a055fd5701e84d)
    [ddiss at samba.org: rebasead for 4.1 without 46d29d46bc065d51e3f7ca6892]
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10484
    Initial FSRVP rpcclient requests fail with NT_STATUS_PIPE_NOT_AVAILABLE

commit fd8d4699728a4db947bbce2ba4a52fcec39e780e
Author: Daniel Liberman <danielvl at gmail.com>
Date:   Tue Jan 21 16:25:41 2014 -0800

    s3: ldap client can return NT_STATUS_OK when an error occurs in a paged search.
    
    "Inside ads_do_search_all_args(), if the first call to ads_do_paged_search_args()
    fails, the proper error status is returned.
    
    But, if the execution is already inside the loop to get all the accounts doing
    several calls to ads_do_paged_search_args(), and one of these calls times out,
    the status returned is from the *first* call, so success. This causes
    net_ads_search() to interpret the return from ads_do_search_retry() as
    success and print all the accounts returned, but it’s only a subset."
    
    Also ensure we free previously returned results on error
    in subsequent fetches.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10387
    
    Signed-off-by: Daniel Liberman <danielvl at gmail.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jan 23 01:40:54 CET 2014 on sn-devel-104
    
    (cherry picked from commit b04e8b7557b82a4b96cf74db04742fb017edb3ba)

commit e1f7cbc49bb50f10655f5b23bf4580cad7f8ff07
Author: Christian Ambach <ambi at samba.org>
Date:   Wed Dec 4 22:50:11 2013 +0100

    waf: improve iconv checks
    
    there are broken iconv implementations around (e.g. on AIX) that you
    can compile against but that refuse any mapping requests
    
    make sure we do the same as the autoconf-based build did and
    fall back to our own code
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10308
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 15b2d1a658b3fc428c20a7a461168f464951f40f)
    (cherry picked from commit f5cbfd6ce5e5a0977e5c1a53046ee883b3431246)

commit f33c3ad5c6431f3f1134ffd62d493cc7cd66f612
Author: Christian Ambach <ambi at samba.org>
Date:   Wed Feb 19 22:17:01 2014 +0100

    heimdal_build: only enable libintl functions if everything was found
    
    do not rely on intl.h being available but also on the functions being usable
    This should fix the build on HP-UX
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    Signed-off-by: Christian Ambach <ambi at samba.org>
    
    Change-Id: I5dd88d2d5216b778624778455cca99b32d0be58f
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Feb 20 01:28:24 CET 2014 on sn-devel-104
    
    (cherry picked from commit 8f0d06fa5e654f647664727db6f12901579ec2c7)

commit 8b062f1b37af5f74da26ad1924ad8c74a0287575
Author: Christian Ambach <ambi at samba.org>
Date:   Wed Jan 29 20:48:38 2014 +0100

    waf:lib/replace fix iconv checks on HP/UX
    
    we need to copy away the list of LDFLAGS
    to be tried before modifying it instead of
    just creating a new reference and then continuing
    with a modified list while it should have been
    reset back to the original value
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Feb 13 02:01:03 CET 2014 on sn-devel-104
    
    (cherry picked from commit 6a7c420a79cc1258528f152f4de9a0608767729f)

commit 4aafa69ea3635c8c0e4822924f870949f37f6f49
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Jul 25 19:41:02 2013 +0200

    waf:lib/replace gettext configure checks
    
    Make sure we only try to work with gettext if we found
    the prototypes and were able to link
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Christian Ambach <ambi at samba.org>
    Autobuild-Date(master): Fri Jan 17 19:30:33 CET 2014 on sn-devel-104
    
    (cherry picked from commit da891e2101c568d2f0b9a2bda78702826ea68f3c)

commit e8ab9804c11d79ce0f9fa090d0c419744efaf249
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Dec 12 22:10:36 2013 +0100

    waf:lib/replace fix gettext detection
    
    if the user has specified a path for gettext, add it to CFLAGS and LDFLAGS
    so we can find it during configure and build
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 31db0c8acdd68f396417e1f6504a91a40295bc89)

commit 7346b57e0b35f5a2909e23796d375ee0c1031f70
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Dec 12 22:12:07 2013 +0100

    waf:lib/replace change detection of gettext
    
    convert this to an automatic check: if no option is given, try to find gettext
    and if found, use it
    if user has specified --with-gettext, then bail out if it could not be found
    in case of --without-gettext, skip all gettext related configure checks
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit a83f491810d34cc8b6eb4b0f40bbbb1440e0f84d)

commit f4e17716e11b847eadcf66ca8e2f926993dfd010
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Jan 2 22:23:16 2014 +0100

    waf:lib/replace fix up libintl related checks
    
    on a default installation of AIX, libintl.a exists but
    libintl.h does not
    So check for the declarations of those functions as well
    to make sure that the build works.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit df6ddcfbfcd33274c1b768ce26829b0ad9278cd0)

commit 0d2e0d496efe317d8354fa8f045416017322a776
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Jan 2 23:28:20 2014 +0100

    waf:lib/replace correct detection of libiconv
    
    add -liconv as a complete command line argument,
    not all characters on their own
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 1a42ff7d8db63b26e2beb43268a1c4664723358e)

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

Summary of changes:
 buildtools/wafsamba/wscript              |    3 +-
 lib/replace/wscript                      |   30 ++++++++++++---
 pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm |   14 +++++++
 source3/build/charset.py                 |    6 +++
 source3/libads/ldap.c                    |   11 ++++--
 source3/locking/brlock.c                 |   34 +++++++++++------
 source3/printing/printer_list.c          |    1 +
 source3/printing/spoolssd.c              |   39 +++++++++++---------
 source3/rpc_client/rpc_transport_np.c    |   57 ++++++++++++++++++++++++++----
 source3/winbindd/wb_lookupsids.c         |    2 +-
 source3/winbindd/winbindd_dual_srv.c     |    8 ++++-
 source4/heimdal_build/config.h           |    3 +-
 12 files changed, 157 insertions(+), 51 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index fe2e515..7984227 100755
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -80,8 +80,7 @@ def set_options(opt):
                    match = ['Checking for library iconv', 'Checking for iconv_open', 'Checking for header iconv.h'])
     opt.add_option('--with-gettext',
                    help='additional directory to search for gettext',
-                   action='store', dest='gettext_location', default='/usr/local',
-                   match = ['Checking for library intl', 'Checking for header libintl.h'])
+                   action='store', dest='gettext_location', default='None')
     opt.add_option('--without-gettext',
                    help=("Disable use of gettext"),
                    action="store_true", dest='disable_gettext', default=False)
diff --git a/lib/replace/wscript b/lib/replace/wscript
index e4d8b6b..61a25ec 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -346,10 +346,19 @@ removeea setea
                         headers='netinet/in.h arpa/nameser.h resolv.h')
 
 
+    # try to find libintl (if --without-gettext is not given)
     conf.env.intl_libs=''
     if not Options.options.disable_gettext:
+        # any extra path given to look at?
+        if not Options.options.gettext_location == 'None':
+           conf.env['CFLAGS'].extend(["-I%s" % Options.options.gettext_location]);
+           conf.env['LDFLAGS'].extend(["-L%s" % Options.options.gettext_location]);
+        else:
+           conf.env['CFLAGS'].extend(["-I/usr/local"]);
+           conf.env['LDFLAGS'].extend(["-L/usr/local"]);
         conf.CHECK_HEADERS('libintl.h')
         conf.CHECK_LIB('intl')
+        conf.CHECK_DECLS('dgettext gettext bindtextdomain textdomain bind_textdomain_codeset', headers="libintl.h")
         # *textdomain functions are not strictly necessary
         conf.CHECK_FUNCS_IN('bindtextdomain textdomain bind_textdomain_codeset',
                             '', checklibc=True, headers='libintl.h')
@@ -368,18 +377,27 @@ removeea setea
         else:
             # Some hosts need lib iconv for linking with lib intl
             # So we try with flags just in case it helps.
-            oldflags = conf.env['EXTRA_LDFLAGS'];
-            conf.env['EXTRA_LDFLAGS'].extend("-liconv")
+            oldflags = list(conf.env['EXTRA_LDFLAGS']);
+            conf.env['EXTRA_LDFLAGS'].extend(["-liconv"])
             conf.CHECK_FUNCS_IN('dgettext gettext bindtextdomain textdomain bind_textdomain_codeset',
                                 'intl', checklibc=False, headers='libintl.h')
             conf.env['EXTRA_LDFLAGS'] = oldflags
             if conf.env['HAVE_GETTEXT'] and conf.env['HAVE_DGETTEXT']:
                 # save for dependency definitions
                 conf.env.intl_libs='iconv intl'
-            else:
-                conf.fatal('library gettext not found, try specifying the path to ' +
-                           'it with --with-gettext=</path/to/gettext> or ' +
-                           '--without-gettext to build without''')
+
+    # did we find both prototypes and a library to link against?
+    # if not, unset the detected values (see Bug #9911)
+    if not (conf.env['HAVE_GETTEXT'] and conf.env['HAVE_DECL_GETTEXT']):
+       conf.undefine('HAVE_GETTEXT')
+       conf.undefine('HAVE_DECL_GETTEXT')
+    if not (conf.env['HAVE_DGETTEXT'] and conf.env['HAVE_DECL_DGETTEXT']):
+       conf.undefine('HAVE_DGETTEXT')
+       conf.undefine('HAVE_DECL_DGETTEXT')
+
+    # did the user insist on gettext (--with-gettext)?
+    if Options.options.gettext_location != 'None' and (not conf.env['HAVE_GETTEXT'] or not conf.env['HAVE_DGETTEXT']):
+        conf.fatal('library gettext not found at specified location')
 
     conf.CHECK_FUNCS_IN('pthread_create', 'pthread', checklibc=True, headers='pthread.h')
 
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
index c796b46..fed94cd 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm
@@ -693,6 +693,20 @@ sub ParseFunction_Sync($$$$)
 	}
 	$self->pidl("");
 
+	$self->pidl("/* Out parameters */");
+	foreach my $e (@{$fn->{ELEMENTS}}) {
+		next unless grep(/out/, @{$e->{DIRECTION}});
+
+		$self->ParseCopyArgument($fn, $e, "r.out.", "_");
+	}
+	$self->pidl("");
+
+	if (defined($fn->{RETURN_TYPE})) {
+		$self->pidl("/* Result */");
+		$self->pidl("ZERO_STRUCT(r.out.result);");
+		$self->pidl("");
+	}
+
 	$self->pidl("status = dcerpc_$name\_r(h, mem_ctx, &r);");
 	$self->pidl("if (!NT_STATUS_IS_OK(status)) {");
 	$self->indent;
diff --git a/source3/build/charset.py b/source3/build/charset.py
index 44852a6..0033557 100644
--- a/source3/build/charset.py
+++ b/source3/build/charset.py
@@ -33,6 +33,12 @@ def CHECK_SAMBA3_CHARSET(conf, crossbuild=False):
 	    default_unix_charset="UTF-8"
             # TODO: this used to warn about the set charset on cross builds
 
+        if default_dos_charset is False or default_unix_charset is False:
+        # we found iconv, but it failed to convert anything (e.g. on AIX)
+            conf.undefine('HAVE_NATIVE_ICONV');
+            default_dos_charset = "ASCII"
+            default_unix_charset = "UTF-8"
+
         conf.DEFINE('DEFAULT_DOS_CHARSET', default_dos_charset, quote=True)
         conf.DEFINE('DEFAULT_UNIX_CHARSET', default_unix_charset, quote=True)
 
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 2a4a83b..20c2e31 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1125,13 +1125,16 @@ static ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path,
 #ifdef HAVE_LDAP_ADD_RESULT_ENTRY
 	while (cookie) {
 		LDAPMessage *res2 = NULL;
-		ADS_STATUS status2;
 		LDAPMessage *msg, *next;
 
-		status2 = ads_do_paged_search_args(ads, bind_path, scope, expr, 
+		status = ads_do_paged_search_args(ads, bind_path, scope, expr,
 					      attrs, args, &res2, &count, &cookie);
-
-		if (!ADS_ERR_OK(status2)) break;
+		if (!ADS_ERR_OK(status)) {
+			/* Ensure we free all collected results */
+			ads_msgfree(ads, *res);
+			*res = NULL;
+			break;
+		}
 
 		/* this relies on the way that ldap_add_result_entry() works internally. I hope
 		   that this works on all ldap libs, but I have only tested with openldap */
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 0654209..43abb98 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1862,12 +1862,14 @@ static void byte_range_lock_flush(struct byte_range_lock *br_lck)
 	}
 
 	if (br_lck->num_locks == 0) {
-		/* No locks - delete this entry. */
-		NTSTATUS status = dbwrap_record_delete(br_lck->record);
-		if (!NT_STATUS_IS_OK(status)) {
-			DEBUG(0, ("delete_rec returned %s\n",
-				  nt_errstr(status)));
-			smb_panic("Could not delete byte range lock entry");
+		if (br_lck->record) {
+			/* No locks and the record existed - delete this entry. */
+			NTSTATUS status = dbwrap_record_delete(br_lck->record);
+			if (!NT_STATUS_IS_OK(status)) {
+				DEBUG(0, ("delete_rec returned %s\n",
+					  nt_errstr(status)));
+				smb_panic("Could not delete byte range lock entry");
+			}
 		}
 	} else {
 		TDB_DATA data;
@@ -1932,7 +1934,12 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
 	if (do_read_only) {
 		NTSTATUS status;
 		status = dbwrap_fetch(brlock_db, br_lck, key, &data);
-		if (!NT_STATUS_IS_OK(status)) {
+		if (NT_STATUS_EQUAL(status,NT_STATUS_NOT_FOUND)) {
+			/*
+			 * No locks on this file. data should be empty.
+			 */
+			ZERO_STRUCT(data);
+		} else if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(3, ("Could not fetch byte range lock record\n"));
 			TALLOC_FREE(br_lck);
 			return NULL;
@@ -1942,12 +1949,15 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
 		br_lck->record = dbwrap_fetch_locked(brlock_db, br_lck, key);
 
 		if (br_lck->record == NULL) {
-			DEBUG(3, ("Could not lock byte range lock entry\n"));
-			TALLOC_FREE(br_lck);
-			return NULL;
+			/*
+			 * We're going to assume this means no locks on
+			 * the file, not a talloc fail. If it was a talloc
+			 * fail we'll just have to die elsewhere.
+			 */
+			ZERO_STRUCT(data);
+		} else {
+			data = dbwrap_record_get_value(br_lck->record);
 		}
-
-		data = dbwrap_record_get_value(br_lck->record);
 	}
 
 	br_lck->read_only = do_read_only;
diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c
index 0afb84b..0fc9473 100644
--- a/source3/printing/printer_list.c
+++ b/source3/printing/printer_list.c
@@ -133,6 +133,7 @@ NTSTATUS printer_list_get_printer(TALLOC_CTX *mem_ctx,
 done:
 	SAFE_FREE(nstr);
 	SAFE_FREE(cstr);
+	SAFE_FREE(lstr);
 	TALLOC_FREE(key);
 	return status;
 }
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c
index bb043bd..55aa9c7 100644
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -31,6 +31,7 @@
 #include "librpc/gen_ndr/srv_spoolss.h"
 #include "rpc_server/rpc_server.h"
 #include "rpc_server/rpc_ep_register.h"
+#include "rpc_server/rpc_config.h"
 #include "rpc_server/spoolss/srv_spoolss_nt.h"
 #include "librpc/rpc/dcerpc_ep.h"
 #include "lib/server_prefork.h"
@@ -627,6 +628,7 @@ static char *get_bq_logfile(void)
 pid_t start_spoolssd(struct tevent_context *ev_ctx,
 		    struct messaging_context *msg_ctx)
 {
+	enum rpc_service_mode_e epm_mode = rpc_epmapper_mode();
 	struct rpc_srv_callbacks spoolss_cb;
 	struct dcerpc_binding_vector *v;
 	TALLOC_CTX *mem_ctx;
@@ -772,25 +774,28 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
 		exit(1);
 	}
 
-	status = dcerpc_binding_vector_new(mem_ctx, &v);
-	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(0, ("Failed to create binding vector (%s)\n",
-			  nt_errstr(status)));
-		exit(1);
-	}
+	if (epm_mode != RPC_SERVICE_MODE_DISABLED &&
+	    (lp_parm_bool(-1, "rpc_server", "register_embedded_np", false))) {
+		status = dcerpc_binding_vector_new(mem_ctx, &v);
+		if (!NT_STATUS_IS_OK(status)) {
+			DEBUG(0, ("Failed to create binding vector (%s)\n",
+				  nt_errstr(status)));
+			exit(1);
+		}
 
-	status = dcerpc_binding_vector_add_np_default(&ndr_table_spoolss, v);
-	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(0, ("Failed to add np to binding vector (%s)\n",
-			  nt_errstr(status)));
-		exit(1);
-	}
+		status = dcerpc_binding_vector_add_np_default(&ndr_table_spoolss, v);
+		if (!NT_STATUS_IS_OK(status)) {
+			DEBUG(0, ("Failed to add np to binding vector (%s)\n",
+				  nt_errstr(status)));
+			exit(1);
+		}
 
-	status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v);
-	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(0, ("Failed to register spoolss endpoint! (%s)\n",
-			  nt_errstr(status)));
-		exit(1);
+		status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_spoolss, v);
+		if (!NT_STATUS_IS_OK(status)) {
+			DEBUG(0, ("Failed to register spoolss endpoint! (%s)\n",
+				  nt_errstr(status)));
+			exit(1);
+		}
 	}
 
 	talloc_free(mem_ctx);
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
index 0be07eb..1fd5ca9 100644
--- a/source3/rpc_client/rpc_transport_np.c
+++ b/source3/rpc_client/rpc_transport_np.c
@@ -21,12 +21,18 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "rpc_client/rpc_transport.h"
 #include "libsmb/cli_np_tstream.h"
+#include "client.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_CLI
 
 struct rpc_transport_np_init_state {
 	struct rpc_cli_transport *transport;
+	int retries;
+	struct tevent_context *ev;
+	struct cli_state *cli;
+	struct timeval abs_timeout;
+	const char *pipe_name;
 };
 
 static void rpc_transport_np_init_pipe_open(struct tevent_req *subreq);
@@ -38,7 +44,6 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
 {
 	struct tevent_req *req;
 	struct rpc_transport_np_init_state *state;
-	const char *pipe_name;
 	struct tevent_req *subreq;
 
 	req = tevent_req_create(mem_ctx, &state,
@@ -47,16 +52,19 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	pipe_name = get_pipe_name_from_syntax(state, abstract_syntax);
-	if (tevent_req_nomem(pipe_name, req)) {
+	state->ev = ev;
+	state->cli = cli;
+	state->abs_timeout = timeval_current_ofs_msec(cli->timeout);
+	state->pipe_name = get_pipe_name_from_syntax(state, abstract_syntax);
+	if (tevent_req_nomem(state->pipe_name, req)) {
 		return tevent_req_post(req, ev);
 	}
 
-	while (pipe_name[0] == '\\') {
-		pipe_name++;
+	while (state->pipe_name[0] == '\\') {
+		state->pipe_name++;
 	}
 
-	subreq = tstream_cli_np_open_send(state, ev, cli, pipe_name);
+	subreq = tstream_cli_np_open_send(state, ev, cli, state->pipe_name);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
@@ -65,6 +73,25 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
 	return req;
 }
 
+static void rpc_transport_np_init_pipe_open_retry(struct tevent_context *ev,
+						  struct tevent_timer *te,
+						  struct timeval t,
+						  void *priv_data)
+{
+	struct tevent_req *subreq;
+	struct tevent_req *req = talloc_get_type(priv_data, struct tevent_req);
+	struct rpc_transport_np_init_state *state = tevent_req_data(
+		req, struct rpc_transport_np_init_state);
+
+	subreq = tstream_cli_np_open_send(state, ev, state->cli,
+					  state->pipe_name);
+	if (tevent_req_nomem(subreq, req)) {
+		return;
+	}
+	tevent_req_set_callback(subreq, rpc_transport_np_init_pipe_open, req);
+	state->retries++;
+}
+
 static void rpc_transport_np_init_pipe_open(struct tevent_req *subreq)
 {
 	struct tevent_req *req = tevent_req_callback_data(
@@ -76,7 +103,23 @@ static void rpc_transport_np_init_pipe_open(struct tevent_req *subreq)
 
 	status = tstream_cli_np_open_recv(subreq, state, &stream);
 	TALLOC_FREE(subreq);
-	if (!NT_STATUS_IS_OK(status)) {
+	if (NT_STATUS_EQUAL(status, NT_STATUS_PIPE_NOT_AVAILABLE)
+				&& (!timeval_expired(&state->abs_timeout))) {
+		struct tevent_timer *te;
+		/*
+		 * Retry on STATUS_PIPE_NOT_AVAILABLE, Windows starts some
+		 * servers (FssagentRpc) on demand.
+		 */
+		DEBUG(2, ("RPC pipe %s not available, retry %d\n",
+			  state->pipe_name, state->retries));
+		te = tevent_add_timer(state->ev, state,
+				 timeval_current_ofs_msec(100 * state->retries),
+				 rpc_transport_np_init_pipe_open_retry, req);
+		if (tevent_req_nomem(te, req)) {
+			return;
+		}
+		return;
+	} else if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
 		return;
 	}
diff --git a/source3/winbindd/wb_lookupsids.c b/source3/winbindd/wb_lookupsids.c
index e10d511..b474220 100644
--- a/source3/winbindd/wb_lookupsids.c
+++ b/source3/winbindd/wb_lookupsids.c
@@ -320,7 +320,7 @@ static struct wb_lookupsids_domain *wb_lookupsids_get_domain(
 		}
 	}
 
-	wb_domain = find_domain_from_sid_noinit(sid);
+	wb_domain = find_lookup_domain_from_sid(sid);
 	if (wb_domain == NULL) {
 		return NULL;
 	}
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index 5344063..4227d6a 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -74,6 +74,7 @@ NTSTATUS _wbint_LookupSid(struct pipes_struct *p, struct wbint_LookupSid *r)
 NTSTATUS _wbint_LookupSids(struct pipes_struct *p, struct wbint_LookupSids *r)
 {
 	struct winbindd_domain *domain = wb_child_domain();
+	struct lsa_RefDomainList *domains = r->out.domains;
 	NTSTATUS status;
 
 	if (domain == NULL) {
@@ -87,7 +88,12 @@ NTSTATUS _wbint_LookupSids(struct pipes_struct *p, struct wbint_LookupSids *r)
 	 * done at the wbint RPC layer.
 	 */
 	status = rpc_lookup_sids(p->mem_ctx, domain, r->in.sids,
-				 &r->out.domains, &r->out.names);
+				 &domains, &r->out.names);
+
+	if (domains != NULL) {
+		r->out.domains = domains;
+	}
+
 	reset_cm_connection_on_error(domain, status);
 	return status;
 }
diff --git a/source4/heimdal_build/config.h b/source4/heimdal_build/config.h
index bd5a1b8..2d113ae 100644
--- a/source4/heimdal_build/config.h
+++ b/source4/heimdal_build/config.h
@@ -41,7 +41,8 @@
 #endif
 
 /*Workaround for heimdal define vs samba define*/
-#ifdef HAVE_LIBINTL_H
+#if defined(HAVE_LIBINTL_H) && defined(HAVE_BINDTEXTDOMAIN) &&\
+    defined(HAVE_TEXTDOMAIN)
 #define LIBINTL
 #endif
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list