[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Jul 28 11:50:01 UTC 2023


The branch, master has been updated
       via  7319c7596ea ldb: change the version to 2.9.0 for Samba 4.20
       via  1771ee694f4 WHATSNEW: Start release notes for Samba 4.20.0pre1.
       via  c403201af33 VERSION: Bump version up to 4.20.0pre1...
       via  4f12024cafa VERSION: Disable GIT_SNAPSHOT for the Samba 4.19.0rc1 release.
       via  6943c1e3cde WHATSNEW: Up to Samba 4.19.0rc1.
       via  94f11c3c21b ldb: release 2.8.0 for use in Samba 4.19.x
       via  7920d2ff627 ctdb-tools: Improve printing of multi-line event script output
       via  e3c0b72c340 ctdb-tools: Always print script output in event status
       via  e36a4149d80 librpc/idl: Remove DCOM and WMI IDL
       via  abc3d58e1cc dcom: Remove remainder of DCOM test client code
       via  959dc9068d1 librpc:crypto: SAFE_FREE() -> krb5_free_enctypes()
       via  05056775eae librpc:crypto: SAFE_FREE() -> krb5_free_string()
       via  ec121eb831d auth:credentials: SAFE_FREE() -> krb5_free_string()
       via  cd60e3fdef4 auth:credentials: SAFE_FREE() -> krb5_free_enctypes()
       via  c5778a0fbdd krb5_wrap: add krb5_free_string()
       via  75139445c20 krb5_wrap: add krb5_free_enctypes()
       via  9338d1b17c4 smbd: move tevent_req_post() out of smbd_smb2_create_after_exec()
      from  20df26b9081 s3: smbd: Sanitize any "server" and "share" components of SMB1 DFS paths to remove UNIX separators.

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


- Log -----------------------------------------------------------------
commit 7319c7596ea93b06c0c8e7b0926ebdbf08851d11
Author: Jule Anger <janger at samba.org>
Date:   Tue Jul 25 15:56:59 2023 +0200

    ldb: change the version to 2.9.0 for Samba 4.20
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Jul 28 11:49:02 UTC 2023 on atb-devel-224

commit 1771ee694f47db03d24712e75ded55244ffe2418
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 28 11:52:19 2023 +0200

    WHATSNEW: Start release notes for Samba 4.20.0pre1.
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c403201af33bc7b5510e2249e1c395a869ed3949
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 28 11:53:50 2023 +0200

    VERSION: Bump version up to 4.20.0pre1...
    
    and re-enable GIT_SNAPSHOT.
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 4f12024cafa0aa50325b390418407419a46423ac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 28 11:49:28 2023 +0200

    VERSION: Disable GIT_SNAPSHOT for the Samba 4.19.0rc1 release.
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 6943c1e3cde5359f5c2ebdf90e8985bf97a40ea5
Author: Jule Anger <janger at samba.org>
Date:   Tue Jul 25 15:59:19 2023 +0200

    WHATSNEW: Up to Samba 4.19.0rc1.
    
    Signed-off-by: Jule Anger <janger at samba.org>

commit 94f11c3c21bc3b8a34d376ab99becd2c6260af62
Author: Jule Anger <janger at samba.org>
Date:   Tue Jul 18 10:48:57 2023 +0200

    ldb: release 2.8.0 for use in Samba 4.19.x
    
    * CVE-2023-0614 Not-secret but access controlled LDAP attributes can be discovered (bug 15270)
    * pyldb: Raise an exception if ldb_dn_get_parent() fails
    * Implement ldap_whoami in pyldb and add the RFC4532 LDB_EXTENDED_WHOAMI_OID definition
    * Documentation and spelling fixes
    * Add ldb_val -> bool,uint64,int64 parsing functions
    * Split out ldb_val_as_dn() helper function
    * add LDB_CHANGETYPE_MODRDN support to ldb_ldif_to_pyobject()
    * add LDB_CHANGETYPE_DELETE support to ldb_ldif_to_pyobject()
    * let ldb_ldif_parse_modrdn() handle names without 'rdn_name=' prefix
    * Don't create error string if there is no error
    * Avoid allocation and memcpy() for every wildcard match candidate
    * Make ldb_msg_remove_attr O(n)
    * pyldb: Throw error on invalid controls
    * pyldb: remove py2 ifdefs
    * Call tevent_set_max_debug_level(TEVENT_DEBUG_TRACE)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15270
    
    Signed-off-by: Jule Anger <janger at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 7920d2ff627c6ef252e59b428236919ed0abb6ba
Author: Martin Schwenke <mschwenke at ddn.com>
Date:   Wed Jul 12 10:39:06 2023 +1000

    ctdb-tools: Improve printing of multi-line event script output
    
    Multi-line output currently prints like this:
    
      OUTPUT: aaa
    bbb
    ccc
    
    This is less beautiful than it could be.
    
    Instead, print multi-line output with no inlining and each line
    indented:
    
      OUTPUT:
        aaa
        bbb
        ccc
    
    However, continue to inline single line output:
    
      OUTPUT: foo
    
    Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e3c0b72c340f86b1d6e4fd009d1082c7e477fd04
Author: Martin Schwenke <mschwenke at ddn.com>
Date:   Wed Jul 12 10:39:06 2023 +1000

    ctdb-tools: Always print script output in event status
    
    When event scripts succeed they generally produce no output.  However,
    when a script succeeds and produces output, such output almost
    certainly contains warnings.  So, always print script output.
    
    Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e36a4149d80f08f84e1c4c5e35ca54937151927c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jul 27 08:06:48 2023 +1200

    librpc/idl: Remove DCOM and WMI IDL
    
    As hinted in f2416493c0c779356606aebf0aceca8fa416b55c the DCOM and WMI
    IDL is now unused.  These generate code with PIDL, costing a small
    amount of build time but more importantly are fuzzed, which costs an
    ongoing amount of CPU time as oss-fuzz tries to find parsing issues.
    
    We do not need to continue this waste, and these can be restored
    if this effort is ever to start again.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit abc3d58e1cc1a8f30ae461b7deb558dd0473ccb9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jul 27 08:17:07 2023 +1200

    dcom: Remove remainder of DCOM test client code
    
    This follows f2416493c0c779356606aebf0aceca8fa416b55c, removing the remaining parts
    of our DCOM effort.  This can be resumed at a later time, but for now this is untested
    (as we have no server) and just uses build time.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 959dc9068d126bd10684654bbe38b3377987fe94
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 16:30:00 2023 +0200

    librpc:crypto: SAFE_FREE() -> krb5_free_enctypes()
    
    Reported by Red Hat internal covscan
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 05056775eaee1a7d739f1239c7f41a24e56fd567
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 16:29:19 2023 +0200

    librpc:crypto: SAFE_FREE() -> krb5_free_string()
    
    Reported by Red Hat internal covscan
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit ec121eb831d5a8fdd7dab112ac60f1a4bce7a4a7
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 16:28:48 2023 +0200

    auth:credentials: SAFE_FREE() -> krb5_free_string()
    
    Reported by Red Hat internal covscan
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit cd60e3fdef43857c5e8c79fdffa096f40fa018c8
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 16:26:57 2023 +0200

    auth:credentials: SAFE_FREE() -> krb5_free_enctypes()
    
    Reported by Red Hat internal covscan
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit c5778a0fbdd549844a9acbf7c1af5e79ab973694
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 22:01:00 2023 +0200

    krb5_wrap: add krb5_free_string()
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 75139445c2021d5d7a4b3cc0d080d8cfcc9e9bb1
Author: Pavel Filipenský <pfilipensky at samba.org>
Date:   Thu Jul 27 16:22:22 2023 +0200

    krb5_wrap: add krb5_free_enctypes()
    
    MIT Kerberos implements krb5_free_enctypes(), Heimdal is missing it and
    offers krb5_xfree() instead.
    This introduces a wrapper krb5_free_enctypes() around krb5_xfree() for
    Heimdal.
    
    Signed-off-by: Pavel Filipenský <pfilipensky at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 9338d1b17c4803f3d1036709b15aaeba84a9ab56
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Jul 28 11:16:04 2023 +0200

    smbd: move tevent_req_post() out of smbd_smb2_create_after_exec()
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       | 212 +-----
 auth/credentials/credentials_krb5.c                |   3 +-
 auth/credentials/pycredentials.c                   |   2 +-
 ctdb/event/event_tool.c                            |  61 +-
 .../etc-ctdb/events/random/02.enabled.script       |  29 +
 ctdb/tests/UNIT/eventd/eventd_008.sh               |  54 ++
 lib/fuzzing/wscript_build                          |  29 -
 lib/krb5_wrap/krb5_samba.c                         |  14 +-
 lib/krb5_wrap/krb5_samba.h                         |   8 +
 lib/ldb/ABI/{ldb-2.8.0.sigs => ldb-2.9.0.sigs}     |   0
 ...pyldb-util-2.1.0.sigs => pyldb-util-2.9.0.sigs} |   0
 lib/ldb/wscript                                    |   4 +-
 librpc/idl/wmi.idl                                 | 715 ---------------------
 librpc/idl/wscript_build                           |  18 -
 librpc/ndr/ndr_wmi.c                               |  60 --
 librpc/wscript_build                               |  32 +-
 python/samba/tests/blackbox/ndrdump.py             |  59 --
 selftest/skip                                      |   2 -
 source3/librpc/crypto/gse.c                        |   2 +-
 source3/librpc/crypto/gse_krb5.c                   |   2 +-
 source3/smbd/smb2_create.c                         |   7 +-
 source4/librpc/wscript_build                       |   4 -
 source4/torture/rpc/oxidresolve.c                  | 263 --------
 source4/torture/rpc/remact.c                       | 104 ---
 source4/torture/rpc/rpc.c                          |   2 -
 source4/torture/wscript_build                      |   5 -
 wscript_configure_system_mitkrb5                   |   2 +
 28 files changed, 179 insertions(+), 1516 deletions(-)
 copy lib/ldb/ABI/{ldb-2.8.0.sigs => ldb-2.9.0.sigs} (100%)
 copy lib/ldb/ABI/{pyldb-util-2.1.0.sigs => pyldb-util-2.9.0.sigs} (100%)
 delete mode 100644 librpc/idl/wmi.idl
 delete mode 100644 librpc/ndr/ndr_wmi.c
 delete mode 100644 source4/torture/rpc/oxidresolve.c
 delete mode 100644 source4/torture/rpc/remact.c


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 667a209b999..f0170b01ce1 100644
--- a/VERSION
+++ b/VERSION
@@ -24,7 +24,7 @@
 #  ->  "3.0.0"                                         #
 ########################################################
 SAMBA_VERSION_MAJOR=4
