[SCM] Samba Shared Repository - branch v4-9-stable updated

Karolin Seeger kseeger at samba.org
Wed May 1 06:01:03 UTC 2019


The branch, v4-9-stable has been updated
       via  c8e9b9fe7cc VERSION: Disable GIT_SNAPSHOT for the 4.9.7 release.
       via  b9fac394ab0 WHATSNEW: Add release notes for Samba 4.9.7.
       via  16462634503 s3/vfs_glusterfs: Dynamically determine NAME_MAX
       via  f6907809a8e s3/vfs_glusterfs_fuse: Dynamically determine NAME_MAX
       via  571f7034fcc docs/vfs_ceph: describe new ACL behaviour
       via  c5089041e62 vfs_ceph: explicitly enable libcephfs POSIX ACL support
       via  7abc1442500 smb2_server: grant all 8192 credits to clients
       via  74001095d25 vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check
       via  a50c4d7a891 vfs_default: fix DEBUG messages in vfswrap_offload_write_*_done()
       via  dedeaf370eb vfs_snapper: drop unneeded fstat handler
       via  c8bdbc39955 smb2_tcon: avoid STATUS_PENDING completely on tdis
       via  d8d3e6895ae smb2_sesssetup: avoid STATUS_PENDING completely on session logoff
       via  6122f423d8d smb2_tcon: avoid STATUS_PENDING responses for tree connect
       via  dc06b1b364d smb2_sesssetup: avoid STATUS_PENDING responses for session setup
       via  8d6361b63bb smb2_server: allow smbd_smb2_request_pending_queue(0) to avoid STATUS_PENDING
       via  7aa443a3cf3 s3:smbd: handle IO_REPARSE_TAG_DFS in SMB_FIND_FILE_FULL_DIRECTORY_INFO
       via  945a41d3841 ctdb-common: Avoid race between fd and signal events
       via  d9c47cb86e0 ctdb-daemon: Revert "We can not assume that just because we could complete a TCP handshake"
       via  e974e44014b torture: Add test for talloc size accounting in memcache
       via  e09262b7a0f memcache: Increase size of default memcache to 512k
       via  a54038bf5f8 memcache: Properly track the size of talloc objects
       via  116c874f1ff memcache: Introduce struct for storing talloc pointer
       via  49fa08814e2 ctdb-scripts: Update statd-callout to try several configuration files
       via  dae0e8ec961 ctdb-scripts: Allow load_system_config() to take multiple alternatives
       via  14069988a97 ctdb-tests: Update NFS test infrastructure to support systemd services
       via  aee71ea6863 ctdb-scripts: Add systemd services to NFS call-out
       via  7932032de40 ctdb-scripts: Start NFS quota service if defined
       via  5a97b7f00ab ctdb-scripts: Stop/start mount/rquotad/status via NFS call-out
       via  f00827672cb ctdb-scripts: Factor out nfs_load_config()
       via  022b9a6ca7d ctdb-scripts: Add test variable CTDB_NFS_DISTRO_STYLE
       via  117586288be ctdb-scripts: Rename variable nfslock_service to nfs_lock_service
       via  d415458f6fc ctdb-scripts: Reindent some functions prior to making changes
       via  d78118d0af5 py/provision: fix for Python 2.6
       via  7f1811ee4ff s3-libnet_join: allow fallback to NTLMSSP auth in libnet_join
       via  d101da493ec s3-libnet_join: setup libnet join error string when AD connect fails
       via  4147349c963 s3-libnet_join: always pass down admin domain to ads layer
       via  e933ddb7744 s3:ldap: Leave add machine code early for pre-existing accounts
       via  55da00ced98 s3:libads: Make sure we can lookup KDCs which are not configured
       via  cf210317a6f s3:libnet: Use more secure name for the JOIN krb5.conf
       via  33ec6f827ef auth:creds: Prefer the principal over DOMAIN/username when using NTLM
       via  1a239fa0bdb auth:ntlmssp: Add back CRAP ndr debug output
       via  7dce8031959 s3:libnet: Fix debug message in libnet_DomainJoin()
       via  0acb2e42fcb s3:libsmb: Add some useful debug output to cliconnect
       via  be37e77bb31 s3:libads: Print more information when LDAP fails
       via  b1d1f5f5ac3 docs: Update smbclient manpage for --max-protocol
       via  d162726a2e7 VERSION: Bump version up to 4.9.7.
       via  8ee79597846 Merge tag 'samba-4.9.6' into v4-9-test
       via  d59cefc8c3b libcli: permit larger values of DataLength in SMB2_ENCRYPTION_CAPABILITIES of negotiate response
       via  9c52fdc1871 s3:lib: Fix the debug message for adding cache entries.
       via  5b7161153d0 s3:waf: Fix the detection of makdev() macro on Linux
       via  055b971a7b0 regfio tests: Update comment style to match README.Coding
       via  0cc3508242b regfio: Update code near recent changes to match README.Coding
       via  f3552ad511c regfio: Improve handling of malformed registry hive files
       via  b5ae06cc653 regfio: Add trivial unit test
       via  223352ee944 regfio: Use correct function names in debug information
       via  4644b23b91c Fix typos in "valid"
       via  87ffad41af1 py/kcc_utils: py2.6 compatibility
       via  d44f2157a72 py/graph: use 2.6 compatible check for set membership
       via  42b62465fcc dbcheck: use the str() value of the "name" attribute
       via  693c349874f dbcheck: don't check expired tombstone objects by default anymore
       via  3fca3dcc1c9 blackbox/dbcheck-links.sh: prepare regression test for skipping expired tombstones
       via  543fc3e9c04 blackbox/dbcheck*.sh: pass --selftest-check-expired-tombstones to dbcheck
       via  02f3d0a1a2c dbcheck: add --selftest-check-expired-tombstones cmdline option
       via  aebf46d957f python/samba/netcmd: provide SUPPRESS_HELP via Option class
       via  107883dff6c dbcheck: detect the change after deletion bug
       via  860b04aa7ae blackbox/dbcheck-links.sh: add regression test for lost deleted object repair
       via  45850169a9c dbcheck: add find_repl_attid() helper function
       via  7402d9cfcf7 dbcheck: don't remove dangling one-way links on already deleted objects
       via  07ebd654a01 dbcheck: don't move already deleted objects to LostAndFound
       via  76de43f052f dbcheck: do isDeleted, systemFlags and replPropertyMetaData detection first
       via  0aaf7c98bb7 dbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objects
       via  44c83b09c60 dsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename
       via  9339b096793 blackbox/dbcheck-links.sh: reproduce lost deleted object problem
       via  7bcb0729652 selftest: force running with TZ=UTC
       via  5602db1b1d5 python/samba: extra ndr_unpack needs bytes function
       via  139da67cb3b python/samba: PY3 port for ridalloc_exop test to work
       via  b861e5e91f5 s4:librpc: Fix installation of Samba
       via  5f94bc518cc ctdb-tests: Add some testing for IPv4-mapped IPv6 address parsing
       via  eb4e66cd0ff ctdb: Initialize addr struct to zero before reparsing as IPV4
       via  9e4b17aaaba ctdb-packaging: Test package requires tcpdump
       via  6e76e884f5e ctdb-packaging: ctdb package should not own system library directory
       via  7f4492c7f5b s3:client: Fix smbspool device uri handling
       via  e07b8444f53 s3:client: Make sure we work on a copy of the title
       via  590fd475878 s3:client: Evaluate the AUTH_INFO_REQUIRED variable set by cups
       via  d311eff5aa4 s3:client: Pass DEVICE_URI and AUTH_INFO_REQUIRED env to smbspool
       via  6c2d5bca41e s3:script: Fix jobid check in test_smbspool.sh
       via  166dd92d249 ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT()
       via  1e40887120d Send status to systemd on daemon start
       via  fc40f87ebbc lib:util: Move debug message for mkdir failing to log level 1
       via  aaefa8ea0bf WHATSNEW: mention new vfs_glusterfs_fuse module
       via  f232cd76d3d CI: don't use swap
       via  65c85aee4cb lib/winbind_util: Add winbind_xid_to_sid for --without-winbind
       via  7f74413a9b9 lib/winbind_util: Move include out of ifdef
       via  f506180c0b8 passdb: Update ABI to 0.27.2
       via  1f915119d5d passdb: Make [ug]id_to_sid use xid_to_sid
       via  f175abcc68d passdb: Introduce xid_to_sid
       via  522b85013ee lib: Add dom_sid_str_buf
       via  713c48eb9bd lib: Introduce winbind_xid_to_sid
       via  5bf41f42bb3 winbind: Use idmap_cache_find_xid2sid
       via  d74b8a1cba2 torture: Add tests for idmap cache
       via  71f7738ca4c idmap_cache: Introduce idmap_cache_find_xid2sid
       via  527ecdbe9c2 winbind: Now we explicitly track if we got ids from cache
       via  bdeacbabd20 winbind: Initialize "expired" parameter to idmap_cache_xid2sid
       via  d9b762a3d2d idmap_cache: Only touch "sid" on success in find_xid_to_sid
       via  00baebb8dc9 lib: Make idmap_cache return negative mappings
       via  3e6b84f8b43 VERSION: Bump version up to 4.9.6...
      from  dd7b68d11c0 VERSION: Disable GIT_SNAPSHOT for the 4.9.6 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-9-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .gitlab-ci.yml                                     |   7 +-
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       | 133 +++++++-
 auth/credentials/credentials.c                     |   2 +-
 auth/ntlmssp/ntlmssp_client.c                      |  32 ++
 ctdb/common/run_proc.c                             |   7 +
 ctdb/config/functions                              |  19 +-
 ctdb/config/nfs-checks.d/10.status.check           |   4 +-
 ctdb/config/nfs-checks.d/40.mountd.check           |   4 +-
 ctdb/config/nfs-checks.d/50.rquotad.check          |   4 +-
 ctdb/config/nfs-linux-kernel-callout               | 259 ++++++++++++----
 ctdb/config/statd-callout                          |   3 +-
 ctdb/packaging/RPM/ctdb.spec.in                    |   4 +-
 ctdb/protocol/protocol_util.c                      |   3 +
 ctdb/tcp/tcp_connect.c                             |   3 +
 ctdb/tests/eventscripts/scripts/60.nfs.sh          |  99 +++++-
 ctdb/tests/src/protocol_util_test.c                |  19 ++
 docs-xml/manpages/smbclient.1.xml                  |   6 +-
 docs-xml/manpages/vfs_ceph.8.xml                   |  11 +
 docs-xml/smbdotconf/filename/maxstatcachesize.xml  |   2 +-
 lib/param/loadparm.c                               |   2 +-
 lib/util/become_daemon.c                           |  18 +-
 lib/util/memcache.c                                |  54 +++-
 lib/util/util.c                                    |   6 +-
 libcli/security/dom_sid.c                          |  10 +
 libcli/security/dom_sid.h                          |   2 +
 libcli/smb/smbXcli_base.c                          |   2 +-
 librpc/ndr/ndr_spoolss_buf.c                       |   4 +-
 python/samba/dbchecker.py                          | 234 ++++++++++++--
 python/samba/graph.py                              |   2 +-
 python/samba/kcc/kcc_utils.py                      |   4 +-
 python/samba/netcmd/__init__.py                    |   1 +
 python/samba/netcmd/dbcheck.py                     |  15 +-
 python/samba/provision/__init__.py                 |   2 +-
 python/samba/remove_dc.py                          |   4 +-
 selftest/knownfail                                 |   3 -
 selftest/selftest.pl                               |   3 +
 selftest/tests.py                                  |   2 +
 source3/client/smbspool.c                          | 160 +++++++---
 source3/client/smbspool_krb5_wrapper.c             |  24 +-
 source3/lib/gencache.c                             |   8 +-
 source3/lib/idmap_cache.c                          |  48 ++-
 source3/lib/idmap_cache.h                          |   2 +
 source3/lib/winbind_util.c                         |  41 ++-
 source3/lib/winbind_util.h                         |   2 +
 source3/libads/kerberos.c                          |  12 +-
 source3/libads/ldap.c                              |  22 +-
 source3/libnet/libnet_join.c                       |  29 +-
 source3/libsmb/cliconnect.c                        |  13 +
 source3/modules/vfs_ceph.c                         |  11 +
 source3/modules/vfs_default.c                      |  47 ++-
 source3/modules/vfs_glusterfs.c                    |  37 ++-
 source3/modules/vfs_glusterfs_fuse.c               |  32 +-
 source3/modules/vfs_snapper.c                      |  19 --
 source3/param/loadparm.c                           |   2 +-
 ...passdb-0.27.1.sigs => samba-passdb-0.27.2.sigs} |   2 +
 source3/passdb/lookup_sid.c                        | 233 ++++----------
 source3/passdb/lookup_sid.h                        |   1 +
 source3/registry/regfio.c                          |  29 +-
 source3/registry/tests/test_regfio.c               | 184 +++++++++++
 source3/script/tests/test_smbspool.sh              |   4 +-
 source3/selftest/tests.py                          |   1 +
 source3/smbd/smb2_server.c                         |  19 +-
 source3/smbd/smb2_sesssetup.c                      |  17 +-
 source3/smbd/smb2_tcon.c                           |  12 +-
 source3/smbd/trans2.c                              |   6 +-
 source3/torture/proto.h                            |   1 +
 source3/torture/test_idmap_cache.c                 | 122 ++++++++
 source3/torture/torture.c                          |  73 ++++-
 source3/winbindd/wb_xids2sids.c                    |  33 +-
 source3/wscript                                    |   3 +
 source3/wscript_build                              |   9 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c    |   7 +
 source4/librpc/wscript_build                       |   8 -
 ...cted-dbcheck-link-output-lost-deleted-user1.txt |   9 +
 ...cted-dbcheck-link-output-lost-deleted-user2.txt |   8 +
 ...cted-dbcheck-link-output-lost-deleted-user3.txt |  19 ++
 testdata/samba3/regfio_corrupt_hbin1.dat           | Bin 0 -> 5120 bytes
 testdata/samba3/regfio_corrupt_lf_subkeys.dat      | Bin 0 -> 5120 bytes
 testprogs/blackbox/dbcheck-links.sh                | 342 ++++++++++++++++++++-
 testprogs/blackbox/dbcheck-oldrelease.sh           |  14 +-
 81 files changed, 2145 insertions(+), 511 deletions(-)
 copy source3/passdb/ABI/{samba-passdb-0.27.1.sigs => samba-passdb-0.27.2.sigs} (99%)
 create mode 100644 source3/registry/tests/test_regfio.c
 create mode 100644 source3/torture/test_idmap_cache.c
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user1.txt
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user2.txt
 create mode 100644 source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt
 create mode 100644 testdata/samba3/regfio_corrupt_hbin1.dat
 create mode 100644 testdata/samba3/regfio_corrupt_lf_subkeys.dat


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 42a425ea68d..03654fafe1f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,12 +7,7 @@ variables:
   GIT_DEPTH: "3"
 
 before_script:
