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

Karolin Seeger kseeger at samba.org
Thu Aug 7 10:55:03 MDT 2014


The branch, v4-1-test has been updated
       via  93c30e2 tests: dnsserver: Add a update test with name set to '.'
       via  6f46d80 s4-rpc: dnsserver: Allow . to be specified for @ record
       via  bcc0f97 s3: net time - fix usage and core dump.
       via  8f63de4 s3: xml-docs. Ensure users of 'net time' know the remote server must be specified with -S.
       via  cef3156 s3: remove stat_ex.vfs_private completely
       via  4791d5c s3:vfs:gpfs: remove a block and reduce indentation in gpfs_is_offline()
       via  7c49479 s3:vfs:gpfs: remove all writing uses of stat_ex.vfs_private from vfs_gpfs.
       via  9093f2d s3:vfs:gpfs: Remove all reading uses of stat_ex.vfs_private from vfs_gfs.
       via  1c82326 s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
       via  bddae75 s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()
       via  189afb4 s3:idmap: don't log missing range config if range checking not requested
       via  9449ff4 sys_poll_intr: fix timeout arithmetic
       via  a2a4d0b s4:torture/rpc: add rpc.netlogon.ServerReqChallengeGlobal
       via  a78ec00 s4:rpc_server/netlogon: keep a global challenge table
       via  8907f5e lib/util: move memcache.[ch] to the toplevel 'samba-util' library
       via  9e4042b s3:lib/memcache: only include the required header files
       via  cf6b312 s3:lib/memcache: make use of talloc for memcache_elements
       via  857d7b0 s3:lib/memcache: use uint8_t instead of uint8
       via  39aeb27 s4:torture/rpc: add invalidAuthenticate2
       via  cddc250 selftest/knownfail: add ^samba4.rpc.netlogon.*.invalidAuthenticate2 for v4-1-*
       via  4a5a042 libcli/auth: also set secure channel type in netlogon_creds_client_init().
       via  f1cd122 lib: tevent: make TEVENT_SIG_INCREMENT atomic.
      from  c8eea31 VERSION: Bump version up to 4.1.12.

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


- Log -----------------------------------------------------------------
commit 93c30e2d685fac83cd5d48c3ad80a18b34cf3a2d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Jul 28 18:09:37 2014 +1000

    tests: dnsserver: Add a update test with name set to '.'
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Jul 29 19:33:19 CEST 2014 on sn-devel-104
    
    (cherry picked from commit 6d104182d9667e4f996439d24cfa052f34098ce4)
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10742
    samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org. => NO_MEMORY
    
    Autobuild-User(v4-1-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-1-test): Thu Aug  7 18:54:28 CEST 2014 on sn-devel-104

commit 6f46d801eece8a625428e3b64505acc82875d37c
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Jul 28 13:07:58 2014 +1000

    s4-rpc: dnsserver: Allow . to be specified for @ record
    
    Windows allow both . and @ to be specified with modifying @ record.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10742
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 4b4e30b780345c74f9983ba77f04c616b3d034b7)