-SAMBA_VERSION_MINOR=19
+SAMBA_VERSION_MINOR=20
 SAMBA_VERSION_RELEASE=0
 
 ########################################################
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 4619a5009c4..9c8192295e2 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,12 +1,12 @@
 Release Announcements
 =====================
 
-This is the first pre release of Samba 4.19.  This is *not*
+This is the first pre release of Samba 4.20.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
 
-Samba 4.19 will be the next version of the Samba suite.
+Samba 4.20 will be the next version of the Samba suite.
 
 
 UPGRADING
@@ -16,210 +16,6 @@ UPGRADING
 NEW FEATURES/CHANGES
 ====================
 
-Migrated smbget to use common command line parser
--------------------------------------------------
-
-The smbget utility implemented its own command line parsing logic. After
-discovering an issue we decided to migrate it to use the common command line
-parser. This has some advantages as you get all the feature it provides like
-Kerberos authentication. The downside is that breaks the options interface.
-The support for smbgetrc has been removed. You can use an authentication file
-if needed, this is documented in the manpage.
-
-Please check the smbget manpage or --help output.
-
-gpupdate changes
-----------------
-
-The libgpo.get_gpo_list function has been deprecated in favor of
-an implementation written in python. The new function can be imported via
-`import samba.gp`. The python implementation connects to Active Directory
-using the SamDB module, instead of ADS (which is what libgpo uses).
-
-Improved winbind logging and a new tool for parsing the winbind logs
---------------------------------------------------------------------
-
-Winbind logs (if smb.conf 'winbind debug traceid = yes' is set) contain new
-trace header fields 'traceid' and 'depth'.  Field 'traceid' allows to track the
-trace records belonging to the same request.  Field 'depth' allows to track the
-request nesting level. A new tool samba-log-parser is added for better log
-parsing.
-
-AD database prepared to FL 2016 standards for new domains
----------------------------------------------------------
-
-While Samba still provides only Functional Level 2008R2 by default,
-Samba as an AD DC will now, in provision ensure that the blank
-database is already prepared for Functional Level 2016, with AD Schema
-2019.
-
-This preparation is of the default objects in the database, adding
-containers for Authentication Policies, Authentication Silos and AD
-claims in particular.  These DB objects must be updated to allow
-operation of the new features found in higher functional levels.
-
-Kerberos Claims, Authentication Silos and NTLM authentication policies
-----------------------------------------------------------------------
-
-An initial, partial implementation of Active Directory Functional
-Level 2012, 2012R2 and 2016 is available in this release.
-
-In particular Samba will issue Active Directory "Claims" in the PAC,
-for member servers that support these, and honour in-directory
-configuration for Authentication Policies and Authentication Silos.
-
-The primary limitation is that while Samba can read and write claims
-in the directory, and populate the PAC, Samba does not yet use them
-for access control decisions.
-
-While we continue to develop these features, existing domains can
-test the feature by selecting the functional level in provision or
-raising the DC functional level by setting
-
- ad dc functional level = 2016
-
-in the smb.conf
-
-The smb.conf file on each DC must have 'ad dc functional level = 2016'
-set to have the partially complete feature available.  This will also,
-at first startup, update the server's own AD entry with the configured
-functional level.
-
-For new domains, add these parameters to 'samba-tool provision'
-
---option="ad dc functional level = 2016" --function-level=2016
-
-The second option, setting the overall domain functional level
-indicates that all DCs should be at this functional level.
-
-To raise the domain functional level of an existing domain, after
-updating the smb.conf and restarting Samba run
-samba-tool domain schemaupgrade --schema=2019
-samba-tool domain functionalprep --function-level=2016
-samba-tool domain level raise --domain-level=2016 --forest-level=2016
-
-Improved KDC Auditing
----------------------
-
-As part of the auditing required to allow successful deployment of
-Authentication Policies and Authentication Silos, our KDC now provides
-Samba-style JSON audit logging of all issued Kerberos tickets,
-including if they would fail a policy that is not yet enforced.
-Additionally most failures are audited, (after the initial
-pre-validation of the request).
-
-Kerberos Armoring (FAST) Support for Windows clients
-----------------------------------------------------
-
-In domains where the domain controller functional level is set, as
-above, to 2012, 2012_R2 or 2016, Windows clients will, if configured
-via GPO, use FAST to protect user passwords between (in particular) a
-workstation and the KDC on the AD DC.  This is a significant security
-improvement, as weak passwords in an AS-REQ are no longer available
-for offline attack.
-
-Claims compression in the AD PAC
---------------------------------
-
-Samba as an AD DC will compress "AD claims" using the same compression
-algorithm as Microsoft Windows.
-
-Resource SID compression in the AD PAC
---------------------------------------
-
-Samba as an AD DC will now correctly populate the various PAC group
-membership buffers, splitting global and local groups correctly.
-
-Additionally, Samba marshals Resource SIDs, being local groups in the
-member server's own domain, to only consume a header and 4 bytes per
-group in the PAC, not a full-length SID worth of space each.  This is
-known as "Resource SID compression".
-
-New samba-tool support for silos, claims, sites and subnets.
-------------------------------------------------------------
-
-samba-tool can now list, show, add and manipulate Authentication Silos
-(silos) and Active Directory Authentication Claims (claims).
-
-samba-tool can now list and show Active Directory sites and subnets.
-
-A new Object Relational Model (ORM) based architecture, similar to
-that used with Django, has been built to make adding new samba-tool
-subcommands simpler and more consistent, with JSON output available
-standard on these new commands.
-
-Updated GnuTLS requirement / in-tree cryptography removal
-----------------------------------------------------------
-
-Samba requires GnuTLS 3.6.13 and prefers GnuTLS 3.6.14 or later.
-
-This has allowed Samba to remove all of our in-tree cryptography,
-except that found in our Heimdal import.  Samba's runtime cryptography
-needs are now all provided by GnuTLS.
-
-(The GnuTLS vesion requirement is raised to 3.7.2 on systems without
-the Linux getrandom())
-
-We also use Python's cryptography module for our testing.
-
-The use of well known cryptography libraries makes Samba easier for
-end-users to validate and deploy, and for distributors to ship.  This
-is the end of a very long journey for Samba.
-
-Updated Heimdal import
-----------------------
-
-Samba's Heimdal branch (known as lorikeet-heimdal) has been updated to
-the current pre-8.0 (master) tree from upstream Heimdal, ensuring that
-this vendored copy, included in our release remains as close as
-possible to the current upstream code.
-
-Revocation support in Heimdal KDC for PKINIT certificates
----------------------------------------------------------
-
-Samba will now correctly honour the revocation of 'smart card'
-certificates used for PKINIT Kerberos authentication.
-
-This list is reloaded each time the file changes, so no further action
-other than replacing the file is required.  The additional krb5.conf
-option is:
-
- [kdc]
-	pkinit_revoke = FILE:/path/to/crl.pem
-
-Information on the "Smart Card login" feature as a whole is at:
- https://wiki.samba.org/index.php/Samba_AD_Smart_Card_Login
-
-Protocol level testsuite for (Smart Card Logon) PKINIT
-------------------------------------------------------
-
-Previously Samba's PKINIT support in the KDC was tested by use of
-shell scripts around the client tools of MIT or Heimdal Kerberos.
-Samba's independently written python testsuite has been extended to
-validate KDC behaviour for PKINIT.
-
-Require encrypted connection to modify unicodePwd on the AD DC
---------------------------------------------------------------
-
-Setting the password on an AD account on should never be attempted
-over a plaintext or signed-only LDAP connection.  If the unicodePwd
-(or userPassword) attribute is modified without encryption (as seen by
-Samba), the request will be rejected.  This is to encourage the
-administrator to use an encrypted connection in the future.
-
-NOTE WELL: If Samba is accessed via a TLS frontend or load balancer,
-the LDAP request will be regarded as plaintext.
-
-Samba AD TLS Certificates can be reloaded
------------------------------------------
-
-The TLS certificates used for Samba's AD DC LDAP server were
-previously only read on startup, and this meant that when then expired
-it was required to restart Samba, disrupting service to other users.
-
- smbcontrol ldap_server reload-certs
-
-This will now allow these certificates to be reloaded 'on the fly'
 
 ================
 REMOVED FEATURES