-  - echo "Build starting (preparing swap)..."
-  - if [ $(df -m / --output=avail | tail -n1) -gt 10240 ]; then
-      sudo dd if=/dev/zero of=/samba-swap bs=1M count=6144;
-      sudo mkswap /samba-swap;
-      sudo swapon /samba-swap;
-    fi
+  - echo "Build starting..."
 
 after_script:
   - tar -xf logs.tar.gz system-info.txt -O
diff --git a/VERSION b/VERSION
index 3bc3da678e7..ba6fe8a24b9 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=9
-SAMBA_VERSION_RELEASE=6
+SAMBA_VERSION_RELEASE=7
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index f40b09c25be..d135527fa1b 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,119 @@
+                   =============================
+                   Release Notes for Samba 4.9.7
+                            May 1, 2019
+                   =============================
+
+
+This is the latest stable release of the Samba 4.9 release series.
+
+
+Changes since 4.9.6:
+--------------------
+
+o  Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
+   * BUG 13837: py/kcc_utils: py2.6 compatibility.
+   * BUG 13882: py/provision: Fix for Python 2.6.
+
+o  Andrew Bartlett <abartlet at samba.org>
+   * BUG 13840: regfio: Update code near recent changes to match README.Coding.
+
+o  G√ľnther Deschner <gd at samba.org>
+   * BUG 13861: 'net ads join' to child domain fails when using
+     "-U admin at forestroot".
+
+o  David Disseldorp <ddiss at samba.org>
+   * BUG 13858: vfs_snapper: Drop unneeded fstat handler.
+   * BUG 13896: vfs_ceph: Explicitly enable libcephfs POSIX ACL support.
+
+o  Philipp Gesang <philipp.gesang at intra2net.com>
+   * BUG 13869: libcli: Permit larger values of DataLength in
+     SMB2_ENCRYPTION_CAPABILITIES of negotiate response.
+
+o  Michael Hanselmann <public at hansmi.ch>
+   * BUG 13840: regfio: Improve handling of malformed registry hive files.
+
+o  Amitay Isaacs <amitay at samba.org>
+   * BUG 13895: ctdb-common: Avoid race between fd and signal events.
+
+o  Volker Lendecke <vl at samba.org>
+   * BUG 13813: Fix idmap cache pollution with S-1-22- IDs on winbind hickup.
+
+o  Marcos Mello <marcosfrm at gmail.com>
+   * BUG 11568: Send status to systemd on daemon start.
+
+o  Stefan Metzmacher <metze at samba.org>
+   * BUG 10097: s3:smbd: Handle IO_REPARSE_TAG_DFS in
+     SMB_FIND_FILE_FULL_DIRECTORY_INFO.
+   * BUG 10344: smb2_tcon: Avoid STATUS_PENDING completely on tdis.
+   * BUG 12844: smb2_tcon: Avoid STATUS_PENDING responses for tree connect.
+   * BUG 12845: smb2_sesssetup: Avoid STATUS_PENDING responses for session
+     setup.
+   * BUG 13698: smb2_tcon: Avoid STATUS_PENDING responses for tree connect.
+   * BUG 13796: smb2_sesssetup: Avoid STATUS_PENDING responses for session
+     setup.
+   * BUG 13816: dbcheck in the middle of the tombstone garbage collection causes
+     replication failures.
+   * BUG 13818: ndr_spoolss_buf: Fix out of scope use of stack variable in
+     NDR_SPOOLSS_PUSH_ENUM_OUT().
+   * BUG 13862: vfs_default: Fix vfswrap_offload_write_send()
+     NT_STATUS_INVALID_VIEW_SIZE check.
+   * BUG 13863: smb2_server: Grant all 8192 credits to clients.
+
+o  Noel Power <noel.power at suse.com>
+   * python/samba: extra ndr_unpack needs bytes function
+
+o  Anoop C S <anoopcs at redhat.com>
+   * BUG 13872: s3/vfs_glusterfs[_fuse]: Dynamically determine NAME_MAX.
+
+o  Christof Schmitt <cs at samba.org>
+   * passdb: Update ABI to 0.27.2.
+   * BUG 13813: lib/winbind_util: Add winbind_xid_to_sid for --without-winbind.
+   * BUG 13865: memcache: Increase size of default memcache to 512k.
+
+o  Andreas Schneider <asn at samba.org>
+   * BUG 13823: lib:util: Move debug message for mkdir failing to log level 1.
+   * BUG 13832: Printing via smbspool backend with Kerberos auth fails.
+   * BUG 13847: s4:librpc: Fix installation of Samba.
+   * BUG 13848: s3:lib: Fix the debug message for adding cache entries.
+   * BUG 13853: s3:waf: Fix the detection of makdev() macro on Linux.
+   * BUG 13857: docs: Update smbclient manpage for --max-protocol.
+   * BUG 13861: 'net ads join' to child domain fails when using
+     "-U admin at forestroot".
+
+o  Zhu Shangzhong <zhu.shangzhong at zte.com.cn>
+   * BUG 13839: ctdb: Initialize addr struct to zero before reparsing as IPV4.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 13838: ctdb package should not own system library directory.
+   * BUG 13860: CTDB restarts failed NFS RPC services by hand, which is
+     incompatible with systemd.
+   * BUG 13888: ctdb-daemon: Revert "We can not assume that just because we
+     could complete a TCP handshake".
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    =============================
                    Release Notes for Samba 4.9.6
                            April 8, 2019