commit bcc0f97ba1ec2a5e3f5bb1ddbf502ce7b8e14fb6
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jul 29 14:12:31 2014 -0700

    s3: net time - fix usage and core dump.
    
    Bug 10728 - 'net time system' segfaults
    
    https://bugzilla.samba.org/show_bug.cgi?id=10728
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 8f63de43da0678357e556e49d8a8ec1fd021fd81
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jul 29 12:29:37 2014 -0700

    s3: xml-docs. Ensure users of 'net time' know the remote server must be specified with -S.
    
    Bug 10728 - 'net time system' segfaults
    
    https://bugzilla.samba.org/show_bug.cgi?id=10728
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit cef315660025fc97ef39a030a0d7314d480e7a4e
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 17 17:27:17 2014 +0200

    s3: remove stat_ex.vfs_private completely
    
    It is not used any more.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Thu Jul 24 14:23:11 CEST 2014 on sn-devel-104
    
    (cherry picked from commit cd95937369b1729e2417d78f3c903bce5d32da93)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit 4791d5cc710f114cb71fe269b85e37ae04d55e09
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 17 17:06:32 2014 +0200

    s3:vfs:gpfs: remove a block and reduce indentation in gpfs_is_offline()
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit eb0577dca04a2fde4691094a006954d417d1cf22)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit 7c49479aeac7ee48e24c0094393ef5fee0e4a0c9
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 17 23:35:58 2014 +0200

    s3:vfs:gpfs: remove all writing uses of stat_ex.vfs_private from vfs_gpfs.
    
    Now that the vfs_private cache is never read in vfs_gpfs, there is
    no need any more to write it.
    
    With this change, vfs_gpfs does not use vfs_private any more.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit d87d13f4c2a77c03bbffcd0fe4fc9464d9024cae)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit 9093f2d9d40bbfaf0776926a5f911ff3bc7bd522
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 17 17:22:09 2014 +0200

    s3:vfs:gpfs: Remove all reading uses of stat_ex.vfs_private from vfs_gfs.
    
    This was used as a cache for offline-info in the stat buffer.
    But as the implementation of gpfs_is_offline() showed, this cache
    does not always carry valid information when the stat itself is valid
    (since at least one call goes to fstatat() directly, circumventing
     the vfs).
    
    So the correct thing is to always call SMB_VFS_IS_OFFLINE()
    when checking whether a file is offline. For the pread and pwrite
    calls, we need to call IS_OFFLINE before the actual read
    and check afterwards if the file was offline before (as a basis
    whether to send notifications).
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit 16a040f8ef7f2f594505ef07e6f9b77df8f1d725)
    
    Conflicts:
    	source3/modules/vfs_gpfs.c
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit 1c8232684a30c1ac1fec1d65b664fc80d2331224
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 3 10:10:11 2014 +0200

    s3:vfs:gpfs: fix flapping offline: always get winAttrs from gpfs for is_offline
    
    There is a problem of flapping offline due to uninitialized
    stat buffers. Due to a optimization in vfswrap_readdir which
    directly calling fastatat (i.e. not through vfs), marking the
    stat buffer valid, there is nothing this module can do about
    it and hence can not currently not rely on the vaildity of
    the stat buffer.
    
    By always calling out to GPFS even when the stat buffer is
    flagged valid, we can always return correct offline information,
    thereby sacrificing the readdir optimization.
    
    Pair-Programmed-With: Volker Lendecke <vl at samba.org>
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit 31e67507144aae8d5a8ec49587ac89d2d94636f0)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit bddae75c9ccaf036208b8b441ecfc0e4ebe3ecd2
Author: Michael Adam <obnox at samba.org>
Date:   Thu Jul 3 10:07:37 2014 +0200

    s3:vfs:gpfs: store the winAttrs in the struct_ex when we got them in vfs_gpfs_fstat()
    
    This may (e.g.) have lead to some occurrences of flapping offline bits.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Christof Schmitt <cs at samba.org>
    (cherry picked from commit 573ca6ef6b8376800d8fc988d67909e103b74656)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10741

commit 189afb40d2c8c61dde935be4c799e7da1ab8415b
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jul 20 11:49:37 2014 +0200

    s3:idmap: don't log missing range config if range checking not requested
    
    idmap_init_domain() is called with check_range == false from
    idmap_passdb_domain(). In this case, we usually don't have an
    idmap range at all, and we don't want to level 1 debug
    messages complaining about the fact are irritating at least.
    
    This patch removes the debug in the case of check_range == false.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10737
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 3c6ec8908a697ac95536b35d242ccd64e524a0a5)

commit 9449ff4b9605aafbc3ff7cac02b1cd511cbcbec1
Author: Daniel Kobras <d.kobras at science-computing.de>
Date:   Mon Jul 21 10:47:53 2014 +0200

    sys_poll_intr: fix timeout arithmetic
    
    Callers of sys_poll_intr() assume timeout to be in milliseconds like
    poll(2) expects, but implementation used nanosecond units. Also make
    sure timeout doesn't become infinite by mistake during time arithmetic.
    
    Signed-off-by: Daniel Kobras <d.kobras at science-computing.de>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10731
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jul 22 00:12:24 CEST 2014 on sn-devel-104