@@ -231,14 +27,12 @@ smb.conf changes
 
   Parameter Name                          Description     Default
   --------------                          -----------     -------
-  winbind debug traceid                   Add traceid     No
-  directory name cache size               Removed
 
 
 KNOWN ISSUES
 ============
 
-https://wiki.samba.org/index.php/Release_Planning_for_Samba_4.19#Release_blocking_bugs
+https://wiki.samba.org/index.php/Release_Planning_for_Samba_4.20#Release_blocking_bugs
 
 
 #######################################
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c
index c0631b43061..796b52ea905 100644
--- a/auth/credentials/credentials_krb5.c
+++ b/auth/credentials/credentials_krb5.c
@@ -945,7 +945,8 @@ _PUBLIC_ int cli_credentials_get_client_gss_creds(struct cli_credentials *cred,
 		maj_stat = gss_krb5_set_allowable_enctypes(&min_stat, gcc->creds,
 							   num_ktypes,
 							   (int32_t *) etypes);
-		SAFE_FREE(etypes);
+		krb5_free_enctypes(ccache->smb_krb5_context->krb5_context,
+				   etypes);
 		if (maj_stat) {
 			talloc_free(gcc);
 			if (min_stat) {
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index b87cdc06a93..bd877941a9a 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -1589,7 +1589,7 @@ static PyObject *py_ccache_name(PyObject *self, PyObject *unused)
 				    ccc->ccache, &name);
 	if (ret == 0) {
 		py_name = PyString_FromStringOrNULL(name);
-		SAFE_FREE(name);
+		krb5_free_string(ccc->smb_krb5_context->krb5_context, name);
 	} else {
 		PyErr_SetString(PyExc_RuntimeError,
 				"Failed to get ccache name");
diff --git a/ctdb/event/event_tool.c b/ctdb/event/event_tool.c
index 46dc25e6c30..e6d5261c217 100644
--- a/ctdb/event/event_tool.c
+++ b/ctdb/event/event_tool.c
@@ -197,9 +197,64 @@ static void print_status_one(struct ctdb_event_script *script)
 		       ctime(&script->begin.tv_sec));
 	}
 
-	if (script->result != 0 && script->result != -ENOEXEC) {
-		printf("  OUTPUT: %s\n",
-		       script->output == NULL ? "" : script->output);
+	if ((script->result != 0 && script->result != -ENOEXEC) ||
+	    script->output != NULL) {
+		/* Empty output is informative so always print it on failure */
+		const char *t = script->output == NULL ? "" : script->output;
+		size_t len = strlen(t);
+		char output[len+1];
+		size_t p;
+		char *t1, *t2;
+
+		strlcpy(output, t, sizeof(output));
+
+		/*
+		 * Strip trailing newlines, they are clutter and
+		 * interfere with multi-line detection
+		 */
+		p = len - 1;
+		while (p >= 0 && output[p] == '\n') {
+			output[p] = '\0';
+			p--;
+		}
+
+		/* If the output is a single line then print it inline */
+		t2 = strchr(output, '\n');
+		if (t2 == NULL) {
+			printf("  OUTPUT: %s\n", output);
+			return;
+		}
+
+		/*
+		 * More than 1 line.  Print a header and then each
+		 * line, with suitable indent.  There are more general
+		 * ways to do this, but let's maintain intermediate
+		 * blank lines (e.g. strv_split() loses blank lines).
+		 */
+		printf("  OUTPUT:\n");
+		t1 = output;
+		do {
+			/*
+			 * Points to newline character. t2 initially
+			 * set non-NULL outside loop because this loop
+			 * only covers multi-line output.
+			 */
+			*t2 = '\0';
+
+
+			printf("    %s\n", t1);
+			t1 = t2 + 1;
+
+			if (t1 >= output + len) {
+				break;
+			}
+
+			/* strchrnul() would be awesome, but isn't portable */
+			t2 = strchr(t1, '\n');
+			if (t2 == NULL) {
+				t2 = output + len;
+			}
+		} while (true);
 	}
 }
 
diff --git a/ctdb/tests/UNIT/eventd/etc-ctdb/events/random/02.enabled.script b/ctdb/tests/UNIT/eventd/etc-ctdb/events/random/02.enabled.script
index f25e7242543..90df5218a9d 100755
--- a/ctdb/tests/UNIT/eventd/etc-ctdb/events/random/02.enabled.script
+++ b/ctdb/tests/UNIT/eventd/etc-ctdb/events/random/02.enabled.script
@@ -5,7 +5,36 @@ case "$1" in
 "failure") exit 1 ;;
 "timeout") sleep 99 ;;
 "verbose") echo "Running event $1" ; exit 0 ;;