@@ -57,8 +173,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    =============================
                    Release Notes for Samba 4.9.5
@@ -1048,6 +1164,19 @@ The 'samba_gpoupdate' command (used in applying Group Policies to the
 Samba machine itself) has been renamed to "samba_gpupdate" and had the
 syntax changed to better match the same tool on Windows.
 
+New glusterfs_fuse VFS module
+-----------------------------
+
+The new vfs_glusterfs_fuse module improves performance when Samba
+accesses a glusterfs volume mounted via FUSE (Filesystem in Userspace
+as part of the Linux kernel). It achieves that by leveraging a
+mechanism to retrieve the appropriate case of filenames by querying a
+specific extended attribute in the filesystem. No extra configuration
+is required to use this module, only glusterfs_fuse needs to be set in
+the "vfs objects" parameter. Further details can be found in the
+vfs_glusterfs_fuse(8) manpage. This new vfs_glusterfs_fuse module does
+not replace the existing vfs_glusterfs module, it just provides an
+additional, alternative mechanism to access a Gluster volume.
 
 REMOVED FEATURES
 ================
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 4663185c979..7ef58d0752c 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -1115,7 +1115,7 @@ _PUBLIC_ void cli_credentials_get_ntlm_username_domain(struct cli_credentials *c
 					      const char **username, 
 					      const char **domain) 
 {
-	if (cred->principal_obtained > cred->username_obtained) {
+	if (cred->principal_obtained >= cred->username_obtained) {
 		*domain = talloc_strdup(mem_ctx, "");
 		*username = cli_credentials_get_principal(cred, mem_ctx);
 	} else {
diff --git a/auth/ntlmssp/ntlmssp_client.c b/auth/ntlmssp/ntlmssp_client.c
index ab406a2c5be..8e49dcee5ea 100644
--- a/auth/ntlmssp/ntlmssp_client.c
+++ b/auth/ntlmssp/ntlmssp_client.c
@@ -342,6 +342,22 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
 		}
 	}
 
+	if (DEBUGLEVEL >= 10) {
+		struct CHALLENGE_MESSAGE *challenge =
+			talloc(ntlmssp_state, struct CHALLENGE_MESSAGE);
+		if (challenge != NULL) {
+			NTSTATUS status;
+			challenge->NegotiateFlags = chal_flags;
+			status = ntlmssp_pull_CHALLENGE_MESSAGE(
+					&in, challenge, challenge);
+			if (NT_STATUS_IS_OK(status)) {
+				NDR_PRINT_DEBUG(CHALLENGE_MESSAGE,
+						challenge);
+			}
+			TALLOC_FREE(challenge);
+		}
+	}
+
 	if (chal_flags & NTLMSSP_TARGET_TYPE_SERVER) {
 		ntlmssp_state->server.is_standalone = true;
 	} else {
@@ -702,6 +718,22 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
 		return nt_status;
 	}
 
+	if (DEBUGLEVEL >= 10) {
+		struct AUTHENTICATE_MESSAGE *authenticate =
+			talloc(ntlmssp_state, struct AUTHENTICATE_MESSAGE);
+		if (authenticate != NULL) {
+			NTSTATUS status;
+			authenticate->NegotiateFlags = ntlmssp_state->neg_flags;
+			status = ntlmssp_pull_AUTHENTICATE_MESSAGE(
+				out, authenticate, authenticate);
+			if (NT_STATUS_IS_OK(status)) {
+				NDR_PRINT_DEBUG(AUTHENTICATE_MESSAGE,
+						authenticate);
+			}
+			TALLOC_FREE(authenticate);
+		}
+	}
+
 	/*
 	 * We always include the MIC, even without:
 	 * av_flags->Value.AvFlags |= NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE;
diff --git a/ctdb/common/run_proc.c b/ctdb/common/run_proc.c
index 97895b383b9..037b6d9651d 100644
--- a/ctdb/common/run_proc.c
+++ b/ctdb/common/run_proc.c
@@ -295,6 +295,13 @@ again:
 		proc->result.sig = WTERMSIG(status);
 	}
 
+	/* Confirm that all data has been read from the pipe */
+	if (proc->fd != -1) {
+		proc_read_handler(ev, proc->fde, 0, proc);
+		TALLOC_FREE(proc->fde);
+		proc->fd = -1;
+	}
+
 	/* Active run_proc request */
 	if (proc->req != NULL) {
 		run_proc_done(proc->req);
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 7a47c9d8e79..1dc16532890 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -33,15 +33,16 @@ fi
 
 load_system_config ()
 {
-	if [ -z "$1" ] ; then
-		return
-	fi
-
-	if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/$1" ]; then
-		. "${CTDB_SYS_ETCDIR}/sysconfig/$1"
-	elif [ -f "${CTDB_SYS_ETCDIR}/default/$1" ]; then
-		. "${CTDB_SYS_ETCDIR}/default/$1"
-	fi
+	for _i ; do
+
+		if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/${_i}" ]; then
+			. "${CTDB_SYS_ETCDIR}/sysconfig/${_i}"
+			return
+		elif [ -f "${CTDB_SYS_ETCDIR}/default/${_i}" ]; then
+			. "${CTDB_SYS_ETCDIR}/default/${_i}"
+			return
+		fi
+	done
 }
 
 # load_script_options [ component script ]
diff --git a/ctdb/config/nfs-checks.d/10.status.check b/ctdb/config/nfs-checks.d/10.status.check
index dfa5c59117e..b8ce1e0ad0b 100644
--- a/ctdb/config/nfs-checks.d/10.status.check
+++ b/ctdb/config/nfs-checks.d/10.status.check
@@ -2,6 +2,6 @@
 version="1"
 restart_every=2
 unhealthy_after=6
-service_stop_cmd="killall -q -9 rpc.statd"
-service_start_cmd="rpc.statd ${STATD_HA_CALLOUT:+-H} $STATD_HA_CALLOUT ${STATD_HOSTNAME:+-n} $STATD_HOSTNAME ${STATD_PORT:+-p} $STATD_PORT ${STATD_OUTGOING_PORT:+-o} $STATD_OUTGOING_PORT"
+service_stop_cmd="$CTDB_NFS_CALLOUT stop status"
+service_start_cmd="$CTDB_NFS_CALLOUT start status"
 service_debug_cmd="program_stack_traces rpc.statd 5"
diff --git a/ctdb/config/nfs-checks.d/40.mountd.check b/ctdb/config/nfs-checks.d/40.mountd.check
index 56b3fd29512..bfe4c277ce9 100644
--- a/ctdb/config/nfs-checks.d/40.mountd.check
+++ b/ctdb/config/nfs-checks.d/40.mountd.check
@@ -2,6 +2,6 @@
 version="1"
 restart_every=2
 unhealthy_after=6
-service_stop_cmd="killall -q -9 rpc.mountd"
-service_start_cmd="rpc.mountd $RPCMOUNTDOPTS ${MOUNTD_PORT:+-p} $MOUNTD_PORT"
+service_stop_cmd="$CTDB_NFS_CALLOUT stop mountd"
+service_start_cmd="$CTDB_NFS_CALLOUT start mountd"
 service_debug_cmd="program_stack_traces rpc.mountd 5"
diff --git a/ctdb/config/nfs-checks.d/50.rquotad.check b/ctdb/config/nfs-checks.d/50.rquotad.check
index b7bd9d2c757..98bd8d98fce 100644
--- a/ctdb/config/nfs-checks.d/50.rquotad.check
+++ b/ctdb/config/nfs-checks.d/50.rquotad.check
@@ -2,6 +2,6 @@
 version="1"
 restart_every=2
 unhealthy_after=6
-service_stop_cmd="killall -q -9 rpc.rquotad"
-service_start_cmd="rpc.rquotad ${RQUOTAD_PORT:+-p} $RQUOTAD_PORT"
+service_stop_cmd="$CTDB_NFS_CALLOUT stop rquotad"
+service_start_cmd="$CTDB_NFS_CALLOUT start rquotad"
 service_debug_cmd="program_stack_traces rpc.rquotad 5"
diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout
index 9b72446b44e..3d1dc63c590 100755
--- a/ctdb/config/nfs-linux-kernel-callout
+++ b/ctdb/config/nfs-linux-kernel-callout
@@ -12,20 +12,66 @@ set -e
 # hook for testing.
 nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/var/lib/nfs/etab}"
 
-# Red Hat
-nfs_service="nfs"
-nfslock_service="nfslock"
-nfs_config="/etc/sysconfig/nfs"
+# As above, edit the default value below.  CTDB_NFS_DISTRO_STYLE is a
+# test variable only.
+nfs_distro_style="${CTDB_NFS_DISTRO_STYLE:-sysvinit-redhat}"
+
+case "$nfs_distro_style" in
+systemd-*)
+	# Defaults
+	nfs_service="nfs-server"
+	nfs_lock_service="rpc-statd"
+	nfs_mountd_service="nfs-mountd"
+	nfs_status_service="rpc-statd"
+	nfs_rquotad_service="rpc-rquotad"
+	nfs_config="/etc/sysconfig/nfs"
+	nfs_rquotad_config="" # Not use with systemd, restart via service
+
+	case "$nfs_distro_style" in
+	*-redhat|*-suse)
+		: # Defaults only
+		;;
+	*-debian)
+		nfs_rquotad_service="quotarpc"
+		;;
+	*)
+		echo "Internal error"
+		exit 1
+	esac
+	;;
 