commit a2a4d0b6f2e3eff4e537fced6416e50fc0d4993f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 16:05:12 2014 +0200

    s4:torture/rpc: add rpc.netlogon.ServerReqChallengeGlobal
    
    This demonstrates that the challenge table should be global.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10723
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Sat Jul 19 12:51:39 CEST 2014 on sn-devel-104
    
    (cherry picked from commit d90f3323ee001080645dcd25da8b8ce1367b1377)

commit a78ec00991e4516106f50cc1616cf1467cc085e6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 14:20:58 2014 +0200

    s4:rpc_server/netlogon: keep a global challenge table
    
    Some clients call netr_ServerReqChallenge() and netr_ServerAuthenticate3()
    on different connections. This works against Windows DCs as they
    have a global challenge table.
    
    A VMware provisioning task for Windows VMs seemy to rely on this behavior.
    
    As a fallback we're storing the challenge in a global memcache with a fixed
    size. This should allow these strange clients to work against a
    Samba AD DC.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10723
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (similar to commit 321ebc99b5a00f82265aee741a48aa84b214d6e8)

commit 8907f5e06977c6981f5484f5c054102d4aab44f7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 12:58:34 2014 +0200

    lib/util: move memcache.[ch] to the toplevel 'samba-util' library
    
    This is generic enough that it could be used in all code.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Jul 18 15:43:33 CEST 2014 on sn-devel-104
    
    (cherry picked from commit 45807028d478c082fef6f3a3d5a142d96d63fb50)

commit 9e4042b5a29613f4d9ae3b1e4575661bb8f93cd4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 12:49:48 2014 +0200

    s3:lib/memcache: only include the required header files
    
    We don't need the full "includes.h".
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit b560fac7f78b761ee279d8e87a749125665eb5d1)

commit cf6b3121747f99836fa0a7d6e3e0b7727965d946
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 12:48:51 2014 +0200

    s3:lib/memcache: make use of talloc for memcache_elements
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 91105d1057c29c5878f50678baeb1bd1a6f1abe3)

commit 857d7b081fd54992508a5a0791dd21a227babceb
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 17 12:41:20 2014 +0200

    s3:lib/memcache: use uint8_t instead of uint8
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit d7cbc63dc7537fc9562da985b77f6d62dc41fd84)

commit 39aeb273c65e5f73594fcbf6435ee1d28203d581
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 10 12:19:08 2014 +0100

    s4:torture/rpc: add invalidAuthenticate2
    
    This add 'rpc.netlogon.netlogon.invalidAuthenticate2' as new test
    it demonstrates the STATUS_BUFFER_OVERFLOW on computer names
    larger than 15 characters.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Jan 22 19:07:12 CET 2014 on sn-devel-104
    
    (cherry picked from commit 38f8788d6bf7fac509dcf492214a66a8bb3ac3fc)

commit cddc250cbf057f45464d6be079517cf061c75b92
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 18 11:06:50 2014 +0200

    selftest/knownfail: add ^samba4.rpc.netlogon.*.invalidAuthenticate2 for v4-1-*
    
    This works in master (>= 4.2), but not in 4.1.x.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 4a5a0427ebca10256a967c176d93e09b089cf28d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Dec 19 13:53:23 2012 +0100

    libcli/auth: also set secure channel type in netlogon_creds_client_init().
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit a9d5b2fdf03a25e7669258de6c83288be3335cef)

commit f1cd12254405460bede46ab0e365c831f35e52b2
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jul 30 09:56:54 2014 -0700

    lib: tevent: make TEVENT_SIG_INCREMENT atomic.
    
    On arm platforms incrementing a variable is not
    an atomic operation, so may be interrupted by
    signal processing (if a signal interrupts another
    signal handler).
    
    Use compiler built-ins to make this atomic.
    __sync_fetch_and_add() works on gcc, llvm,
    IBM xlC on AIX, and Intel icc (10.1 and
    above).
    
    atomic_add_32() works on Oracle Solaris.
    
    Based on an inital patch from kamei at osstech.co.jp.
    
    Bug #10640 - smbd is not responding - tevent_common_signal_handler() increments non-atomic variables
    
    https://bugzilla.samba.org/show_bug.cgi?id=10640
    
    Back-ported from master 536c799f00d7bdd6a574b6bdbc0e9c742eeef8b5
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <Volker.Lendecke at SerNet.DE>

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