+"verbosemultiline")
+	cat <<EOF
+Running event $1
+There are multiple output lines
+
+^^^ including blank lines...
+
+EOF
+	exit 0
+	;;
+"verbosemultilinenonl")
+	cat <<EOF
+Running event $1
+Multiple output lines
+
+EOF
+	printf 'No trailing newline'
+	exit 0
+	;;
 "verbosefailure") echo "args: $*"; exit 1 ;;
+"verbosemultilinefailure")
+	cat <<EOF
+Failing event $1
+There are multiple output lines
+
+args: $*
+
+EOF
+	exit 2
+	;;
 "verbosetimeout") echo "Sleeping for 99 seconds"; sleep 99 ;;
 "verbosetimeout2") echo "Sleeping for 99 seconds"; sleep 99 ;;
 *) exit 0 ;;
diff --git a/ctdb/tests/UNIT/eventd/eventd_008.sh b/ctdb/tests/UNIT/eventd/eventd_008.sh
index c394f61790b..c52caa0e25e 100755
--- a/ctdb/tests/UNIT/eventd/eventd_008.sh
+++ b/ctdb/tests/UNIT/eventd/eventd_008.sh
@@ -17,3 +17,57 @@ required_result 1 <<EOF
   OUTPUT: args: verbosefailure with some args
 EOF
 simple_test status random verbosefailure