-# SUSE
-#nfs_service="nfsserver"
-#nfslock_service=""
-#nfs_config="/etc/sysconfig/nfs"
+sysvinit-*)
+	# Defaults
+	nfs_service="nfs"
+	nfs_lock_service=""
+	nfs_mountd_service=""
+	nfs_status_service=""
+	nfs_rquotad_service=""
+	nfs_config="/etc/sysconfig/nfs"
+	nfs_rquotad_config="$nfs_config"
+
+	case "$nfs_distro_style" in
+	*-redhat)
+		nfs_lock_service="nfslock"
+		;;
+	*-suse)
+		nfs_service="nfsserver"
+		;;
+	*-debian)
+		nfs_service="nfs-kernel-server"
+		nfs_config="/etc/default/nfs-kernel-server"
+		nfs_rquotad_config="/etc/default/quota"
+		;;
+	*)
+		echo "Internal error"
+		exit 1
+	esac
+	;;
 
-# Debian
-#nfs_service="nfs-kernel-server"
-#nfslock_service=""
-#nfs_config="/etc/default/nfs-kernel-server"
+*)
+	echo "Internal error"
+	exit 1
+esac
 
 # Override for unit testing
 if [ -z "$PROCFS_PATH" ] ; then
@@ -46,50 +92,70 @@ EOF
     exit 1
 }
 