Summary of changes:
 docs-xml/manpages/net.8.xml                     |   15 ++-
 lib/replace/replace.h                           |    5 +
 lib/replace/wscript                             |   25 ++++
 lib/tevent/tevent_signal.c                      |    6 +
 {source3/lib => lib/util}/memcache.c            |   22 ++--
 {source3/include => lib/util}/memcache.h        |    2 -
 lib/util/select.c                               |   14 ++-
 lib/util/wscript_build                          |    2 +-
 libcli/auth/credentials.c                       |    2 +
 libcli/auth/proto.h                             |    1 +
 python/samba/tests/dcerpc/dnsserver.py          |   41 ++++++-
 selftest/knownfail                              |    1 +
 source3/auth/token_util.c                       |    2 +-
 source3/include/includes.h                      |    8 -
 source3/lib/access.c                            |    2 +-
 source3/lib/id_cache.c                          |    2 +-
 source3/lib/username.c                          |    2 +-
 source3/lib/util_sock.c                         |    2 +-
 source3/librpc/idl/open_files.idl               |    1 -
 source3/modules/vfs_gpfs.c                      |   63 ++++-----
 source3/passdb/lookup_sid.c                     |    2 +-
 source3/passdb/pdb_interface.c                  |    2 +-
 source3/rpc_client/cli_netlogon.c               |    1 +
 source3/smbd/dir.c                              |    2 +-
 source3/smbd/durable.c                          |   14 --
 source3/smbd/globals.c                          |    2 +-
 source3/smbd/mangle_hash2.c                     |    2 +-
 source3/smbd/server.c                           |    2 +-
 source3/smbd/statcache.c                        |    2 +-
 source3/smbd/vfs.c                              |    2 +-
 source3/torture/torture.c                       |    2 +-
 source3/utils/net_time.c                        |   30 +++--
 source3/winbindd/idmap.c                        |    4 +-
 source3/wscript_build                           |    2 +-
 source4/librpc/rpc/dcerpc_schannel.c            |    1 +
 source4/rpc_server/dnsserver/dcerpc_dnsserver.c |    4 +-
 source4/rpc_server/netlogon/dcerpc_netlogon.c   |   91 ++++++++++++-
 source4/torture/ntp/ntp_signd.c                 |    1 +
 source4/torture/rpc/lsa.c                       |    1 +
 source4/torture/rpc/netlogon.c                  |  164 +++++++++++++++++++++--
 source4/torture/rpc/samba3rpc.c                 |    2 +
 41 files changed, 426 insertions(+), 125 deletions(-)
 rename {source3/lib => lib/util}/memcache.c (95%)
 rename {source3/include => lib/util}/memcache.h (99%)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml
index e2e1b8f..4c88008 100644
--- a/docs-xml/manpages/net.8.xml
+++ b/docs-xml/manpages/net.8.xml
@@ -404,7 +404,8 @@ YOU HAVE BEEN WARNED.
 <title>TIME</title>
 
 <para>Without any options, the <command>NET TIME</command> command 
-displays the time on the remote server.
+displays the time on the remote server. The remote server must be
+specified with the -S option.
 </para>
 
 </refsect3>
@@ -412,21 +413,27 @@ displays the time on the remote server.
 <refsect3>
 <title>TIME SYSTEM</title>
 
-<para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.</para>
+<para>Displays the time on the remote server in a format ready for <command>/bin/date</command>.
+The remote server must be specified with the -S option.
+</para>
 
 </refsect3>
 
 <refsect3>
 <title>TIME SET</title>
 <para>Tries to set the date and time of the local server to that on 
-the remote server using <command>/bin/date</command>. </para>
+the remote server using <command>/bin/date</command>.
+The remote server must be specified with the -S option.
+</para>
 
 </refsect3>
 
 <refsect3>
 <title>TIME ZONE</title>
 
