[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Nov 22 13:20:06 UTC 2017


The branch, master has been updated
       via  667335a build: ensure compiler flags are properly detected
       via  2e53d6a build: specify -Wformat as a prerequisite of -Wformat-security
       via  34b4be0 build: allow specifying prerequisite flags when checking flags
       via  90508f4 pam_wrapper: #ifdef-out unused functions
       via  e973ac0 build: disable format-zero-length warning
       via  7a2d8aa s3-torture: fix an always-true comparison
       via  9020334 s3-torture: fix some truncation warnings
       via  8efe057 smbspool_krb5_wrapper: fix some error messages
       via  80b4b53 s3-rpc-server: fix type of enum in lsa server
       via  4171191 s2-rpc-server: fix enum type in assignment
       via  1a2da5b s4-lib-policy: fix type of enum
       via  2947945 s4-torture: get rid of extra parentheses
       via  a83953a s4-torture: fix file time checks
       via  5fd0402 dns server: fix warning about enum mismatch
       via  5b1de1a ldb-samba: use ldap enum instead of ldb enum
       via  9ad9f7b librpc-build: ignore unused functions in generated code
       via  a74896d build: detect availability of -Wno-unused-function
       via  2606c99 build: allow adding cflags to end of python module build command
       via  98813a6 build: allow passing custom cflags to end of library build
       via  3cca62a ldb: silence some clang warnings in picky developer mode
       via  1d74e4f lib/crypto: remove unused code
       via  5aa8af0 torture: remove spurious semicolon
       via  4fcf661 nfs4acl: fix picky build in case rpc/xdr.h is not available
      from  76f370e libgpo: Fix CID 1422263 Resource leak

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


- Log -----------------------------------------------------------------
commit 667335a42d683f73ec9c52c68730041d83a163a5
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Nov 20 20:53:12 2017 +0000

    build: ensure compiler flags are properly detected
    
    While checking for compiler flag availability, treat warnings
    as errors. Thus if the compiler only warns about unsupported flag,
    it will fail the test and the flag shall be marked as unsupported.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Nov 22 14:19:20 CET 2017 on sn-devel-144

commit 2e53d6a30fc4135b702611d17a5d552cc32c446e
Author: Uri Simchoni <uri at samba.org>
Date:   Tue Nov 21 20:55:16 2017 +0200

    build: specify -Wformat as a prerequisite of -Wformat-security
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 34b4be091fe83ac0eec9e2d697b54bfa5e7823b6
Author: Uri Simchoni <uri at samba.org>
Date:   Tue Nov 21 20:53:30 2017 +0200

    build: allow specifying prerequisite flags when checking flags
    
    In gcc, "-Wformat-security" is ignored unless "-Wformat" is also
    specified. This patch allow adding a "prerequisite flag" to a flag
    we're testing during configuration.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 90508f46c0a57a632a64300d97c636112d3e8fb7
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 13:04:58 2017 +0000

    pam_wrapper: #ifdef-out unused functions
    
    When pam_vsyslog is not available, avoid building functions
    that are being used to wrap it, in order to avoid picky
    compiler warnings.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e973ac06431183b25cecf61053f3a23c91b88de6
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Nov 20 10:17:16 2017 +0200

    build: disable format-zero-length warning
    
    format-zero-length warns against printf-style calls with
    zero-length format string. vfs_full_audit module has such
    calls, and up until now there was no warning against it because
    the do_log in vfs_full_audit is not recognized as printf-style
    function. In a following commit the do_log will be converted to
    a printf-style function, hence the need to disable this warning.
    
    (an alternative would be to disable only for vfs_full_audit, but that
    would complicate things needlessly).
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7a2d8aa084d3b9e54eb358d46e1f26c4c6875390
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 18:38:28 2017 +0000

    s3-torture: fix an always-true comparison
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 902033453a719cc126b3ed2cfe765c9d4d2512aa
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 18:37:49 2017 +0000

    s3-torture: fix some truncation warnings
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8efe057a8780712373b93cc1b2b55ccc8a44220d
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 18:34:58 2017 +0000

    smbspool_krb5_wrapper: fix some error messages
    
    Make cups_smb_debug declaration printf-aware to
    avoid picky warning about printf with variable
    format string. This in turn revealed some formatting
    errors.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 80b4b53fbab4aaab0485411f3c611b66d8a3053b
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 17:57:29 2017 +0000

    s3-rpc-server: fix type of enum in lsa server
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4171191daec0d496d835ba8d281c366319fe4c78
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 16:51:30 2017 +0000

    s2-rpc-server: fix enum type in assignment
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1a2da5b0f8a0997de3d56888efd040285e200803
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 17:56:50 2017 +0000

    s4-lib-policy: fix type of enum
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2947945dc3dd6f3c596c81f2a8890ffa09a2aaef
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 17:55:14 2017 +0000

    s4-torture: get rid of extra parentheses
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a83953a094f1a41f3633ae24cdfd3a6cb804d986
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 17:13:26 2017 +0000

    s4-torture: fix file time checks
    
    NTTIME is an unsigned quantity. When comparing two
    of them, first calculate a signed difference, then
    take absolute value.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5fd04020c2bd5ae24f434ddef5976b39c2bfe2b4
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 16:49:46 2017 +0000

    dns server: fix warning about enum mismatch
    
    Fix picky developer clang warning about assignment
    of an enum value to a variable of a different enum type.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5b1de1aee214319d2a2121b467a7671f1a5453db
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 13:02:56 2017 +0000

    ldb-samba: use ldap enum instead of ldb enum
    
    This silences a picky compiler warning.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 9ad9f7bc5ea3932aa9e623290ef179fd211e17cb
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 11:34:01 2017 +0000

    librpc-build: ignore unused functions in generated code
    
    Some pidl-generated code includes static functions that are
    to be optimized-away by the compiler if not used. When
    running picky developer with clang that breaks the build. This
    change ignores this warning for the pidl-generated python binding
    files.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a74896d48f01456206fde51b4104c5dff0d9e39e
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 11:33:03 2017 +0000

    build: detect availability of -Wno-unused-function
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2606c99ed30215180be3711bbab68e219cc764b6
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 11:32:16 2017 +0000

    build: allow adding cflags to end of python module build command
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 98813a605d51ce42ecee0d8c5c2de82ef1566aed
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 11:30:56 2017 +0000

    build: allow passing custom cflags to end of library build
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3cca62a2ac17f7ae0571f7ca7976e1a8bb42211b
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 07:19:03 2017 +0000

    ldb: silence some clang warnings in picky developer mode
    
    Avoid const in casting since it doesn't increase code
    safety in this case and causes clang to generate const-qual
    warning. Also initialize a pointer to NULL to silence clang
    uninitialized variable warning.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1d74e4f6f303a0324ad6ee306395b3d1c745f982
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 07:02:12 2017 +0000

    lib/crypto: remove unused code
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 5aa8af0c4ad7c4fb7aff001e3bd96cdf28471005
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 05:20:57 2017 +0000

    torture: remove spurious semicolon
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4fcf66137ef63e8a6f697a45a773d463f13b68a2
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Nov 19 05:18:03 2017 +0000

    nfs4acl: fix picky build in case rpc/xdr.h is not available
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py     |  19 ++++--
 buildtools/wafsamba/samba_python.py       |   2 +
 buildtools/wafsamba/wafsamba.py           |   2 +
 lib/crypto/sha512.c                       |  20 ------
 lib/ldb-samba/ldb_ildap.c                 |   2 +-
 lib/ldb/pyldb.c                           |   4 +-
 lib/pam_wrapper/pam_wrapper.c             |   5 ++
 lib/replace/wscript                       |   3 +
 source3/client/smbspool_krb5_wrapper.c    |   7 +-
 source3/modules/nfs4acl_xattr_xdr.c       |   1 +
 source3/rpc_server/lsa/srv_lsa_nt.c       |   6 +-
 source3/torture/torture.c                 |   8 +--
 source4/dns_server/dns_query.c            |   2 +-
 source4/lib/policy/gp_filesys.c           |   2 +-
 source4/librpc/wscript_build              | 109 ++++++++++++++++++++----------
 source4/rpc_server/srvsvc/dcesrv_srvsvc.c |   2 +-
 source4/torture/raw/open.c                |   2 +-
 source4/torture/rpc/lsa.c                 |   4 +-
 source4/torture/rpc/spoolss_notify.c      |   3 +-
 source4/torture/smb2/create.c             |   2 +-
 20 files changed, 123 insertions(+), 82 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 795d130..7940a7d 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -473,10 +473,13 @@ def CHECK_STRUCTURE_MEMBER(conf, structname, member,
 def CHECK_CFLAGS(conf, cflags, fragment='int main(void) { return 0; }\n'):
     '''check if the given cflags are accepted by the compiler
     '''
+    check_cflags = TO_LIST(cflags)
+    if 'WERROR_CFLAGS' in conf.env:
+        check_cflags.extend(conf.env['WERROR_CFLAGS'])
     return conf.check(fragment=fragment,
                       execute=0,
                       type='nolink',
-                      ccflags=cflags,
+                      ccflags=check_cflags,
                       msg="Checking compiler accepts %s" % cflags)
 
 @conf
@@ -708,7 +711,9 @@ def SAMBA_CONFIG_H(conf, path=None):
                         testflags=True)
 
         conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
-        conf.ADD_CFLAGS('-Werror=format-security -Wformat-security', testflags=True)
+        conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True)
+        conf.ADD_CFLAGS('-Werror=format-security -Wformat-security',
+                        testflags=True, prereq_flags='-Wformat')
         # This check is because for ldb_search(), a NULL format string
         # is not an error, but some compilers complain about that.
         if CHECK_CFLAGS(conf, ["-Werror=format", "-Wformat=2"], '''
@@ -769,14 +774,15 @@ def CONFIG_PATH(conf, name, default):
             conf.env[name] = conf.env['PREFIX'] + default
 
 @conf
-def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False):
+def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False, prereq_flags=[]):
     '''add some CFLAGS to the command line
        optionally set testflags to ensure all the flags work
     '''
+    prereq_flags = TO_LIST(prereq_flags)
     if testflags:
         ok_flags=[]
         for f in flags.split():
-            if CHECK_CFLAGS(conf, f):
+            if CHECK_CFLAGS(conf, [f] + prereq_flags):
                 ok_flags.append(f)
         flags = ok_flags
     if not name in conf.env:
@@ -784,11 +790,12 @@ def ADD_NAMED_CFLAGS(conf, name, flags, testflags=False):
     conf.env[name].extend(TO_LIST(flags))
 
 @conf
-def ADD_CFLAGS(conf, flags, testflags=False):
+def ADD_CFLAGS(conf, flags, testflags=False, prereq_flags=[]):
     '''add some CFLAGS to the command line
        optionally set testflags to ensure all the flags work
     '''
-    ADD_NAMED_CFLAGS(conf, 'EXTRA_CFLAGS', flags, testflags=testflags)
+    ADD_NAMED_CFLAGS(conf, 'EXTRA_CFLAGS', flags, testflags=testflags,
+                     prereq_flags=prereq_flags)
 
 @conf
 def ADD_LDFLAGS(conf, flags, testflags=False):
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index f97439c..cb99fe9 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -109,6 +109,7 @@ def SAMBA_PYTHON(bld, name,
                  public_deps='',
                  realname=None,
                  cflags='',
+                 cflags_end=None,
                  includes='',
                  init_function_sentinel=None,
                  local_include=True,
@@ -154,6 +155,7 @@ def SAMBA_PYTHON(bld, name,
                       public_deps=public_deps,
                       includes=includes,
                       cflags=cflags,
+                      cflags_end=cflags_end,
                       local_include=local_include,
                       vars=vars,
                       realname=realname,
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 23fd3c4..4bb19d0 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -112,6 +112,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   vnum=None,
                   soname=None,
                   cflags='',
+                  cflags_end=None,
                   ldflags='',
                   external_library=False,
                   realname=None,
@@ -195,6 +196,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                         private_headers= private_headers,
                         header_path    = header_path,
                         cflags         = cflags,
+                        cflags_end     = cflags_end,
                         group          = subsystem_group,
                         autoproto      = autoproto,
                         autoproto_extra_source=autoproto_extra_source,
diff --git a/lib/crypto/sha512.c b/lib/crypto/sha512.c
index 9c7367b..41be1ec 100644
--- a/lib/crypto/sha512.c
+++ b/lib/crypto/sha512.c
@@ -38,26 +38,6 @@
 #define min(a,b) (((a)>(b))?(b):(a))
 #endif
 
-/* Vector Crays doesn't have a good 32-bit type, or more precisely,
-   int32_t as defined by <bind/bitypes.h> isn't 32 bits, and we don't
-   want to depend in being able to redefine this type.  To cope with
-   this we have to clamp the result in some places to [0,2^32); no
-   need to do this on other machines.  Did I say this was a mess?
-   */
-
-#ifdef _CRAY
-#define CRAYFIX(X) ((X) & 0xffffffff)
-#else
-#define CRAYFIX(X) (X)
-#endif
-
-static inline uint32_t
-cshift (uint32_t x, unsigned int n)
-{
-    x = CRAYFIX(x);
-    return CRAYFIX((x << n) | (x >> (32 - n)));
-}
-
 static inline uint64_t
 cshift64 (uint64_t x, unsigned int n)
 {
diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c
index a4e96e4..0cdf738 100644
--- a/lib/ldb-samba/ldb_ildap.c
+++ b/lib/ldb-samba/ldb_ildap.c
@@ -476,7 +476,7 @@ static int ildb_search(struct ildb_context *ac)
 	}
 
 	if (req->op.search.scope == LDB_SCOPE_DEFAULT) {
-		msg->r.SearchRequest.scope = LDB_SCOPE_SUBTREE;
+		msg->r.SearchRequest.scope = LDAP_SEARCH_SCOPE_SUB;
 	} else {
 		msg->r.SearchRequest.scope = req->op.search.scope;
 	}
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 515a69e..e61b5b6 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -510,10 +510,10 @@ static PyObject *py_ldb_dn_set_extended_component(PyLdbDnObject *self, PyObject
 {
 	char *name;
 	int err;
-	uint8_t *value;
+	uint8_t *value = NULL;
 	Py_ssize_t size = 0;
 
-	if (!PyArg_ParseTuple(args, "sz#", &name, (const char**)&value, &size))
+	if (!PyArg_ParseTuple(args, "sz#", &name, (char **)&value, &size))
 		return NULL;
 
 	if (value == NULL) {
diff --git a/lib/pam_wrapper/pam_wrapper.c b/lib/pam_wrapper/pam_wrapper.c
index 4be8146..03584be 100644
--- a/lib/pam_wrapper/pam_wrapper.c
+++ b/lib/pam_wrapper/pam_wrapper.c
@@ -508,6 +508,7 @@ static const char *libpam_pam_strerror(pam_handle_t *pamh, int errnum)
 	return pwrap.libpam.symbols._libpam_pam_strerror.f(discard_const_p(pam_handle_t, pamh), errnum);
 }
 
+#if defined(HAVE_PAM_VSYSLOG) || defined(HAVE_PAM_SYSLOG)
 static void libpam_pam_vsyslog(const pam_handle_t *pamh,
 			       int priority,
 			       const char *fmt,
@@ -522,6 +523,7 @@ static void libpam_pam_vsyslog(const pam_handle_t *pamh,
 						   args);
 #endif
 }
+#endif
 
 /*********************************************************
  * PWRAP INIT
@@ -1487,6 +1489,8 @@ const char *pam_strerror(pam_handle_t *pamh, int errnum)
 				  errnum);
 }
 
+#if defined(HAVE_PAM_VSYSLOG) || defined(HAVE_PAM_SYSLOG)
+
 static void pwrap_pam_vsyslog(const pam_handle_t *pamh,
 			      int priority,
 			      const char *fmt,
@@ -1533,6 +1537,7 @@ static void pwrap_pam_vsyslog(const pam_handle_t *pamh,
 
 	pwrap_vlog(dbglvl, syslog_str, fmt, args);
 }
+#endif /* defined(HAVE_PAM_VSYSLOG) || defined(HAVE_PAM_SYSLOG) */
 
 #ifdef HAVE_PAM_VSYSLOG
 void pam_vsyslog(const pam_handle_t *pamh,
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 7436a90..2f94d49 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -84,6 +84,9 @@ def configure(conf):
     if conf.CHECK_CFLAGS('-Wno-format-truncation'):
         conf.define('HAVE_WNO_FORMAT_TRUNCATION', '1')
 
+    if conf.CHECK_CFLAGS('-Wno-unused-function'):
+        conf.define('HAVE_WNO_UNUSED_FUNCTION', '1')
+
     # Check for process set name support
     conf.CHECK_CODE('''
                     #include <sys/prctl.h>
diff --git a/source3/client/smbspool_krb5_wrapper.c b/source3/client/smbspool_krb5_wrapper.c
index 9a82b2a..dee3b4c 100644
--- a/source3/client/smbspool_krb5_wrapper.c
+++ b/source3/client/smbspool_krb5_wrapper.c
@@ -37,7 +37,8 @@ enum cups_smb_dbglvl_e {
 	CUPS_SMB_LOG_DEBUG = 0,
 	CUPS_SMB_LOG_ERROR,
 };
-static void cups_smb_debug(enum cups_smb_dbglvl_e lvl, const char *format, ...);
+static void cups_smb_debug(enum cups_smb_dbglvl_e lvl, const char *format, ...)
+		PRINTF_ATTRIBUTE(2, 3);
 
 #define CUPS_SMB_DEBUG(...) cups_smb_debug(CUPS_SMB_LOG_DEBUG, __VA_ARGS__)
 #define CUPS_SMB_ERROR(...) cups_smb_debug(CUPS_SMB_LOG_DEBUG, __VA_ARGS__)
@@ -166,7 +167,7 @@ int main(int argc, char *argv[])
 	CUPS_SMB_DEBUG("Switching to gid=%d", gid);
 	rc = setgid(gid);
 	if (rc != 0) {
-		CUPS_SMB_ERROR("Failed to switch to gid=%u",
+		CUPS_SMB_ERROR("Failed to switch to gid=%u - %s",
 			       gid,
 			       strerror(errno));
 		return CUPS_BACKEND_FAILED;
@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
 	CUPS_SMB_DEBUG("Switching to uid=%u", uid);
 	rc = setuid(uid);
 	if (rc != 0) {
-		CUPS_SMB_ERROR("Failed to switch to uid=%u",
+		CUPS_SMB_ERROR("Failed to switch to uid=%u - %s",
 			       uid,
 			       strerror(errno));
 		return CUPS_BACKEND_FAILED;
diff --git a/source3/modules/nfs4acl_xattr_xdr.c b/source3/modules/nfs4acl_xattr_xdr.c
index 67684dce..524e69c 100644
--- a/source3/modules/nfs4acl_xattr_xdr.c
+++ b/source3/modules/nfs4acl_xattr_xdr.c
@@ -403,6 +403,7 @@ NTSTATUS nfs4acl_xdr_blob_to_smb4(struct vfs_handle_struct *handle,
 }
 
 #else /* !HAVE_RPC_XDR_H */
+#include "nfs4acl_xattr_xdr.h"
 NTSTATUS nfs4acl_xdr_blob_to_smb4(struct vfs_handle_struct *handle,
 				  TALLOC_CTX *mem_ctx,
 				  DATA_BLOB *blob,
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 2d0d29e..3cc87ad 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -4157,7 +4157,7 @@ static NTSTATUS make_ft_info(TALLOC_CTX *mem_ctx,
 
 		rec->flags = lrec->flags;
 		rec->timestamp = lrec->time;
-		rec->type = lrec->type;
+		rec->type = (enum ForestTrustInfoRecordType)lrec->type;
 
 		switch (lrec->type) {
 		case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
@@ -4412,7 +4412,7 @@ static NTSTATUS own_ft_info(struct pdb_domain_info *dom_info,
 
 	rec->flags = 0;
 	rec->timestamp = 0;
-	rec->type = LSA_FOREST_TRUST_TOP_LEVEL_NAME;
+	rec->type = FOREST_TRUST_TOP_LEVEL_NAME;
 
 	rec->data.name.string = talloc_strdup(fti, dom_info->dns_forest);
 	if (!rec->data.name.string) {
@@ -4425,7 +4425,7 @@ static NTSTATUS own_ft_info(struct pdb_domain_info *dom_info,
 
 	rec->flags = 0;
 	rec->timestamp = 0;
-	rec->type = LSA_FOREST_TRUST_DOMAIN_INFO;
+	rec->type = FOREST_TRUST_DOMAIN_INFO;
 
         info = &rec->data.info;
 
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 481154f..f3da67c 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -3214,7 +3214,7 @@ static bool run_attrtest(int dummy)
 		correct = False;
 	}
 
-	if (abs(t - time(NULL)) > 60*60*24*10) {
+	if (labs(t - time(NULL)) > 60*60*24*10) {
 		printf("ERROR: SMBgetatr bug. time is %s",
 		       ctime(&t));
 		t = time(NULL);
@@ -3445,13 +3445,13 @@ static bool run_trans2test(int dummy)
 			printf("modify time=%s", ctime(&m_time));
 			printf("This system appears to have sticky create times\n");
 		}
-		if ((abs(a_time - t) > 60) && (a_time % (60*60) == 0)) {
+		if ((labs(a_time - t) > 60) && (a_time % (60*60) == 0)) {
 			printf("access time=%s", ctime(&a_time));
 			printf("This system appears to set a midnight access time\n");
 			correct = False;
 		}
 
-		if (abs(m_time - t) > 60*60*24*7) {
+		if (labs(m_time - t) > 60*60*24*7) {
 			printf("ERROR: totally incorrect times - maybe word reversed? mtime=%s", ctime(&m_time));
 			correct = False;
 		}
@@ -5219,7 +5219,7 @@ static bool run_rename_access(int dummy)
 	}
 
 	if (cli) {
-		if (fnum != (uint64_t)-1) {
+		if (fnum != (uint16_t)-1) {
 			cli_close(cli, fnum);
 		}
 		cli_unlink(cli, src,
diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c
index fa92721..8d3f601 100644
--- a/source4/dns_server/dns_query.c
+++ b/source4/dns_server/dns_query.c
@@ -133,7 +133,7 @@ static WERROR add_response_rr(const char *name,
 
 	ans[ai].name = talloc_strdup(ans, name);
 	W_ERROR_HAVE_NO_MEMORY(ans[ai].name);
-	ans[ai].rr_type = rec->wType;
+	ans[ai].rr_type = (enum dns_qtype)rec->wType;
 	ans[ai].rr_class = DNS_QCLASS_IN;
 	ans[ai].ttl = rec->dwTtlSeconds;
 	ans[ai].length = UINT16_MAX;
diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c
index a18c513..d48fc9f 100644
--- a/source4/lib/policy/gp_filesys.c
+++ b/source4/lib/policy/gp_filesys.c
@@ -644,7 +644,7 @@ NTSTATUS gp_set_gpt_security_descriptor(struct gp_context *gp_ctx,
 	}
 
 	/* Set the security descriptor on the directory */
-	fileinfo.generic.level = RAW_FILEINFO_SEC_DESC;
+	fileinfo.generic.level = RAW_SFILEINFO_SEC_DESC;
 	fileinfo.set_secdesc.in.file.fnum = io.ntcreatex.out.file.fnum;
 	fileinfo.set_secdesc.in.secinfo_flags = SECINFO_PROTECTED_DACL |
 	                                        SECINFO_OWNER |
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index eed0551..ce893a2 100644
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -172,6 +172,10 @@ bld.SAMBA_LIBRARY('dcerpc',
 	vnum='0.0.1'
 	)
 
+gen_cflags = ''
+if bld.CONFIG_SET('HAVE_WNO_UNUSED_FUNCTION'):
+    gen_cflags = '-Wno-unused-function'
+
 for env in bld.gen_python_environments():
 	pyrpc_util = bld.pyembed_libname('pyrpc_util')
 	pytalloc_util = bld.pyembed_libname('pytalloc-util')
@@ -187,221 +191,256 @@ for env in bld.gen_python_environments():
 	bld.SAMBA_PYTHON('python_dcerpc',
 		source='rpc/pyrpc.c',
 		public_deps='LIBCLI_SMB samba-util samba-hostconfig dcerpc-samr RPC_NDR_LSA DYNCONFIG %s gensec' % pyrpc_util,
-		realname='samba/dcerpc/base.so'
+		realname='samba/dcerpc/base.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dcerpc_misc',
 		source='../../librpc/gen_ndr/py_misc.c',
 		deps='%s %s ndr-krb5pac' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/misc.so'
+		realname='samba/dcerpc/misc.so',
+		cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_auth',
 		source='../../librpc/gen_ndr/py_auth.c',
 		deps='NDR_AUTH %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/auth.so'
+		realname='samba/dcerpc/auth.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dcerpc_security',
 		source='../../librpc/gen_ndr/py_security.c',
 		deps='%s %s NDR_SECURITY' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/security.so'
+		realname='samba/dcerpc/security.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_lsa',
 		source='../../librpc/gen_ndr/py_lsa.c',
 		deps='RPC_NDR_LSA %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/lsa.so'
+		realname='samba/dcerpc/lsa.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_krb5pac',
 		source='../../librpc/gen_ndr/py_krb5pac.c',
 		deps='ndr-krb5pac %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/krb5pac.so'
+		realname='samba/dcerpc/krb5pac.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_netlogon',
 		source='../../librpc/gen_ndr/py_netlogon.c',
 		deps='RPC_NDR_NETLOGON %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/netlogon.so'
+		realname='samba/dcerpc/netlogon.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_samr',
 		source='../../librpc/gen_ndr/py_samr.c',
 		deps='dcerpc-samr %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/samr.so'
+		realname='samba/dcerpc/samr.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dcerpc_nbt',
 		source='../../librpc/gen_ndr/py_nbt.c',
 		deps='ndr_nbt RPC_NDR_NBT %s %s' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/nbt.so'
+		realname='samba/dcerpc/nbt.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
 		source='../../librpc/gen_ndr/py_drsblobs.c',
 		deps='%s %s NDR_SECURITY RPC_NDR_DRSBLOBS' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/drsblobs.so'
+		realname='samba/dcerpc/drsblobs.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dcerpc_ntlmssp',
 		source='../../librpc/gen_ndr/py_ntlmssp.c',
 		deps='%s %s RPC_NDR_NTLMSSP' % (pytalloc_util, pyrpc_util),
-		realname='samba/dcerpc/ntlmssp.so'
+		realname='samba/dcerpc/ntlmssp.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_srvsvc',
 	    source='../../librpc/gen_ndr/py_srvsvc.c',
 	    deps='RPC_NDR_SRVSVC pytalloc-util pyrpc_util',
-	    realname='samba/dcerpc/srvsvc.so'
+	    realname='samba/dcerpc/srvsvc.so',
+            cflags_end=gen_cflags
 	    )
 
 	bld.SAMBA_PYTHON('python_echo',
 		source='../../librpc/gen_ndr/py_echo.c',
 		deps='RPC_NDR_ECHO pytalloc-util pyrpc_util',
-		realname='samba/dcerpc/echo.so'
+		realname='samba/dcerpc/echo.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_dns',
 		source='../../librpc/gen_ndr/py_dns.c',
 		deps='NDR_DNS pytalloc-util pyrpc_util',
-		realname='samba/dcerpc/dns.so'
+		realname='samba/dcerpc/dns.so',
+                cflags_end=gen_cflags
 		)
 
 	bld.SAMBA_PYTHON('python_winreg',
 		source='../../librpc/gen_ndr/py_winreg.c',
 		deps='RPC_NDR_WINREG pytalloc-util pyrpc_util',
-		realname='samba/dcerpc/winreg.so'
+		realname='samba/dcerpc/winreg.so',
+                cflags_end=gen_cflags
 		)
 
 
 	bld.SAMBA_PYTHON('python_initshutdown',
 		source='../../librpc/gen_ndr/py_initshutdown.c',
 		deps='RPC_NDR_INITSHUTDOWN pytalloc-util pyrpc_util',
-		realname='samba/dcerpc/initshutdown.so'
+		realname='samba/dcerpc/initshutdown.so',
+                cflags_end=gen_cflags
 		)
 
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list