+##################################################
+
+nfs_load_config ()
+{
+	_config="${1:-${nfs_config}}"
+
+	if [ -r "$_config" ] ; then
+		. "$_config"
+	fi
+}
 
 ##################################################
 # Basic service stop and start
 
 basic_stop ()
 {
-    case "$1" in
+	case "$1" in
 	nfs)
-	    service "$nfs_service" stop
-	    if [ -n "$nfslock_service" ] ; then
-		service "$nfslock_service" stop
-	    fi
-	    ;;
-	nfslock)
-	    if [ -n "$nfslock_service" ] ; then
-		service "$nfslock_service" stop
-	    else
+		if [ -n "$nfs_rquotad_service" ] ; then
+			service "$nfs_rquotad_service" stop
+		fi
+
 		service "$nfs_service" stop
-	    fi
-	    ;;
+
+		if [ -n "$nfs_lock_service" ] ; then
+			service "$nfs_lock_service" stop
+		fi
+		;;
+	nfslock)
+		if [ -n "$nfs_lock_service" ] ; then
+			service "$nfs_lock_service" stop
+		else
+			service "$nfs_service" stop
+		fi
+		;;
 	*)
-	    usage
-    esac
+		usage
+	esac
 }
 
 basic_start ()
 {
-    case "$1" in
+	case "$1" in
 	nfs)
-	    if [ -n "$nfslock_service" ] ; then
-		service "$nfslock_service" start
-	    fi
-	    service "$nfs_service" start
-	    ;;
-	nfslock)
-	    if [ -n "$nfslock_service" ] ; then
-		service "$nfslock_service" start
-	    else
+		if [ -n "$nfs_lock_service" ] ; then
+			service "$nfs_lock_service" start
+		fi
+
 		service "$nfs_service" start
-	    fi
-	    ;;
+
+		if [ -n "$nfs_rquotad_service" ] ; then


-- 
Samba Shared Repository



More information about the samba-cvs mailing list