-<para>Displays the timezone in hours from GMT on the remote computer.</para>
+<para>Displays the timezone in hours from GMT on the remote server.
+The remote server must be specified with the -S option.
+</para>
 
 </refsect3>
 </refsect2>
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index c0b7997..cd0c25e 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -899,4 +899,9 @@ int usleep(useconds_t);
 void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
 #endif
 
+/* Needed for Solaris atomic_add_XX functions. */
+#if defined(HAVE_SYS_ATOMIC_H)
+#include <sys/atomic.h>
+#endif
+
 #endif /* _LIBREPLACE_REPLACE_H */
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 8451689..f0040b1 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -106,6 +106,7 @@ struct foo bar = { .y = 'X', .x = 1 };
     conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
     conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h malloc.h')
     conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
+    conf.CHECK_HEADERS('sys/atomic.h')
 
     # Check for process set name support
     conf.CHECK_CODE('''
@@ -225,6 +226,30 @@ struct foo bar = { .y = 'X', .x = 1 };
                        msg="Checking whether we have ucontext_t",
                        headers='signal.h sys/ucontext.h')
 
+    # Check for atomic builtins. */
+    conf.CHECK_CODE('''
+                    int main(void) {
+                        int i;
+                        (void)__sync_fetch_and_add(&i, 1);
+                        return 0;
+                    }
+                    ''',
+                    'HAVE___SYNC_FETCH_AND_ADD',
+                    msg='Checking for __sync_fetch_and_add compiler builtin')
+
+    conf.CHECK_CODE('''
+                    #include <stdint.h>
+                    #include <sys/atomic.h>
+                    int main(void) {
+                        int32_t i;
+                        atomic_add_32(&i, 1);
+                        return 0;
+                    }
+                    ''',
+                    'HAVE_ATOMIC_ADD_32',
+                    headers='stdint.h sys/atomic.h',
+                    msg='Checking for atomic_add_32 compiler builtin')
+
     # these may be builtins, so we need the link=False strategy
     conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False)
 
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index 0fdf646..95a099d 100644
--- a/lib/tevent/tevent_signal.c
+++ b/lib/tevent/tevent_signal.c
@@ -42,7 +42,13 @@ struct tevent_sigcounter {
 	uint32_t seen;
 };
 
+#if defined(HAVE___SYNC_FETCH_AND_ADD)
+#define TEVENT_SIG_INCREMENT(s) __sync_fetch_and_add(&((s).count), 1)
+#elif defined(HAVE_ATOMIC_ADD_32)
+#define TEVENT_SIG_INCREMENT(s) atomic_add_32(&((s).count), 1)
+#else
 #define TEVENT_SIG_INCREMENT(s) (s).count++
+#endif
 #define TEVENT_SIG_SEEN(s, n) (s).seen += (n)
 #define TEVENT_SIG_PENDING(s) ((s).seen != (s).count)
 
diff --git a/source3/lib/memcache.c b/lib/util/memcache.c
similarity index 95%
rename from source3/lib/memcache.c
rename to lib/util/memcache.c
index 88453f3..50e59fc 100644
--- a/source3/lib/memcache.c
+++ b/lib/util/memcache.c
@@ -17,8 +17,13 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "memcache.h"
+#include "replace.h"
+#include <talloc.h>
+#include "../lib/util/samba_util.h"
+#include "../lib/util/debug.h"
+#include "../lib/util/dlinklist.h"
 #include "../lib/util/rbtree.h"
+#include "memcache.h"
 
 static struct memcache *global_cache;
 
@@ -26,7 +31,7 @@ struct memcache_element {
 	struct rb_node rb_node;
 	struct memcache_element *prev, *next;
 	size_t keylength, valuelength;
-	uint8 n;		/* This is really an enum, but save memory */
+	uint8_t n;		/* This is really an enum, but save memory */
 	char data[1];		/* placeholder for offsetof */
 };
 
@@ -63,7 +68,7 @@ static int memcache_destructor(struct memcache *cache) {
 
 	for (e = cache->mru; e != NULL; e = next) {
 		next = e->next;
-		SAFE_FREE(e);
+		TALLOC_FREE(e);
 	}
 	return 0;
 }
@@ -96,7 +101,7 @@ static struct memcache_element *memcache_node2elem(struct rb_node *node)
 static void memcache_element_parse(struct memcache_element *e,
 				   DATA_BLOB *key, DATA_BLOB *value)
 {
-	key->data = ((uint8 *)e) + offsetof(struct memcache_element, data);
+	key->data = ((uint8_t *)e) + offsetof(struct memcache_element, data);
 	key->length = e->keylength;
 	value->data = key->data + e->keylength;
 	value->length = e->valuelength;
@@ -206,7 +211,7 @@ static void memcache_delete_element(struct memcache *cache,
 
 	cache->size -= memcache_element_size(e->keylength, e->valuelength);
 
-	SAFE_FREE(e);
+	TALLOC_FREE(e);
 }
 
 static void memcache_trim(struct memcache *cache)
@@ -285,13 +290,12 @@ void memcache_add(struct memcache *cache, enum memcache_number n,
 
 	element_size = memcache_element_size(key.length, value.length);
 
-
-	e = (struct memcache_element *)SMB_MALLOC(element_size);
-
+	e = talloc_size(cache, element_size);
 	if (e == NULL) {
-		DEBUG(0, ("malloc failed\n"));
+		DEBUG(0, ("talloc failed\n"));
 		return;
 	}
+	talloc_set_type(e, struct memcache_element);
 
 	e->n = n;
 	e->keylength = key.length;
diff --git a/source3/include/memcache.h b/lib/util/memcache.h
similarity index 99%
rename from source3/include/memcache.h
rename to lib/util/memcache.h
index 9362483..11e5971 100644
--- a/source3/include/memcache.h
+++ b/lib/util/memcache.h
@@ -20,8 +20,6 @@
 #ifndef __MEMCACHE_H__
 #define __MEMCACHE_H__
 
-#include "includes.h"
-
 struct memcache;
 
 /*
diff --git a/lib/util/select.c b/lib/util/select.c
index 5e66344..99cd772 100644
--- a/lib/util/select.c
+++ b/lib/util/select.c
@@ -42,9 +42,19 @@ int sys_poll_intr(struct pollfd *fds, int num_fds, int timeout)
 		if (errno != EINTR) {
 			break;
 		}
+		/* Infinite timeout, no need to adjust. */
+		if (timeout < 0) {
+			continue;
+		}
 		clock_gettime_mono(&now);
-		elapsed = nsec_time_diff(&now, &start);
-		timeout = (orig_timeout - elapsed) / 1000000;
+		elapsed = nsec_time_diff(&now, &start) / 1000000;
+		timeout = orig_timeout - elapsed;
+		/* Unlikely, but might happen eg. when getting traced.
+		 * Make sure we're not hanging in this case.
+		 */
+		if (timeout < 0) {
+			timeout = 0;
+		}
 	};
 	return ret;
 }
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 5087116..f161f96 100755
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -8,7 +8,7 @@ bld.SAMBA_LIBRARY('samba-util',
                     util_strlist.c util_paths.c idtree.c debug.c fault.c base64.c
                     util_str.c util_str_common.c substitute.c ms_fnmatch.c
                     server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
-                    tevent_debug.c util_process.c''',
+                    tevent_debug.c util_process.c memcache.c''',
                   deps='DYNCONFIG',
                   public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd-daemon',
                   public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h',
diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c
index 7c8d53c..fb77ede 100644
--- a/libcli/auth/credentials.c
+++ b/libcli/auth/credentials.c
@@ -263,6 +263,7 @@ next comes the client specific functions
 struct netlogon_creds_CredentialState *netlogon_creds_client_init(TALLOC_CTX *mem_ctx,
 								  const char *client_account,
 								  const char *client_computer_name,
+								  uint16_t secure_channel_type,
 								  const struct netr_Credential *client_challenge,
 								  const struct netr_Credential *server_challenge,
 								  const struct samr_Password *machine_password,
@@ -277,6 +278,7 @@ struct netlogon_creds_CredentialState *netlogon_creds_client_init(TALLOC_CTX *me
 
 	creds->sequence = time(NULL);
 	creds->negotiate_flags = negotiate_flags;
+	creds->secure_channel_type = secure_channel_type;
 
 	creds->computer_name = talloc_strdup(creds, client_computer_name);
 	if (!creds->computer_name) {
diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h
index 89a732e..6bc18d7 100644
--- a/libcli/auth/proto.h
+++ b/libcli/auth/proto.h
@@ -26,6 +26,7 @@ next comes the client specific functions
 struct netlogon_creds_CredentialState *netlogon_creds_client_init(TALLOC_CTX *mem_ctx, 
 								  const char *client_account,
 								  const char *client_computer_name, 
+								  uint16_t secure_channel_type,
 								  const struct netr_Credential *client_challenge,
 								  const struct netr_Credential *server_challenge,
 								  const struct samr_Password *machine_password,
diff --git a/python/samba/tests/dcerpc/dnsserver.py b/python/samba/tests/dcerpc/dnsserver.py
index 59d6eee..e2c6667 100644
--- a/python/samba/tests/dcerpc/dnsserver.py
+++ b/python/samba/tests/dcerpc/dnsserver.py
@@ -19,7 +19,7 @@
 
 from samba.dcerpc import dnsp, dnsserver
 from samba.tests import RpcInterfaceTestCase, env_get_var_value
-from samba.netcmd.dns import ARecord
+from samba.netcmd.dns import ARecord, NSRecord
 
 class DnsserverTests(RpcInterfaceTestCase):
 
@@ -239,3 +239,42 @@ class DnsserverTests(RpcInterfaceTestCase):
                                         select_flags,
                                         None,
                                         None)
+
+    def test_updaterecords2_soa(self):
+        client_version = dnsserver.DNS_CLIENT_VERSION_LONGHORN
+        record_type = dnsp.DNS_TYPE_NS
+        select_flags = (dnsserver.DNS_RPC_VIEW_AUTHORITY_DATA |
+                        dnsserver.DNS_RPC_VIEW_NO_CHILDREN)
+
+        nameserver = 'ns.example.local'
+        rec = NSRecord(nameserver)
+
+        # Add record
+        add_rec_buf = dnsserver.DNS_RPC_RECORD_BUF()
+        add_rec_buf.rec = rec
+        self.conn.DnssrvUpdateRecord2(client_version,
+                                        0,
+                                        self.server,
+                                        self.zone,
+                                        '.',
+                                        add_rec_buf,
+                                        None)
+
+        buflen, result = self.conn.DnssrvEnumRecords2(client_version,
+                                                        0,
+                                                        self.server,
+                                                        self.zone,
+                                                        '@',
+                                                        None,
+                                                        record_type,
+                                                        select_flags,
+                                                        None,
+                                                        None)
+        self.assertEquals(1, result.count)
+        self.assertEquals(2, result.rec[0].wRecordCount)
+        match = False
+        for i in range(2):
+            self.assertEquals(dnsp.DNS_TYPE_NS, result.rec[0].records[i].wType)
+            if result.rec[0].records[i].data.str.rstrip('.') == nameserver:
+                match = True
+        self.assertEquals(match, True)
diff --git a/selftest/knownfail b/selftest/knownfail
index 3768f82..c493dba 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -106,6 +106,7 @@
 ^samba4.rpc.netlogon.*.GetTrustPasswords
 ^samba4.rpc.netlogon.*.DatabaseRedo
 ^samba4.rpc.netlogon.*.ServerGetTrustInfo
+^samba4.rpc.netlogon.*.invalidAuthenticate2
 ^samba4.rpc.samr.passwords.badpwdcount # Not provided by Samba 4 yet
 ^samba4.rpc.samr.passwords.lockout
 ^samba4.base.charset.*.Testing partial surrogate
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index be44ce9..039387f 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -28,7 +28,7 @@
 #include "system/passwd.h"
 #include "auth.h"
 #include "secrets.h"
-#include "memcache.h"
+#include "../lib/util/memcache.h"
 #include "../librpc/gen_ndr/netlogon.h"
 #include "../libcli/security/security.h"
 #include "../lib/util/util_pw.h"
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 1b22a57..e8434f2 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -322,14 +322,6 @@ struct stat_ex {
 
 	uint32_t	st_ex_flags;
 	uint32_t	st_ex_mask;
-
-	/*
-	 * Add space for VFS internal extensions. The initial user of this
-	 * would be the onefs modules, passing the snapid from the stat calls
-	 * to the file_id_create call. Maybe we'll have to expand this later,
-	 * but the core of Samba should never look at this field.
-	 */
-	uint64_t vfs_private;
 };
 
 typedef struct stat_ex SMB_STRUCT_STAT;
diff --git a/source3/lib/access.c b/source3/lib/access.c
index 044c079..b664dc8 100644
--- a/source3/lib/access.c
+++ b/source3/lib/access.c
@@ -11,7 +11,7 @@
 */
 
 #include "includes.h"
-#include "memcache.h"
+#include "../lib/util/memcache.h"
 #include "lib/socket/interfaces.h"
 
 #define NAME_INDEX 0
diff --git a/source3/lib/id_cache.c b/source3/lib/id_cache.c
index e6e3457..3a703ae 100644
--- a/source3/lib/id_cache.c
+++ b/source3/lib/id_cache.c
@@ -28,7 +28,7 @@
 #include "includes.h"
 #include "messages.h"
 #include "lib/id_cache.h"
-#include "include/memcache.h"
+#include "../lib/util/memcache.h"
 #include "idmap_cache.h"
 #include "../librpc/gen_ndr/ndr_security.h"
 #include "../libcli/security/dom_sid.h"
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 665fbb4..d44db75 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/passwd.h"
-#include "memcache.h"
+#include "../lib/util/memcache.h"
 #include "../lib/util/util_pw.h"
 
 /* internal functions */
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 54286b3..22ba764 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "system/filesys.h"
-#include "memcache.h"
+#include "../lib/util/memcache.h"
 #include "../lib/async_req/async_sock.h"
 #include "../lib/util/select.h"
 #include "lib/socket/interfaces.h"
diff --git a/source3/librpc/idl/open_files.idl b/source3/librpc/idl/open_files.idl
index 686bc02..42ecb02 100644
--- a/source3/librpc/idl/open_files.idl
+++ b/source3/librpc/idl/open_files.idl
@@ -77,7 +77,6 @@ interface open_files
 		hyper		st_ex_blocks;
 		uint32		st_ex_flags;
 		uint32		st_ex_mask;
-		hyper		vfs_private;
 	} vfs_default_durable_stat;
 
 	typedef [public] struct {
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 4a53bf8..f9eb7e8 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -1444,7 +1444,6 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle,
 		smb_fname->st.st_ex_calculated_birthtime = false;
 		smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
 		smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
-		smb_fname->st.vfs_private = attrs.winAttrs;
 	}
 	return 0;
 }
@@ -1512,7 +1511,6 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
 		smb_fname->st.st_ex_calculated_birthtime = false;
 		smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
 		smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
-		smb_fname->st.vfs_private = attrs.winAttrs;
 	}
 	return 0;
 }
@@ -1636,6 +1634,7 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
 	char *path = NULL;
 	NTSTATUS status;
 	struct gpfs_config_data *config;
+	int ret;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct gpfs_config_data,
@@ -1651,17 +1650,12 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
 		return -1;
 	}
 
-	if (VALID_STAT(*sbuf)) {
-		attrs.winAttrs = sbuf->vfs_private;
-	} else {
-		int ret;
-		ret = get_gpfs_winattrs(path, &attrs);
-
-		if (ret == -1) {
-			TALLOC_FREE(path);
-			return false;
-		}
+	ret = get_gpfs_winattrs(path, &attrs);
+	if (ret == -1) {
+		TALLOC_FREE(path);
+		return false;
 	}
+
 	if ((attrs.winAttrs & GPFS_WINATTR_OFFLINE) != 0) {
 		DEBUG(10, ("%s is offline\n", path));
 		TALLOC_FREE(path);
@@ -1682,7 +1676,8 @@ static ssize_t vfs_gpfs_sendfile(vfs_handle_struct *handle, int tofd,
 				 files_struct *fsp, const DATA_BLOB *hdr,
 				 off_t offset, size_t n)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list