+
+ok_null
+simple_test run 10 random verbose
+
+ok <<EOF
+01.disabled          DISABLED  
+02.enabled           OK         DURATION DATETIME
+  OUTPUT: Running event verbose
+EOF
+simple_test status random verbose
+
+ok_null
+simple_test run 10 random verbosemultiline
+
+ok <<EOF
+01.disabled          DISABLED  
+02.enabled           OK         DURATION DATETIME
+  OUTPUT:
+    Running event verbosemultiline
+    There are multiple output lines
+    
+    ^^^ including blank lines...
+EOF
+simple_test status random verbosemultiline
+
+ok_null
+simple_test run 10 random verbosemultilinenonl
+
+ok <<EOF
+01.disabled          DISABLED  
+02.enabled           OK         DURATION DATETIME
+  OUTPUT:
+    Running event verbosemultilinenonl
+    Multiple output lines
+    
+    No trailing newline
+EOF
+simple_test status random verbosemultilinenonl
+
+required_result 8 <<EOF
+Event verbosemultilinefailure in random failed
+EOF
+simple_test run 10 random verbosemultilinefailure with some args
+
+required_result 2 <<EOF
+01.disabled          DISABLED  
+02.enabled           ERROR      DURATION DATETIME
+  OUTPUT:
+    Failing event verbosemultilinefailure
+    There are multiple output lines
+    
+    args: verbosemultilinefailure with some args
+EOF
+simple_test status random verbosemultilinefailure
diff --git a/lib/fuzzing/wscript_build b/lib/fuzzing/wscript_build
index e0f4173b989..05dbc00f267 100644
--- a/lib/fuzzing/wscript_build
+++ b/lib/fuzzing/wscript_build
@@ -193,8 +193,6 @@ Build.BuildContext.SAMBA_NDR_FUZZ = SAMBA_NDR_FUZZ
 
 # fuzz_ndr_X is generated from the list if IDL fed to PIDL
 # however there are exceptions to the normal pattern
