[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon May 25 01:17:03 UTC 2020


The branch, master has been updated
       via  7ae03a19b3c build: add configure option to control vfs_snapper build
       via  e05e9df7815 build: quota wscript error message spelling fix
       via  6edcf6801dc s3: rpc_server: Avoid casts calling to find_policy_by_hnd()
       via  10cea64e4c9 s3: rpc_server: Remove dead code
       via  70fa7e817e4 s3: rpc_server: Drop s3 rpc handles implementation
       via  f98b3b6f10e pidl: Set dce_call in pipes_struct before dispatching call
       via  be024932efe s3: rpc_server: Remove SAMR specific policy_handle_find() function
       via  7273b4bcc7b s3: rpc_server: Move SAMR handle based access check to a wrapper function
       via  2bde40762a9 s3: rpc_server: Remove SAMR specific policy_handle_create() function
       via  da9749acb33 s3: rpc_server: pass DCE/RPC handle type to find_policy_handle
       via  711ca4fab59 s3: rpc_server: Strip out access check field from s3 handles implementation
       via  72f73efd7f3 librpc: core: Move the s4 handles implementation to the RPC server core
       via  ebdacf187da selftest: Add test for handle types
       via  a4041ee6ca9 ldb: also use portable __has_attribute macro to check for attribute support
       via  2f75b35e1b8 talloc: also use portable __has_attribute macro to check for attribute support
       via  22870830159 tdb: also use __has_attribute macro to check for attribute support
       via  f133019db60 replace, attr.: use function attributes only if supported by feature macro (or old gcc)
       via  10b195fe124 gitlab-ci: Create a single samba-fips runner
      from  1e55591bc54 ctdb-tests: Add a new fetch ring test that also checks hot keys

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


- Log -----------------------------------------------------------------
commit 7ae03a19b3ca895ba5f97a6bd4f9539d8daa6e0a
Author: Matt Taylor <liverbugg at rinux.org>
Date:   Mon May 11 15:26:41 2020 -0400

    build: add configure option to control vfs_snapper build
    
    vfs_snapper is currently built if dbus development headers / libraries
    are detected during configure. This commit adds new --disable-snapper
    and --enable-snapper (default) configure parameters. When enabled,
    configure will fail if the dbus development headers / libraries are
    missing.
    
    Signed-off-by: Matt Taylor <liverbugg at rinux.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Mon May 25 01:16:46 UTC 2020 on sn-devel-184

commit e05e9df7815164266fb8e1295cf2226f11032dc5
Author: Matt Taylor <liverbugg at rinux.org>
Date:   Tue May 12 15:07:14 2020 +0200

    build: quota wscript error message spelling fix
    
    Signed-off-by: Matt Taylor <liverbugg at rinux.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6edcf6801dc2d5ffd10d077c8750910c0831c6bb
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 18 12:04:33 2020 +0200

    s3: rpc_server: Avoid casts calling to find_policy_by_hnd()
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 10cea64e4c9c1dec67278ca1b40f40ae90e58c34
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Mon Nov 4 19:01:28 2019 +0100

    s3: rpc_server: Remove dead code
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 70fa7e817e48c9faa3c6c7ae3749e4a8ebf3e6c2
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Mon Nov 4 18:38:14 2019 +0100

    s3: rpc_server: Drop s3 rpc handles implementation
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f98b3b6f10e046ca5a9a7637159abf1b9dd40bda
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Tue Oct 29 12:36:30 2019 +0100

    pidl: Set dce_call in pipes_struct before dispatching call
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit be024932efe70d45ad511171d40ad355c583a9c2
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Thu May 7 14:24:56 2020 +0200

    s3: rpc_server: Remove SAMR specific policy_handle_find() function
    
    The generic function already checks the handle type.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7273b4bcc7baad239bc3aa09920f87de4f974b24
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Thu May 14 18:35:28 2020 +0200

    s3: rpc_server: Move SAMR handle based access check to a wrapper function
    
    Now that the type associated to the handle is the same for all handle
    types we can wrap the access check.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2bde40762a9d6b6698de281db3303cb45a304398
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Thu May 7 13:29:29 2020 +0200

    s3: rpc_server: Remove SAMR specific policy_handle_create() function
    
    Now that we pass the handle type to the generic handle creation and find
    functions we can drop the specific SAMR ones.
    
    The policy_handle_create() function labeled the talloc chunk used to
    allocate the handle's associated data, and the policy_handle_find() is
    checking the name matches with the expected data. The check is performed
    now by the generic functions based on the handle type so we can drop
    these SAMR specific functions.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit da9749acb33d06a983b4c5117a74f0d53e0c0e88
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Wed May 6 13:56:46 2020 +0200

    s3: rpc_server: pass DCE/RPC handle type to find_policy_handle
    
    Following changes in commit c7a4578d06427a82ead287f0c5248c1a54cc9336
    pass the handle type to the handle search functions. The handle type will
    be verified unless passing DCESRV_HANDLE_ANY to find functions.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 711ca4fab59b97cb26006ce845a211bbe5c479f6
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Tue Oct 29 12:39:10 2019 +0100

    s3: rpc_server: Strip out access check field from s3 handles implementation
    
    The handle based security model is a SAMR specific feature. The access
    granted is stored in the handle's associated data after creating it and
    the access is verified after searching the handle.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 72f73efd7f3647d7aed2c36e6285d70c40d21114
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Tue Oct 29 11:04:43 2019 +0100

    librpc: core: Move the s4 handles implementation to the RPC server core
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ebdacf187da7d10bff9fca14b3161386d933ea3e
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Fri May 8 12:40:55 2020 +0200

    selftest: Add test for handle types
    
    The test is written for SAMR, but as the handle type is verified by the
    server core library it also applies to other RPC services.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a4041ee6ca942a0117e5454888af5987f19671e6
Author: Björn Jacke <bj at sernet.de>
Date:   Sun May 24 14:04:37 2020 +0200

    ldb: also use portable __has_attribute macro to check for attribute support
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2f75b35e1b86a6eb094c7193e3dae76778197696
Author: Björn Jacke <bj at sernet.de>
Date:   Sun May 24 13:56:22 2020 +0200

    talloc: also use portable __has_attribute macro to check for attribute support
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 22870830159a753a70e197f7abe671a1d642f00e
Author: Björn Jacke <bj at sernet.de>
Date:   Sun May 24 13:55:02 2020 +0200

    tdb: also use __has_attribute macro to check for attribute support
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f133019db60afb0fea997dd6350a9376a91806d3
Author: Björn Jacke <bj at sernet.de>
Date:   Sun May 24 13:57:46 2020 +0200

    replace, attr.: use function attributes only if supported by feature macro (or old gcc)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12296
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 10b195fe12458e31faa8d3140a681edde932e6fe
Author: Andreas Schneider <asn at samba.org>
Date:   Tue May 19 07:21:25 2020 +0200

    gitlab-ci: Create a single samba-fips runner
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 .gitlab-ci.yml                                     |   8 +-
 lib/ldb/include/ldb.h                              |   2 +-
 lib/replace/replace.h                              |   7 +-
 lib/talloc/talloc.h                                |   7 +-
 lib/tdb/include/tdb.h                              |   2 +-
 lib/util/attr.h                                    |  22 +-
 .../handles.c => librpc/rpc/dcesrv_handles.c       |  10 +-
 librpc/wscript_build                               |   1 +
 pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm     |  48 +-
 script/autobuild.py                                |  20 +-
 source3/rpc_server/epmapper/srv_epmapper.c         |  34 +-
 source3/rpc_server/eventlog/srv_eventlog_nt.c      |   8 +-
 source3/rpc_server/lsa/srv_lsa_nt.c                | 391 ++++++-----
 source3/rpc_server/mdssvc/srv_mdssvc_nt.c          |  26 +-
 source3/rpc_server/rpc_contexts.c                  |  43 --
 source3/rpc_server/rpc_contexts.h                  |  28 -
 source3/rpc_server/rpc_handles.c                   | 403 ++---------
 source3/rpc_server/rpc_ncacn_np.c                  |  23 -
 source3/rpc_server/rpc_pipes.h                     |  70 +-
 source3/rpc_server/rpc_server.c                    |   2 +-
 source3/rpc_server/samr/srv_samr_nt.c              | 777 +++++++++++++--------
 source3/rpc_server/spoolss/srv_iremotewinspool.c   |  34 +-
 source3/rpc_server/spoolss/srv_spoolss_nt.c        |  11 +-
 source3/rpc_server/svcctl/srv_svcctl_nt.c          |   8 +-
 source3/rpc_server/winreg/srv_winreg_nt.c          |  84 ++-
 source3/rpc_server/wscript_build                   |   2 +-
 source3/selftest/tests.py                          |   2 +-
 source3/wscript                                    |  14 +-
 source4/rpc_server/wscript_build                   |   2 +-
 source4/torture/rpc/rpc.c                          |   1 +
 source4/torture/rpc/samr_handletype.c              | 217 ++++++
 source4/torture/wscript_build                      |   1 +
 32 files changed, 1197 insertions(+), 1111 deletions(-)
 rename source4/rpc_server/handles.c => librpc/rpc/dcesrv_handles.c (99%)
 delete mode 100644 source3/rpc_server/rpc_contexts.c
 delete mode 100644 source3/rpc_server/rpc_contexts.h
 create mode 100644 source4/torture/rpc/samr_handletype.c


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 489ac476784..7177d3b5c44 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -181,11 +181,7 @@ samba-admem-mit:
 samba-ad-dc-4-mitkrb5:
   extends: .shared_template
 
-samba-ad-dc-fips:
-  extends: .shared_template
-  image: $SAMBA_CI_CONTAINER_IMAGE_fedora31
-
-samba-admem-fips:
+samba-fips:
   extends: .shared_template
   image: $SAMBA_CI_CONTAINER_IMAGE_fedora31
 
@@ -253,7 +249,7 @@ pages:
     - samba-nt4
     - samba-schemaupgrade
     - samba-ad-dc-1-mitkrb5
-    - samba-ad-dc-fips
+    - samba-fips
   script:
     - ./configure.developer
     - make -j
diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h
index 3cba0f4d543..7f53e6420e1 100644
--- a/lib/ldb/include/ldb.h
+++ b/lib/ldb/include/ldb.h
@@ -89,7 +89,7 @@ struct ldb_val {
 #endif
 
 #ifndef _DEPRECATED_
-#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
+#if __has_attribute(deprecated) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 59f0b60f8a0..6c78311f2d3 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -447,8 +447,13 @@ int rep_dlclose(void *handle);
 /* prototype is in system/network.h */
 #endif
 
+/* for old gcc releases that don't have the feature test macro __has_attribute */
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
 #ifndef PRINTF_ATTRIBUTE
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(format) || (__GNUC__ >= 3)
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index b991dd3c4f5..0154bf3bbf6 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -89,8 +89,13 @@ typedef void TALLOC_CTX;
 #define TALLOC_DEPRECATED 0
 #endif
 
+/* for old gcc releases that don't have the feature test macro __has_attribute */
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
 #ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
+#if __has_attribute(format) || (__GNUC__ >= 3)
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 825ceedd9b4..9d63a96b4ac 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -102,7 +102,7 @@ typedef struct TDB_DATA {
 } TDB_DATA;
 
 #ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
+#if __has_attribute(format) || (__GNUC__ >= 3)
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
diff --git a/lib/util/attr.h b/lib/util/attr.h
index 8e542c14da3..af3e2442b3a 100644
--- a/lib/util/attr.h
+++ b/lib/util/attr.h
@@ -20,14 +20,18 @@
 #ifndef __UTIL_ATTR_H__
 #define __UTIL_ATTR_H__
 
+/* for old gcc releases that don't have the feature test macro __has_attribute */
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
 #ifndef _UNUSED_
-#ifdef __GNUC__
+#if __has_attribute(unused) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 /** gcc attribute used on function parameters so that it does not emit
  * warnings about them being unused. **/
 #  define _UNUSED_ __attribute__ ((unused))
 #else
 #  define _UNUSED_
-/** Feel free to add definitions for other compilers here. */
 #endif
 #endif
 #ifndef UNUSED
@@ -35,7 +39,7 @@
 #endif
 
 #ifndef _DEPRECATED_
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(deprecated) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define _DEPRECATED_ __attribute__ ((deprecated))
 #else
 #define _DEPRECATED_
@@ -43,7 +47,7 @@
 #endif
 
 #ifndef _WARN_UNUSED_RESULT_
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(warn_unused_result) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define _WARN_UNUSED_RESULT_ __attribute__ ((warn_unused_result))
 #else
 #define _WARN_UNUSED_RESULT_
@@ -51,7 +55,7 @@
 #endif
 
 #ifndef _NORETURN_
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(noreturn) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define _NORETURN_ __attribute__ ((noreturn))
 #else
 #define _NORETURN_
@@ -59,7 +63,7 @@
 #endif
 
 #ifndef _PURE_
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(pure) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define _PURE_ __attribute__((pure))
 #else
 #define _PURE_
@@ -67,7 +71,7 @@
 #endif
 
 #ifndef NONNULL
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(nonnull) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 #define NONNULL(param) param __attribute__((nonnull))
 #else
 #define NONNULL(param) param
@@ -75,7 +79,7 @@
 #endif
 
 #ifndef PRINTF_ATTRIBUTE
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(format) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 /** Use gcc attribute to check printf fns.  a1 is the 1-based index of
  * the parameter containing the format, and a2 the index of the first
  * argument. Note that some gcc 2.x versions don't handle this
@@ -87,7 +91,7 @@
 #endif
 
 #ifndef FORMAT_ATTRIBUTE
-#ifdef HAVE___ATTRIBUTE__
+#if __has_attribute(format) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
 /** Use gcc attribute to check printf fns.  a1 is argument to format()
  * in the above macro.  This is needed to support Heimdal's printf
  * decorations. Note that some gcc 2.x versions don't handle this
diff --git a/source4/rpc_server/handles.c b/librpc/rpc/dcesrv_handles.c
similarity index 99%
rename from source4/rpc_server/handles.c
rename to librpc/rpc/dcesrv_handles.c
index f0947efc95b..589a1ebb208 100644
--- a/source4/rpc_server/handles.c
+++ b/librpc/rpc/dcesrv_handles.c
@@ -1,20 +1,20 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    server side dcerpc handle code
 
    Copyright (C) Andrew Tridgell 2003
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -70,7 +70,7 @@ struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
 	h->iface = context->iface;
 	h->wire_handle.handle_type = handle_type;
 	h->wire_handle.uuid = GUID_random();
-	
+
 	DLIST_ADD(context->conn->assoc_group->handles, h);
 
 	talloc_set_destructor(h, dcesrv_handle_destructor);
diff --git a/librpc/wscript_build b/librpc/wscript_build
index 928c96dbae4..aa112890a7a 100644
--- a/librpc/wscript_build
+++ b/librpc/wscript_build
@@ -661,6 +661,7 @@ bld.SAMBA_LIBRARY('dcerpc-server-core',
            rpc/dcesrv_auth.c
            rpc/dcesrv_mgmt.c
            rpc/dcesrv_reply.c
+           rpc/dcesrv_handles.c
            ''',
     deps='ndr dcerpc-binding samba-util-core gnutls GNUTLS_HELPERS',
     pc_files=[],
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
index 2c750728892..54feea0a9ef 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/ServerCompat.pm
@@ -227,56 +227,10 @@ sub boilerplate_iface($)
 	$self->pidl("{");
 	$self->indent();
 	$self->pidl("struct pipes_struct *p = NULL;");
-	$self->pidl("struct pipe_rpc_fns *context_fns = NULL;");
-	$self->pidl("bool ok = false;");
 	$self->pidl("");
 	$self->pidl("/* Retrieve pipes struct */");
 	$self->pidl("p = dcesrv_get_pipes_struct(context->conn);");
-	$self->pidl("/* Init pipe handles */");
-	$self->pidl("ok = init_pipe_handles(p, &iface->syntax_id);");
-	$self->pidl("if (!ok) {");
-	$self->indent();
-	$self->pidl("DBG_ERR(\"Failed to init pipe handles\\n\");");
-	$self->pidl("return NT_STATUS_UNSUCCESSFUL;");
-	$self->deindent();
-	$self->pidl("}");
-	$self->pidl("");
-
-	$self->pidl("/* TODO check loop */");
-
-	$self->pidl("/* Init pipe context */");
 	$self->pidl("p->pipe_bound = true;");
-	$self->pidl("for (context_fns = p->contexts; context_fns != NULL; context_fns = context_fns->next) {");
-	$self->indent();
-	$self->pidl("if (context_fns->context_id != context->context_id) {");
-	$self->indent();
-	$self->pidl("continue;");
-	$self->deindent();
-	$self->pidl("}");
-	$self->pidl("ok = ndr_syntax_id_equal(&context_fns->syntax, &iface->syntax_id);");
-	$self->pidl("if (ok) {");
-	$self->indent();
-	$self->pidl("break;");
-	$self->deindent();
-	$self->pidl("}");
-	$self->pidl("return NT_STATUS_UNSUCCESSFUL;");
-	$self->deindent();
-	$self->pidl("}");
-	$self->pidl("if (context_fns == NULL) {");
-	$self->indent();
-	$self->pidl("context_fns = talloc_zero(p, struct pipe_rpc_fns);");
-	$self->pidl("if (context_fns == NULL) {");
-	$self->indent();
-	$self->pidl("return NT_STATUS_NO_MEMORY;");
-	$self->deindent();
-	$self->pidl("}");
-	$self->pidl("");
-	$self->pidl("context_fns->next = context_fns->prev = NULL;");
-	$self->pidl("context_fns->context_id = context->context_id;");
-	$self->pidl("context_fns->syntax = iface->syntax_id;");
-	$self->pidl("DLIST_ADD( p->contexts, context_fns);");
-	$self->deindent();
-	$self->pidl("}");
 	$self->pidlnoindent("#ifdef DCESRV_INTERFACE_$uname\_BIND");
 	$self->pidl("return DCESRV_INTERFACE_$uname\_BIND(context,iface);");
 	$self->pidlnoindent("#else");
@@ -344,6 +298,7 @@ sub boilerplate_iface($)
 	$self->pidl("p = dcesrv_get_pipes_struct(dce_call->conn);");
 	$self->pidl("/* Update pipes struct opnum */");
 	$self->pidl("p->opnum = opnum;");
+	$self->pidl("p->dce_call = dce_call;");
 	$self->pidl("/* Update pipes struct session info */");
 	$self->pidl("pipe_session_info = p->session_info;");
 	$self->pidl("p->session_info = dce_call->auth_state->session_info;");
@@ -388,6 +343,7 @@ sub boilerplate_iface($)
 	$self->pidl("}");
 	$self->pidl("");
 
+	$self->pidl("p->dce_call = NULL;");
 	$self->pidl("/* Restore session info */");
 	$self->pidl("p->session_info = pipe_session_info;");
 	$self->pidl("p->auth.auth_type = 0;");
diff --git a/script/autobuild.py b/script/autobuild.py
index 840ed4e9648..1d63111f992 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -458,11 +458,11 @@ tasks = {
         ],
 
     # Test fips compliance
-    "samba-ad-dc-fips": [
-        ("random-sleep", random_sleep(1, 1)),
+    "samba-fips": [
+        ("random-sleep", random_sleep(100, 500)),
         ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --with-system-mitkrb5 --with-experimental-mit-ad-dc" + samba_configure_params),
         ("make", "make -j"),
-        ("test", make_test(include_envs=["ad_dc_fips"])),
+        ("test", make_test(include_envs=["ad_dc_fips", "ad_member_fips"])),
         ("lcov", LCOV_CMD),
         ("check-clean-tree", "script/clean-source-tree.sh"),
         ],
@@ -499,17 +499,6 @@ tasks = {
         ("check-clean-tree", "script/clean-source-tree.sh"),
         ],
 
-    "samba-admem-fips": [
-        ("random-sleep", random_sleep(1, 1)),
-        ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --with-system-mitkrb5 --with-experimental-mit-ad-dc" + samba_configure_params),
-        ("make", "make -j"),
-        ("test", make_test(include_envs=[
-            "ad_member_fips",
-            ])),
-        ("lcov", LCOV_CMD),
-        ("check-clean-tree", "script/clean-source-tree.sh"),
-        ],
-
     "samba-ad-dc-1-mitkrb5": [
         ("random-sleep", random_sleep(1, 1)),
         ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --with-system-mitkrb5 --with-experimental-mit-ad-dc" + samba_configure_params),
@@ -838,8 +827,7 @@ defaulttasks.remove("pass")
 defaulttasks.remove("fail")
 defaulttasks.remove("samba-test-only")
 defaulttasks.remove("samba-fuzz")
-defaulttasks.remove("samba-ad-dc-fips")
-defaulttasks.remove("samba-admem-fips")
+defaulttasks.remove("samba-fips")
 if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1":
     defaulttasks.remove("samba-o3")
 
diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c
index a95803c62a2..973014d6827 100644
--- a/source3/rpc_server/epmapper/srv_epmapper.c
+++ b/source3/rpc_server/epmapper/srv_epmapper.c
@@ -619,6 +619,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
 	uint32_t i;
 	bool match = false;
 	bool ok;
+	NTSTATUS status;
 
 	*r->out.num_ents = 0;
 	r->out.entries = NULL;
@@ -713,8 +714,12 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
 			goto done;
 		}
 
-		ok = find_policy_by_hnd(p, r->out.entry_handle, (void **)(void*) &eps);
-		if (!ok) {
+		eps = find_policy_by_hnd(p,
+					 r->out.entry_handle,
+					 HTYPE_LOOKUP,
+					 struct rpc_eps,
+					 &status);
+		if (!NT_STATUS_IS_OK(status)) {
 			rc = EPMAPPER_STATUS_NO_MEMORY;
 			goto done;
 		}
@@ -722,8 +727,12 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
 	} else {
 		DEBUG(7, ("_epm_Lookup: Trying to find entry_handle.\n"));
 
-		ok = find_policy_by_hnd(p, r->in.entry_handle, (void **)(void*) &eps);
-		if (!ok) {
+		eps = find_policy_by_hnd(p,
+					 r->in.entry_handle,
+					 HTYPE_LOOKUP,
+					 struct rpc_eps,
+					 &status);
+		if (!NT_STATUS_IS_OK(status)) {
 			rc = EPMAPPER_STATUS_NO_MEMORY;
 			goto done;
 		}
@@ -949,6 +958,7 @@ error_status_t _epm_Map(struct pipes_struct *p,
 	uint32_t num_towers = 0;
 	uint32_t i;
 	bool ok;
+	NTSTATUS status;
 
 	*r->out.num_towers = 0;
 	r->out.towers = NULL;
@@ -1105,8 +1115,12 @@ error_status_t _epm_Map(struct pipes_struct *p,
 			goto done;
 		}
 
-		ok = find_policy_by_hnd(p, r->out.entry_handle, (void **)(void*) &eps);
-		if (!ok) {
+		eps = find_policy_by_hnd(p,
+					 r->out.entry_handle,
+					 HTYPE_LOOKUP,
+					 struct rpc_eps,
+					 &status);
+		if (!NT_STATUS_IS_OK(status)) {
 			rc = EPMAPPER_STATUS_NO_MEMORY;
 			goto done;
 		}
@@ -1114,8 +1128,12 @@ error_status_t _epm_Map(struct pipes_struct *p,
 	} else {
 		DEBUG(7, ("_epm_Map: Trying to find entry_handle.\n"));
 
-		ok = find_policy_by_hnd(p, r->in.entry_handle, (void **)(void*) &eps);
-		if (!ok) {
+		eps = find_policy_by_hnd(p,
+					 r->in.entry_handle,
+					 HTYPE_LOOKUP,
+					 struct rpc_eps,
+					 &status);
+		if (!NT_STATUS_IS_OK(status)) {
 			rc = EPMAPPER_STATUS_NO_MEMORY;
 			goto done;
 		}
diff --git a/source3/rpc_server/eventlog/srv_eventlog_nt.c b/source3/rpc_server/eventlog/srv_eventlog_nt.c
index 7b8d59637a9..7739d1953ef 100644
--- a/source3/rpc_server/eventlog/srv_eventlog_nt.c
+++ b/source3/rpc_server/eventlog/srv_eventlog_nt.c
@@ -70,8 +70,14 @@ static EVENTLOG_INFO *find_eventlog_info_by_hnd( struct pipes_struct * p,
 						struct policy_handle * handle )
 {
 	EVENTLOG_INFO *info;
+	NTSTATUS status;
 
-	if ( !find_policy_by_hnd( p, handle, (void **)(void *)&info ) ) {
+	info = find_policy_by_hnd(p,
+				  handle,
+				  DCESRV_HANDLE_ANY,
+				  EVENTLOG_INFO,
+				  &status);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG( 2,
 		       ( "find_eventlog_info_by_hnd: eventlog not found.\n" ) );
 		return NULL;
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 8892299ca77..198387424e6 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -50,6 +50,7 @@
 #include "../libcli/auth/libcli_auth.h"
 #include "../libcli/lsarpc/util_lsarpc.h"
 #include "lsa.h"
+#include "librpc/rpc/dcesrv_core.h"
 
 #include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/gnutls.h>
@@ -470,10 +471,12 @@ NTSTATUS _lsa_EnumTrustDom(struct pipes_struct *p,
 	int i;
 	NTSTATUS nt_status;
 
-	if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
-		return NT_STATUS_INVALID_HANDLE;
-
-	if (info->type != LSA_HANDLE_POLICY_TYPE) {
+	info = find_policy_by_hnd(p,
+				  r->in.handle,
+				  LSA_HANDLE_POLICY_TYPE,
+				  struct lsa_info,
+				  &nt_status);
+	if (!NT_STATUS_IS_OK(nt_status)) {
 		return NT_STATUS_INVALID_HANDLE;
 	}
 
@@ -549,10 +552,12 @@ NTSTATUS _lsa_QueryInfoPolicy(struct pipes_struct *p,
 	union lsa_PolicyInformation *info = NULL;
 	uint32_t acc_required = 0;
 
-	if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&handle))
-		return NT_STATUS_INVALID_HANDLE;
-
-	if (handle->type != LSA_HANDLE_POLICY_TYPE) {
+	handle = find_policy_by_hnd(p,
+				    r->in.handle,
+				    LSA_HANDLE_POLICY_TYPE,
+				    struct lsa_info,
+				    &status);
+	if (!NT_STATUS_IS_OK(status)) {
 		return NT_STATUS_INVALID_HANDLE;
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list