[SCM] Samba Shared Repository - branch v4-9-test updated
Karolin Seeger
kseeger at samba.org
Tue Sep 4 14:00:02 UTC 2018
The branch, v4-9-test has been updated
via bcba25d vfs_fruit: Don't unlink the main file
via 5dad448 torture: Make sure that fruit_ftruncate only unlinks streams
via 5265716 s3:smbd: add a comment stating that file_close_user() is redundant for SMB2
via 71b7745 s3:smbd: let session logoff close files and tcons before deleting the session
via b5d7834 s3:smbd: reorder tcon global record deletion and closing files of a tcon
via c77edea selftest: add a durable handle test with delayed disconnect
via 99ef099 s4:selftest: reformat smb2_s3only list
via 7c5883a vfs_delay_inject: adding delay to VFS calls
via 7a3dbad s4:rpc_server/netlogon: don't treet trusted domains as primary in LogonGetDomainInfo()
via c6cfdf0 s4:rpc_server/netlogon: make use of talloc_zero_array() for the netr_OneDomainInfo array
via 3982347 s4:rpc_server/netlogon: use samdb_domain_guid()/dsdb_trust_local_tdo_info() to build our netr_OneDomainInfo values
via c7ca858 s4:dsdb/common: add samdb_domain_guid() helper function
via 7aab1f1 dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper function
via 53f225c dsdb/util_trusts: domain_dn is an input parameter of dsdb_trust_crossref_tdo_info()
via 5556a67 s4:torture/rpc/netlogon: verify the trusted domains output of LogonGetDomainInfo()
via 0a1df2a s4:torture/rpc/netlogon: assert that cli_credentials_get_{workstation,password} don't return NULL
via 176c9c3 smbd: Fix a memleak in async search ask sharemode
via 02f01fa ctdb-daemon: Log complete eventd startup command
via 9987cc3 ctdb-daemon: Do not retry connection to eventd
via 46de8d2 ctdb-daemon: Wait for eventd to be ready before connecting
via 0155635 ctdb-daemon: Open eventd pipe earlier
via abb6337 ctdb-daemon: Improve error handling consistency
via 1a171bc ctdb-event: Add support to eventd for the startup notification FD
via 35242cf ctdb-common: Add support for sock daemon to notify of successful startup
via a242e10 ctdb-common: Process the whole config file even if an error occurs
via 7db0f18 ctdb-common: Avoid ENOENT for unknown conf options
via 40dff2c ctdb-common: Avoid ENOENT for unknown conf type tags
via 372b79c ctdb-common: Log a message when an invalid conf value is encountered
via 42b2c12f ctdb-common: Log a message for unknown conf option
via 8b711e8 ctdb-common: Fix log message for conf option with unknown section
via 0070d21 ctdb-daemon: Drop incorrect log message
via 8d9c661 s3: util: Do not take over stderr when there is no log file
from 4c2dfd7 s3: VFS: vfs_full_audit: Ensure smb_fname_str_do_log() only returns absolute pathnames.
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-9-test
- Log -----------------------------------------------------------------
commit bcba25d3ea0d9af2e131397e640b2bd5d793825d
Author: Volker Lendecke <vl at samba.org>
Date: Tue Aug 7 15:10:31 2018 +0200
vfs_fruit: Don't unlink the main file
The original fix for bug 13441 was missing a check that verifies that
fruit_ftruncate() is actually called on a stream.
Follow-up to
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13441
Pair-Programmed-With: Volker Lendecke <vl at samba.org>
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Thu Aug 23 15:28:48 CEST 2018 on sn-devel-144
(cherry picked from commit 8c14234871820eacde46670d722a676fb5f3a46c)
Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-9-test): Tue Sep 4 15:59:02 CEST 2018 on sn-devel-144
commit 5dad448c7cc6a90d08bfa53cd027b9418d396bac
Author: Volker Lendecke <vl at samba.org>
Date: Tue Aug 7 15:11:22 2018 +0200
torture: Make sure that fruit_ftruncate only unlinks streams
Follow-up to
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13441
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
(cherry picked from commit c39ec64231b261fe4ada02f1f1b9aa344cf35bb5)
commit 52657164ac05c26c3879da8e57a0c606eeb77911
Author: Ralph Boehme <slow at samba.org>
Date: Thu Aug 30 15:57:33 2018 +0200
s3:smbd: add a comment stating that file_close_user() is redundant for SMB2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat Sep 1 01:26:35 CEST 2018 on sn-devel-144
(cherry picked from commit 5d95f79f604d90c2646225a0f2470f05dd71e19e)
commit 71b7745111551e0076ac33b81c1c8eef3b4594cd
Author: Ralph Boehme <slow at samba.org>
Date: Wed Aug 29 17:19:29 2018 +0200
s3:smbd: let session logoff close files and tcons before deleting the session
This avoids a race in durable handle reconnects if the reconnect comes
in while the old session is still in the tear-down phase.
The new session is supposed to rendezvous with and wait for destruction
of the old session, which is internally implemented with
dbwrap_watch_send() on the old session record.
If the old session deletes the session record before calling
file_close_user() which marks all file handles as disconnected, the
durable handle reconnect in the new session will fail as the records are
not yet marked as disconnected which is a prerequisite.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 8f6edcc1645e0ed35eaec914bd0b672500ce986c)
commit b5d78343fb26ade4783e214c877ea837910e5d8e
Author: Ralph Boehme <slow at samba.org>
Date: Thu Aug 30 15:50:02 2018 +0200
s3:smbd: reorder tcon global record deletion and closing files of a tcon
As such, this doesn't change overall behaviour, but in case we ever add
semantics acting on tcon record changes via an API like
dbwrap_watch_send(), this will make a difference as it enforces
ordering.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit b70b8503faded81b10859131f08486349876d132)
commit c77edea016b1df8357dfe273a2688612a51ade4b
Author: Ralph Boehme <slow at samba.org>
Date: Thu Aug 30 19:15:19 2018 +0200
selftest: add a durable handle test with delayed disconnect
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 5508024a861e7c85e6c837552ad142aa1d5e8eca)
commit 99ef099d0d60272fdeb976e5244f35547d1dae19
Author: Ralph Boehme <slow at samba.org>
Date: Fri Aug 31 08:28:46 2018 +0200
s4:selftest: reformat smb2_s3only list
No change besides reformatting the list to one entry per line.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 3255822f75163cb38e53f634a5c6b03d46bfaff1)
commit 7c5883a572a8979ddeebcc6dc2999585b4588490
Author: Ralph Boehme <slow at samba.org>
Date: Thu Aug 30 17:27:08 2018 +0200
vfs_delay_inject: adding delay to VFS calls
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 44840ba5b32a2ce7959fd3d7c87822b3159416d3)
commit 7a3dbadb4b836ab080f811f5d53be7de14f38faf
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 28 12:52:31 2018 +0200
s4:rpc_server/netlogon: don't treet trusted domains as primary in LogonGetDomainInfo()
We need to handle trusted domains differently than our primary
domain. The most important part is that we don't return
NETR_TRUST_FLAG_PRIMARY for them.
NETR_TRUST_FLAG_{INBOUND,OUTBOUND,IN_FOREST} are the relavant flags
for trusts.
This is an example of what Windows returns in a complex trust
environment:
netr_LogonGetDomainInfo: struct netr_LogonGetDomainInfo
out: struct netr_LogonGetDomainInfo
return_authenticator : *
return_authenticator: struct netr_Authenticator
cred: struct netr_Credential
data : f48b51ff12ff8c6c
timestamp : Tue Aug 28 22:59:03 2018 CEST
info : *
info : union netr_DomainInfo(case 1)
domain_info : *
domain_info: struct netr_DomainInformation
primary_domain: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x0014 (20)
size : 0x0016 (22)
string : *
string : 'W2012R2-L4'
dns_domainname: struct lsa_StringLarge
length : 0x0020 (32)
size : 0x0022 (34)
string : *
string : 'w2012r2-l4.base.'
dns_forestname: struct lsa_StringLarge
length : 0x0020 (32)
size : 0x0022 (34)
string : *
string : 'w2012r2-l4.base.'
domain_guid : 0a133c91-8eac-4df0-96ac-ede69044a38b
domain_sid : *
domain_sid : S-1-5-21-2930975464-1937418634-1288008815
trust_extension: struct netr_trust_extension_container
length : 0x0000 (0)
size : 0x0000 (0)
info : NULL
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domain_count : 0x00000006 (6)
trusted_domains : *
trusted_domains: ARRAY(6)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x000e (14)
size : 0x0010 (16)
string : *
string : 'FREEIPA'
dns_domainname: struct lsa_StringLarge
length : 0x0018 (24)
size : 0x001a (26)
string : *
string : 'freeipa.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : 00000000-0000-0000-0000-000000000000
domain_sid : *
domain_sid : S-1-5-21-429948374-2562621466-335716826
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x00000022 (34)
0: NETR_TRUST_FLAG_IN_FOREST
1: NETR_TRUST_FLAG_OUTBOUND
0: NETR_TRUST_FLAG_TREEROOT
0: NETR_TRUST_FLAG_PRIMARY
0: NETR_TRUST_FLAG_NATIVE
1: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000000 (0)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000008 (8)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
1: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
0: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x0016 (22)
size : 0x0018 (24)
string : *
string : 'S1-W2012-L4'
dns_domainname: struct lsa_StringLarge
length : 0x0036 (54)
size : 0x0038 (56)
string : *
string : 's1-w2012-l4.w2012r2-l4.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : afe7fbde-af82-46cf-88a2-2df6920fc33e
domain_sid : *
domain_sid : S-1-5-21-1368093395-3821428921-3924672915
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x00000023 (35)
1: NETR_TRUST_FLAG_IN_FOREST
1: NETR_TRUST_FLAG_OUTBOUND
0: NETR_TRUST_FLAG_TREEROOT
0: NETR_TRUST_FLAG_PRIMARY
0: NETR_TRUST_FLAG_NATIVE
1: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000004 (4)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000020 (32)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
0: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
1: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x0006 (6)
size : 0x0008 (8)
string : *
string : 'BLA'
dns_domainname: struct lsa_StringLarge
length : 0x0010 (16)
size : 0x0012 (18)
string : *
string : 'bla.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : 00000000-0000-0000-0000-000000000000
domain_sid : *
domain_sid : S-1-5-21-4053568372-2049667917-3384589010
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x00000022 (34)
0: NETR_TRUST_FLAG_IN_FOREST
1: NETR_TRUST_FLAG_OUTBOUND
0: NETR_TRUST_FLAG_TREEROOT
0: NETR_TRUST_FLAG_PRIMARY
0: NETR_TRUST_FLAG_NATIVE
1: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000000 (0)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000008 (8)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
1: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
0: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x000c (12)
size : 0x000e (14)
string : *
string : 'S4XDOM'
dns_domainname: struct lsa_StringLarge
length : 0x0016 (22)
size : 0x0018 (24)
string : *
string : 's4xdom.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : 00000000-0000-0000-0000-000000000000
domain_sid : *
domain_sid : S-1-5-21-313966788-4060240134-2249344781
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x00000022 (34)
0: NETR_TRUST_FLAG_IN_FOREST
1: NETR_TRUST_FLAG_OUTBOUND
0: NETR_TRUST_FLAG_TREEROOT
0: NETR_TRUST_FLAG_PRIMARY
0: NETR_TRUST_FLAG_NATIVE
1: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000000 (0)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000008 (8)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
1: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
0: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x0014 (20)
size : 0x0016 (22)
string : *
string : 'W2012R2-L4'
dns_domainname: struct lsa_StringLarge
length : 0x001e (30)
size : 0x0020 (32)
string : *
string : 'w2012r2-l4.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : 0a133c91-8eac-4df0-96ac-ede69044a38b
domain_sid : *
domain_sid : S-1-5-21-2930975464-1937418634-1288008815
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x0000001d (29)
1: NETR_TRUST_FLAG_IN_FOREST
0: NETR_TRUST_FLAG_OUTBOUND
1: NETR_TRUST_FLAG_TREEROOT
1: NETR_TRUST_FLAG_PRIMARY
1: NETR_TRUST_FLAG_NATIVE
0: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000000 (0)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000000 (0)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
0: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
0: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
trusted_domains: struct netr_OneDomainInfo
domainname: struct lsa_StringLarge
length : 0x0016 (22)
size : 0x0018 (24)
string : *
string : 'S2-W2012-L4'
dns_domainname: struct lsa_StringLarge
length : 0x004e (78)
size : 0x0050 (80)
string : *
string : 's2-w2012-l4.s1-w2012-l4.w2012r2-l4.base'
dns_forestname: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
domain_guid : 29daace6-cded-4ce3-a754-7482a4d9127c
domain_sid : *
domain_sid : S-1-5-21-167342819-981449877-2130266853
trust_extension: struct netr_trust_extension_container
length : 0x0010 (16)
size : 0x0010 (16)
info : *
info: struct netr_trust_extension
length : 0x00000008 (8)
dummy : 0x00000000 (0)
size : 0x00000008 (8)
flags : 0x00000001 (1)
1: NETR_TRUST_FLAG_IN_FOREST
0: NETR_TRUST_FLAG_OUTBOUND
0: NETR_TRUST_FLAG_TREEROOT
0: NETR_TRUST_FLAG_PRIMARY
0: NETR_TRUST_FLAG_NATIVE
0: NETR_TRUST_FLAG_INBOUND
0: NETR_TRUST_FLAG_MIT_KRB5
0: NETR_TRUST_FLAG_AES
parent_index : 0x00000001 (1)
trust_type : LSA_TRUST_TYPE_UPLEVEL (2)
trust_attributes : 0x00000000 (0)
0: LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY
0: LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN
0: LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE
0: LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION
0: LSA_TRUST_ATTRIBUTE_WITHIN_FOREST
0: LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL
0: LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_long1 : 0x00000000 (0)
dummy_long2 : 0x00000000 (0)
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
lsa_policy: struct netr_LsaPolicyInformation
policy_size : 0x00000000 (0)
policy : NULL
dns_hostname: struct lsa_StringLarge
length : 0x0036 (54)
size : 0x0038 (56)
string : *
string : 'torturetest.w2012r2-l4.base'
dummy_string2: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string3: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
dummy_string4: struct lsa_StringLarge
length : 0x0000 (0)
size : 0x0000 (0)
string : NULL
workstation_flags : 0x00000003 (3)
1: NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS
1: NETR_WS_FLAG_HANDLES_SPN_UPDATE
supported_enc_types : 0x0000001f (31)
1: KERB_ENCTYPE_DES_CBC_CRC
1: KERB_ENCTYPE_DES_CBC_MD5
1: KERB_ENCTYPE_RC4_HMAC_MD5
1: KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96
1: KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96
0: KERB_ENCTYPE_FAST_SUPPORTED
0: KERB_ENCTYPE_COMPOUND_IDENTITY_SUPPORTED
0: KERB_ENCTYPE_CLAIMS_SUPPORTED
0: KERB_ENCTYPE_RESOURCE_SID_COMPRESSION_DISABLED
dummy_long3 : 0x00000000 (0)
dummy_long4 : 0x00000000 (0)
result : NT_STATUS_OK
Best viewed with: git show --histogram -w
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 2099add0657126e4a5427ec2db0fe8025478b355)
commit c6cfdf0db6f1406635694532d6870cf4ed004474
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 28 16:30:17 2018 +0200
s4:rpc_server/netlogon: make use of talloc_zero_array() for the netr_OneDomainInfo array
It's much safer than having uninitialized memory when we hit an error
case.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit ef0b489ad0d93199e08415dd895da5cfe2d1c11a)
commit 39823476937e58debdd5e5dd5f0ef3e5ec87e9d6
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 28 11:46:16 2018 +0200
s4:rpc_server/netlogon: use samdb_domain_guid()/dsdb_trust_local_tdo_info() to build our netr_OneDomainInfo values
The logic for constructing the values for our own primary domain differs
from the values of trusted domains. In order to make the code easier to
understand we have a new fill_our_one_domain_info() helper that
only takes care of our primary domain.
The cleanup for the trust case will follow in a separate commit.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 61333f7787d78e3ec5c7bd2874d5a0f1f536275a)
commit c7ca8588f65eaa857d2c957f4c07b88047bbf0ba
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 28 11:52:27 2018 +0200
s4:dsdb/common: add samdb_domain_guid() helper function
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit 0e442e094240abbf79aaca00a9d1a053a200a7e8)
commit 7aab1f1918f9e94c384b378332007f5afebe8399
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Feb 1 23:09:26 2018 +0100
dsdb:util_trusts: add dsdb_trust_local_tdo_info() helper function
This is similar to dsdb_trust_xref_tdo_info(), but will also work
if we ever support more than one domain in our forest.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit c1b0ac95db5c6112d90356c7ada8c3d445e9b668)
commit 53f225cd59bd78ae96d269080865916911e4ec25
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Feb 1 23:08:08 2018 +0100
dsdb/util_trusts: domain_dn is an input parameter of dsdb_trust_crossref_tdo_info()
We should not overwrite it within the function.
Currently it doesn't matter as we don't have multiple domains
within our forest, but that will change in future.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit f5f96f558b499770cdeb3d38998167a387e058b9)
commit 5556a67fdf44a89c4e410d1210d4b9811638a948
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 28 17:46:46 2018 +0200
s4:torture/rpc/netlogon: verify the trusted domains output of LogonGetDomainInfo()
This makes sure we don't treat trusted domains in the same way we treat
our primary domain.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit d5dd8fdc647d6a202c5da0451d395116c2cd92b9)
commit 0a1df2a4294da8bd67131da1fb1d9bd3b0c2c4c6
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 3 09:55:18 2018 +0200
s4:torture/rpc/netlogon: assert that cli_credentials_get_{workstation,password} don't return NULL
This is better that generating a segfault while dereferencing a NULL
pointer later.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11517
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
(cherry picked from commit dffc182c6943d21513d8db9f6cf66bdc09206b17)
commit 176c9c38011a5b5fee557ce12cc307902acb746f
Author: Volker Lendecke <vl at samba.org>
Date: Mon Sep 3 15:54:48 2018 +0200
smbd: Fix a memleak in async search ask sharemode
fetch_share_mode_unlocked_parser() takes a "struct
fetch_share_mode_unlocked_state *" as
"private_data". fetch_share_mode_send() used a talloc_zero'ed "struct
share_mode_lock". This lead to the parser putting a "struct
share_mode_lock on the NULL talloc_context where nobody really picked it
up.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13602
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
(cherry picked from commit 0bd109b733fbce774feae2142d25f7e828b56bcb)
commit 02f01fa7a602f6f996c857a3b2e55420ae888a0c
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Sep 3 16:12:16 2018 +1000
ctdb-daemon: Log complete eventd startup command
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 6d3d9a85e5630ba398ac953ad1515155f10224d9)
commit 9987cc39ea777dec95e9f4a8836515722ba263fc
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 27 14:53:37 2018 +1000
ctdb-daemon: Do not retry connection to eventd
Confirmation is now received from eventd that it is accepting
connections, so this is no longer needed.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit b430a1ace69bcef3336907557ab5bf04271c1110)
commit 46de8d248ff5e45bd6957c27a78b4160213c1432
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 27 14:47:38 2018 +1000
ctdb-daemon: Wait for eventd to be ready before connecting
The current method of retrying the connection to eventd means that
messages get logged for each failure.
Instead, pass a pipe file descriptor to eventd and wait for it to
write 0 to the pipe to indicate that it is ready to accept client
connections.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 62ec1ab1470206d6a2cf300f30ca0b4a39413a38)
commit 0155635c79defe37d0332ca46865cdd8eaa0d73b
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 27 14:44:24 2018 +1000
ctdb-daemon: Open eventd pipe earlier
The pipe will soon be needed earlier, so initialise it earlier.
Ensure the file descriptors are closed on error.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit c446ae5e1382d5e32c33ce92243daf6b4338e15a)
commit abb633701c518bd850c80ae519a38adcd2822edf
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 27 15:28:47 2018 +1000
ctdb-daemon: Improve error handling consistency
Other errors free argv, so do it here too.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit e357b62fe556609750bdb8d27cf48dfb85c62ec8)
commit 1a171bc54c07ec092d02c2ab89ae5c7263b97b86
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 24 14:52:29 2018 +1000
ctdb-event: Add support to eventd for the startup notification FD
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 11ee92d1bfd73c509d90e7a7386af60a4e1a7fca)
commit 35242cfbf40589eb619e8915ed30564272f7cc10
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 24 14:44:12 2018 +1000
ctdb-common: Add support for sock daemon to notify of successful startup
The daemon writes 0 into the specified file descriptor when it is up
and listening. This can be used to avoid loops in clients that
attempt to connect until they succeed.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit dc6040c121c65d5551c686f3f1be2891795f48aa)
commit a242e1016271fcae17b3c2b5af607bb7c614cb3a
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 09:35:14 2018 +1000
ctdb-common: Process the whole config file even if an error occurs
At the moment multiple errors will be encountered one at a time, on
each load or validate. Instead, allow all configuration errors to
printed in a single pass.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 4f1727fe0bf2b0962a5d131d60a416b8f459ad94)
commit 7db0f189d64de651dc665ba3f507e56e1dc27964
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 08:42:04 2018 +1000
ctdb-common: Avoid ENOENT for unknown conf options
Only use ENOENT for missing configuration file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 920ed66ba7e874ca23d72fff9342fbd64a1e329f)
commit 40dff2ce058b13a1a531d85d43b9f5638c09615a
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 08:45:25 2018 +1000
ctdb-common: Avoid ENOENT for unknown conf type tags
Only use ENOENT for missing configuration file.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit f1084400387c0b1257b6d92ee6e8a89504d788fc)
commit 372b79c4f004c04221ca5e584c2b839428107c20
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 09:34:12 2018 +1000
ctdb-common: Log a message when an invalid conf value is encountered
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a017d3181ac1062b66ae506a8a523f7455630fce)
commit 42b2c12f56c7e0a2e62e2d2f0ea8ad3c6272336c
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 08:32:12 2018 +1000
ctdb-common: Log a message for unknown conf option
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit ebb28c57a17777ea15afab63cd0742dd79b30ffe)
commit 8b711e8d296a085c62e04a1ce5398bb3985290ac
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 19:57:56 2018 +1000
ctdb-common: Fix log message for conf option with unknown section
This covers both options that appear before a section and options in
unknown sections.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 421d828f6cb7c13d5f33c6cc1c6be254554588a4)
commit 0070d21bd3c2aee8e27d7728619b4f9bac6cfc38
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 31 09:06:51 2018 +1000
ctdb-daemon: Drop incorrect log message
The message is incorrect because the actual failure was loading the
config file. Instead of fixing the message, drop it because
ctdb_config_load() already logs the failure.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit b5453bc27add11a7288772a59adcc605328b9098)
commit 8d9c661989dd6faf8841620c077c44fb612e4e05
Author: Paulo Alcantara <paulo at paulo.ac>
Date: Fri Aug 17 11:30:16 2018 -0300
s3: util: Do not take over stderr when there is no log file
In case we don't have either a /var/log/samba directory, or pass a
non-existent log directory through '-l' option, all commands that are
daemonized with '-D' option hang when executed within a subshell.
An example on how to trigger that:
# rm -r /var/log/samba
# s=$(nmbd -D -s /etc/samba/smb.conf -l /foo123)
(never returns)
So, when the above command is executed within a subshell the following
happens:
(a) Parent shell creates a pipe, sets write side of it to fd 1
(stdout), call read() on read-side fd, forks off a new child process
and then executes nmbd in it.
(b) nmbd sets up initial logging to go through fd 1 (stdout) by
calling setup_logging(..., DEBUG_DEFAULT_STDOUT). 'state.fd' is now
set to 1.
(c) reopen_logs() is called by the first time which then calls
reopen_logs_internal()
(d) in reopen_logs_internal(), it attempts to create log.nmbd file in
/foo123 directory and fails because directory doesn't exist.
(e) Regardless whether the log file was created or not, it calls
dup2(state.fd, 2) which dups fd 1 into fd 2.
(f) At some point, fd 0 and 1 are closed and set to /dev/null
The problem with that is because parent shell in (a) is still blocked in
read() call and the new write side of the pipe is now fd 2 -- after
dup2() in (e) -- and remains unclosed.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13578
Signed-off-by: Paulo Alcantara <palcantara at suse.de>
Reviewed-by: Jim McDonough <jmcd at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Sat Aug 18 01:32:25 CEST 2018 on sn-devel-144
(cherry picked from commit 41aa55f49233ea7682cf14e5a7062617274434ce)
-----------------------------------------------------------------------
Summary of changes:
ctdb/common/conf.c | 47 +++--
ctdb/common/sock_daemon.c | 26 +++
ctdb/common/sock_daemon.h | 10 +
ctdb/event/event_daemon.c | 8 +
ctdb/server/ctdbd.c | 2 +-
ctdb/server/eventscript.c | 147 +++++++++++--
ctdb/tests/cunit/conf_test_001.sh | 4 +-
ctdb/tests/cunit/config_test_001.sh | 5 +-
ctdb/tests/cunit/config_test_005.sh | 6 +
lib/util/debug.c | 7 +-
selftest/target/Samba3.pm | 8 +
source3/locking/share_mode_lock.c | 13 +-
source3/modules/vfs_delay_inject.c | 58 +++++
source3/modules/vfs_fruit.c | 6 +-
source3/modules/wscript_build | 7 +
.../script/tests/test_durable_handle_reconnect.sh | 21 ++
source3/selftest/tests.py | 5 +-
source3/smbd/smbXsrv_session.c | 52 +++--
source3/smbd/smbXsrv_tcon.c | 38 ++--
source3/wscript | 1 +
source4/dsdb/common/util.c | 55 +++++
source4/dsdb/common/util_trusts.c | 22 +-
source4/rpc_server/netlogon/dcerpc_netlogon.c | 234 +++++++++++++++------
source4/selftest/tests.py | 8 +-
source4/torture/rpc/netlogon.c | 146 ++++++++++++-
source4/torture/smb2/durable_v2_open.c | 95 +++++++++
source4/torture/smb2/smb2.c | 2 +
source4/torture/vfs/fruit.c | 45 ++++
28 files changed, 907 insertions(+), 171 deletions(-)
create mode 100644 source3/modules/vfs_delay_inject.c
create mode 100755 source3/script/tests/test_durable_handle_reconnect.sh
Changeset truncated at 500 lines:
diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c
index 669ac23..3d668de 100644
--- a/ctdb/common/conf.c
+++ b/ctdb/common/conf.c
@@ -155,7 +155,7 @@ static int conf_value_from_string(TALLOC_CTX *mem_ctx,
break;
default:
- return ENOENT;
+ return EINVAL;
}
return ret;
@@ -232,7 +232,7 @@ static int conf_value_copy(TALLOC_CTX *mem_ctx,
break;
default:
- return ENOENT;
+ return EINVAL;
}
return 0;
@@ -1048,6 +1048,10 @@ static int conf_load_internal(struct conf_context *conf)
}
}
+ if (state.err != 0) {
+ goto fail;
+ }
+
conf_all_update(conf);
return 0;
@@ -1066,7 +1070,7 @@ static bool conf_load_section(const char *section, void *private_data)
ok = conf_section_validate(state->conf, state->s, state->mode);
if (!ok) {
state->err = EINVAL;
- return false;
+ return true;
}
}
@@ -1078,7 +1082,7 @@ static bool conf_load_section(const char *section, void *private_data)
} else {
D_ERR("conf: unknown section [%s]\n", section);
state->err = EINVAL;
- return false;
+ return true;
}
}
@@ -1099,23 +1103,30 @@ static bool conf_load_option(const char *name,
if (state->s == NULL) {
if (state->conf->ignore_unknown) {
- D_DEBUG("conf: ignoring unknown option \"%s\"\n",
+ D_DEBUG("conf: unknown section for option \"%s\"\n",
name);
return true;
} else {
- D_ERR("conf: unknown option \"%s\"\n", name);
+ D_ERR("conf: unknown section for option \"%s\"\n",
+ name);
state->err = EINVAL;
- return false;
+ return true;
}
}
opt = conf_option_find(state->s, name);
if (opt == NULL) {
if (state->conf->ignore_unknown) {
+ D_DEBUG("conf: unknown option [%s] -> \"%s\"\n",
+ state->s->name,
+ name);
return true;
} else {
- state->err = ENOENT;
- return false;
+ D_ERR("conf: unknown option [%s] -> \"%s\"\n",
+ state->s->name,
+ name);
+ state->err = EINVAL;
+ return true;
}
}
@@ -1128,9 +1139,13 @@ static bool conf_load_option(const char *name,
value.type = opt->type;
ret = conf_value_from_string(tmp_ctx, value_str, &value);
if (ret != 0) {
+ D_ERR("conf: invalid value [%s] -> \"%s\" = \"%s\"\n",
+ state->s->name,
+ name,
+ value_str);
talloc_free(tmp_ctx);
state->err = ret;
- return false;
+ return true;
}
ok = conf_option_same_value(opt, &value);
@@ -1142,7 +1157,7 @@ static bool conf_load_option(const char *name,
if (ret != 0) {
talloc_free(tmp_ctx);
state->err = ret;
- return false;
+ return true;
}
done:
@@ -1196,16 +1211,16 @@ static int conf_set(struct conf_context *conf,
s = conf_section_find(conf, section);
if (s == NULL) {
- return ENOENT;
+ return EINVAL;
}
opt = conf_option_find(s, key);
if (opt == NULL) {
- return ENOENT;
+ return EINVAL;
}
if (opt->type != value->type) {
- return ENOENT;
+ return EINVAL;
}
ok = conf_option_same_value(opt, value);
@@ -1280,12 +1295,12 @@ static int conf_get(struct conf_context *conf,
s = conf_section_find(conf, section);
if (s == NULL) {
- return ENOENT;
+ return EINVAL;
}
opt = conf_option_find(s, key);
if (opt == NULL) {
- return ENOENT;
+ return EINVAL;
}
if (opt->type != type) {
diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c
index 3c17519..90f6bce 100644
--- a/ctdb/common/sock_daemon.c
+++ b/ctdb/common/sock_daemon.c
@@ -31,6 +31,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/tevent_unix.h"
#include "lib/util/become_daemon.h"
+#include "lib/util/sys_rw.h"
#include "common/logging.h"
#include "common/reqid.h"
@@ -72,6 +73,7 @@ struct sock_daemon_context {
struct pidfile_context *pid_ctx;
struct sock_socket *socket_list;
+ int startup_fd;
};
/*
@@ -489,6 +491,7 @@ int sock_daemon_setup(TALLOC_CTX *mem_ctx, const char *daemon_name,
sockd->funcs = funcs;
sockd->private_data = private_data;
+ sockd->startup_fd = -1;
ret = logging_init(sockd, logging, debug_level, daemon_name);
if (ret != 0) {
@@ -520,6 +523,11 @@ int sock_daemon_add_unix(struct sock_daemon_context *sockd,
return 0;
}
+void sock_daemon_set_startup_fd(struct sock_daemon_context *sockd, int fd)
+{
+ sockd->startup_fd = fd;
+}
+
/*
* Run socket daemon
*/
@@ -549,6 +557,7 @@ static void sock_daemon_run_socket_fail(struct tevent_req *subreq);
static void sock_daemon_run_watch_pid(struct tevent_req *subreq);
static void sock_daemon_run_wait(struct tevent_req *req);
static void sock_daemon_run_wait_done(struct tevent_req *subreq);
+static void sock_daemon_startup_notify(struct sock_daemon_context *sockd);
struct tevent_req *sock_daemon_run_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -675,6 +684,8 @@ static void sock_daemon_run_started(struct tevent_req *subreq)
return;
}
sock_daemon_run_wait(req);
+
+ sock_daemon_startup_notify(sockd);
}
static void sock_daemon_run_startup_done(struct tevent_req *subreq)
@@ -702,6 +713,8 @@ static void sock_daemon_run_startup_done(struct tevent_req *subreq)
return;
}
sock_daemon_run_wait(req);
+
+ sock_daemon_startup_notify(sockd);
}
static void sock_daemon_run_signal_handler(struct tevent_context *ev,
@@ -967,6 +980,19 @@ static void sock_daemon_run_wait_done(struct tevent_req *subreq)
sock_daemon_run_shutdown(req);
}
+static void sock_daemon_startup_notify(struct sock_daemon_context *sockd)
+{
+ if (sockd->startup_fd != -1) {
+ unsigned int zero = 0;
+ ssize_t num;
+
+ num = sys_write(sockd->startup_fd, &zero, sizeof(zero));
+ if (num != sizeof(zero)) {
+ D_WARNING("Failed to write zero to pipe FD\n");
+ }
+ }
+}
+
bool sock_daemon_run_recv(struct tevent_req *req, int *perr)
{
int ret;
diff --git a/ctdb/common/sock_daemon.h b/ctdb/common/sock_daemon.h
index 705c4fa..972245a 100644
--- a/ctdb/common/sock_daemon.h
+++ b/ctdb/common/sock_daemon.h
@@ -210,6 +210,16 @@ int sock_daemon_add_unix(struct sock_daemon_context *sockd,
void *private_data);
/**
+ * @brief Set file descriptor for indicating startup success
+ *
+ * On successful completion, 0 (unsigned int) will be written to the fd.
+ *
+ * @param[in] sockd Socket daemon context
+ * @param[in] fd File descriptor
+ */
+void sock_daemon_set_startup_fd(struct sock_daemon_context *sockd, int fd);
+
+/**
* @brief Async computation start to run a socket daemon
*
* @param[in] mem_ctx Talloc memory context
diff --git a/ctdb/event/event_daemon.c b/ctdb/event/event_daemon.c
index 63c4dad..c1c6852 100644
--- a/ctdb/event/event_daemon.c
+++ b/ctdb/event/event_daemon.c
@@ -218,14 +218,18 @@ static bool event_client_recv(struct tevent_req *req, int *perr)
static struct {
int pid;
+ int startup_fd;
} options = {
.pid = -1,
+ .startup_fd = -1,
};
struct poptOption cmdline_options[] = {
POPT_AUTOHELP
{ "pid", 'P', POPT_ARG_INT, &options.pid, 0,
"pid to wait for", "PID" },
+ { "startup-fd", 'S', POPT_ARG_INT, &options.startup_fd, 0,
+ "file descriptor to notify of successful start", "FD" },
POPT_TABLEEND
};
@@ -338,6 +342,10 @@ int main(int argc, const char **argv)
goto fail;
}
+ if (options.startup_fd != -1) {
+ sock_daemon_set_startup_fd(e_state->sockd, options.startup_fd);
+ }
+
ret = sock_daemon_run(e_state->ev,
e_state->sockd,
e_state->pidfile,
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index ef829e5..721347c 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -223,7 +223,7 @@ int main(int argc, const char *argv[])
ret = ctdbd_config_load(ctdb, &conf);
if (ret != 0) {
- fprintf(stderr, "Failed to setup config file handling\n");
+ /* ctdbd_config_load() logs the failure */
goto fail;
}
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 4ef3b80..267f38a 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -110,6 +110,100 @@ static bool eventd_context_init(TALLOC_CTX *mem_ctx,
return true;
}
+struct eventd_startup_state {
+ bool done;
+ int ret;
+ int fd;
+};
+
+static void eventd_startup_timeout_handler(struct tevent_context *ev,
+ struct tevent_timer *te,
+ struct timeval t,
+ void *private_data)
+{
+ struct eventd_startup_state *state =
+ (struct eventd_startup_state *) private_data;
+
+ state->done = true;
+ state->ret = ETIMEDOUT;
+}
+
+static void eventd_startup_handler(struct tevent_context *ev,
+ struct tevent_fd *fde, uint16_t flags,
+ void *private_data)
+{
+ struct eventd_startup_state *state =
+ (struct eventd_startup_state *)private_data;
+ unsigned int data;
+ ssize_t num_read;
+
+ num_read = sys_read(state->fd, &data, sizeof(data));
+ if (num_read == sizeof(data)) {
+ if (data == 0) {
+ state->ret = 0;
+ } else {
+ state->ret = EIO;
+ }
+ } else if (num_read == 0) {
+ state->ret = EPIPE;
+ } else if (num_read == -1) {
+ state->ret = errno;
+ } else {
+ state->ret = EINVAL;
+ }
+
+ state->done = true;
+}
+
+
+static int wait_for_daemon_startup(struct tevent_context *ev,
+ int fd)
+{
+ TALLOC_CTX *mem_ctx;
+ struct tevent_timer *timer;
+ struct tevent_fd *fde;
+ struct eventd_startup_state state = {
+ .done = false,
+ .ret = 0,
+ .fd = fd,
+ };
+
+ mem_ctx = talloc_new(ev);
+ if (mem_ctx == NULL) {
+ return ENOMEM;
+ }
+
+ timer = tevent_add_timer(ev,
+ mem_ctx,
+ tevent_timeval_current_ofs(10, 0),
+ eventd_startup_timeout_handler,
+ &state);
+ if (timer == NULL) {
+ talloc_free(mem_ctx);
+ return ENOMEM;
+ }
+
+ fde = tevent_add_fd(ev,
+ mem_ctx,
+ fd,
+ TEVENT_FD_READ,
+ eventd_startup_handler,
+ &state);
+ if (fde == NULL) {
+ talloc_free(mem_ctx);
+ return ENOMEM;
+ }
+
+ while (! state.done) {
+ tevent_loop_once(ev);
+ }
+
+ talloc_free(mem_ctx);
+
+ return state.ret;
+}
+
+
/*
* Start and stop event daemon
*/
@@ -125,7 +219,7 @@ int ctdb_start_eventd(struct ctdb_context *ctdb)
const char **argv;
int fd[2];
pid_t pid;
- int ret, i;
+ int ret;
bool status;
if (ctdb->ectx == NULL) {
@@ -143,33 +237,44 @@ int ctdb_start_eventd(struct ctdb_context *ctdb)
return -1;
}
- argv = talloc_array(ectx, const char *, 4);
+ ret = pipe(fd);
+ if (ret != 0) {
+ return -1;
+ }
+
+ argv = talloc_array(ectx, const char *, 6);
if (argv == NULL) {
+ close(fd[0]);
+ close(fd[1]);
return -1;
}
argv[0] = ectx->path;
argv[1] = "-P";
argv[2] = talloc_asprintf(argv, "%d", ctdb->ctdbd_pid);
- argv[3] = NULL;
+ argv[3] = "-S";
+ argv[4] = talloc_asprintf(argv, "%d", fd[1]);
+ argv[5] = NULL;
- if (argv[2] == NULL) {
+ if (argv[2] == NULL || argv[4] == NULL) {
+ close(fd[0]);
+ close(fd[1]);
talloc_free(argv);
return -1;
}
- DEBUG(DEBUG_NOTICE,
- ("Starting event daemon %s %s %s\n", argv[0], argv[1], argv[2]));
-
- ret = pipe(fd);
- if (ret != 0) {
- return -1;
- }
+ D_NOTICE("Starting event daemon %s %s %s %s %s\n",
+ argv[0],
+ argv[1],
+ argv[2],
+ argv[3],
+ argv[4]);
pid = ctdb_fork(ctdb);
if (pid == -1) {
close(fd[0]);
close(fd[1]);
+ talloc_free(argv);
return -1;
}
@@ -185,6 +290,14 @@ int ctdb_start_eventd(struct ctdb_context *ctdb)
talloc_free(argv);
close(fd[1]);
+ ret = wait_for_daemon_startup(ctdb->ev, fd[0]);
+ if (ret != 0) {
+ ctdb_kill(ctdb, pid, SIGKILL);
+ close(fd[0]);
+ D_ERR("Failed to initialize event daemon (%d)\n", ret);
+ return -1;
+ }
+
ectx->eventd_fde = tevent_add_fd(ctdb->ev, ectx, fd[0],
TEVENT_FD_READ,
eventd_dead_handler, ectx);
@@ -197,17 +310,9 @@ int ctdb_start_eventd(struct ctdb_context *ctdb)
tevent_fd_set_auto_close(ectx->eventd_fde);
ectx->eventd_pid = pid;
- /* Wait to connect to eventd */
- for (i=0; i<10; i++) {
- status = eventd_client_connect(ectx);
- if (status) {
- break;
- }
- sleep(1);
- }
-
+ status = eventd_client_connect(ectx);
if (! status) {
- DEBUG(DEBUG_ERR, ("Failed to initialize event daemon\n"));
--
Samba Shared Repository
More information about the samba-cvs
mailing list