-bld.SAMBA_NDR_FUZZ('IOXIDResolver') # oxidresolver.idl
-bld.SAMBA_NDR_FUZZ('IRemoteActivation') # remact.idl
 bld.SAMBA_NDR_FUZZ('iremotewinspool') # winspool.idl
 bld.SAMBA_NDR_FUZZ('FileServerVssAgent') # fsvrp.idl
 bld.SAMBA_NDR_FUZZ('lsarpc') # lsa.idl
@@ -215,33 +213,6 @@ bld.SAMBA_NDR_FUZZ('sparse')
 bld.SAMBA_NDR_FUZZ('resiliency')
 bld.SAMBA_NDR_FUZZ('trim')
 
-# WMI tables
-bld.SAMBA_NDR_FUZZ('IWbemClassObject')
-bld.SAMBA_NDR_FUZZ('IWbemServices')
-bld.SAMBA_NDR_FUZZ('IEnumWbemClassObject')
-bld.SAMBA_NDR_FUZZ('IWbemContext')
-bld.SAMBA_NDR_FUZZ('IWbemLevel1Login')
-bld.SAMBA_NDR_FUZZ('IWbemWCOSmartEnum')
-bld.SAMBA_NDR_FUZZ('IWbemFetchSmartEnum')
-bld.SAMBA_NDR_FUZZ('IWbemCallResult')
-bld.SAMBA_NDR_FUZZ('IWbemObjectSink')
-
-# DCOM tables
-bld.SAMBA_NDR_FUZZ('dcom_Unknown')
-bld.SAMBA_NDR_FUZZ('IUnknown')
-bld.SAMBA_NDR_FUZZ('IClassFactory')
-bld.SAMBA_NDR_FUZZ('IRemUnknown')
-bld.SAMBA_NDR_FUZZ('IClassActivator')
-bld.SAMBA_NDR_FUZZ('ISCMLocalActivator')
-bld.SAMBA_NDR_FUZZ('IMachineLocalActivator')
-bld.SAMBA_NDR_FUZZ('ILocalObjectExporter')
-bld.SAMBA_NDR_FUZZ('ISystemActivator')
-bld.SAMBA_NDR_FUZZ('IRemUnknown2')


-- 
Samba Shared Repository



More information about the samba-cvs mailing list