1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

111935 Commits

Author SHA1 Message Date
Amitay Isaacs
b72d5fc7ba ctdb-packaging: Package all helpers using wildcard
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-05-12 12:06:28 +02:00
Aaron Haslett
77ea31bccf devel: removing unused code from chgkrbtgtpass
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May 12 12:05:31 CEST 2018 on sn-devel-144
2018-05-12 12:05:31 +02:00
Aaron Haslett
8b72d4c7bb samdb rid: clear cache to prevent old ntds_guid
During the new samba-tool domain backup restore the NTDS GUID changes
as the server is taken over by the new DC record.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 09:15:07 +02:00
Aaron Haslett
6a09162df6 ldb: removing prior secret from logs
priorSecret, like secret, can contain a machine account password
(for secrets.ldb) and so should not be printed in a debug
trace.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13353

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 09:15:07 +02:00
Martin Schwenke
b9d01fddc6 ctdb-scripts: Drop CTDB_SUPPRESS_COREFILE and CTDB_MAX_OPEN_FILES options
These should be done using features provided by the operating system.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat May 12 09:13:28 CEST 2018 on sn-devel-144
2018-05-12 09:13:28 +02:00
Martin Schwenke
7e31a1382f ctdb-config: Add default ctdb.sysconfig file, update ctdb.service
Install ctdb.sysconfig in RPM.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
74230c59b6 ctdb-docs: Document system options and resource controls
The existing configuration file is disappearing so these configuration
options need a new home that is not handled by ctdbd_wrapper.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
f63f9053ef ctdb-config: Add a default script.options file
Include it in the RPM.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
a8ccf41b87 ctdb-docs: Document script.options
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
ac1c12b5a2 ctdb-scripts: Use load_script_options() in miscellaneous scripts
Some of these just aim to load the generic script.options file while
others target more specific files.

For NFS configuration, always use 60.nfs.options - even for 06.nfs.
This could be carefully documented but will change a lot before
release so there is no need.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
02444e5f47 ctdb-scripts: Allow load_script_options() to specify an event script
This allows other scripts to use the given options for a particular
event script.  One interesting example is that the ctdb_natgw tool
should look for configuration in events.d/11.natgw.options.

In the future this will be something like
events/failover/11.natgw.options, so require the component to be
specified even though it isn't yet used.

Test support is also updated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
00f35b7b0d ctdb-scripts: Add global script.options configuration file
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
31f26e9700 ctdb-tests: Separate support script for 06.nfs
Including 60.nfs was too simple a hack, since we will want to do some
magic to use the configuration from 60.nfs for 06.nfs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
130f37c23f ctdb-scripts: Don't check for CTDB_PARTIALLY_ONLINE_INTERFACES clash
Just document that NAT gateway and LVS are not compatible with this
option.  Update the documentation to make it clear that this is a
10.interface option.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
574af23e9d ctdb-scripts: Don't load CTDB configuration in onnode
onnode does not use any configuration options.

Drop sourcing of functions file since the only function used was
loadconfig().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
5d7d53b25a ctdb-scripts: Don't load CTDB configuration in statd-callout
The only configuration options used by statd-callout are NFS_HOSTNAME,
which comes from the NFS system configuration file, and
CTDB_NFS_CALLOUT, which is exported by the 60.nfs event script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Martin Schwenke
36e7043fb1 ctdb-tests: Continue running if a testcase is not executable
At the moment the whole test run aborts without printing a summary of
results but inexplicably succeeds.  Instead, generate a clear failure
for a non-executable testcase.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-05-12 06:11:17 +02:00
Garming Sam
cda3b23337 pysmb: Add some more documentation for conn.list
There are two options which are undocumented.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May 12 04:57:29 CEST 2018 on sn-devel-144
2018-05-12 04:57:29 +02:00
Garming Sam
b3799fb6e6 gpo: Ensure all files are retrieved in fetch
.ini files are normally set as hidden, and will not be found over SMB.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-12 02:09:29 +02:00
Garming Sam
454d8148a6 Fix spelling s/woks/works
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-12 02:09:29 +02:00
Joe Guo
38fc8125e2 traffic: improve is_really_a_packet
This function will repeat on each packet.
Avoid exception for getattr, which is expensive for performance.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
c1af6a0dad traffic: improve add_short_packet by avoiding str.split
Avoid str.split, which will repeat for each packet.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
5107e56aa0 traffic: simplify forget_packets_outside_window
Make code compact, and improve performance a little bit.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
4fb5e28b66 traffic: grant user write permission
Some packets need user to have write permission, e.g.: writeaccountspn
Grant user write permission then we can send packets successfully.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
7181af9f94 traffic_replay: fetch domain from creds other than opts
For traffic_replay script, when user provides `--workgroup` or `-W` option,
it will be set on the creds option group, not the default opts one.

The previous code will not work properly when smb.conf file is missing.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
fd2bcd5d10 traffic: set domain on user_creds and machine_creds
The domain is missing in traffic user and machine credential, this will cause
some packet tests fail against windows.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
7c93fb57f5 traffic_packets: provision request data for packet_drsuapi_13
The `drsuapi.DsWriteAccountSpnRequest1` struct in this packet was empty before.
Samba lets it go but Windows will report an invalid parameter error.

Provision the request with proper data, and give user permission to
write account SPN.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
9cabb16b48 traffic_packets: add trailing $ to fix packet_rpc_netlogon_30
For `NetrServerPasswordSet2`, the 2nd arg `account_name` must end with a
$, otherwise windows will return an `Access Denied` error.

Use `creds.get_username()` instead of `creds.get_workstation()` to
include the trailing $.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
eafda9137a traffic_packets: add windows instructions for ldap 0 simple bind
To run packet_ldap_0 simple bind test against Windows, we need to
install CA on Windows with following PowerShell commands:

  Install-windowsfeature ADCS-Cert-Authority
  Install-AdcsCertificationAuthority -CAType EnterpriseRootCA
  Restart-Computer

Otherwise we will get `NT_STATUS_CONNECTION_RESET` error.

Didn't change any code, just add above instructions in comment.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
14af041c13 traffic_packets: replace share_name from netlogon to IPC$ for packet_srvsvc_16
Sharename list for Windows:

    Sharename       Type      Comment
    ---------       ----      -------
    ADMIN$          Disk      Remote Admin
    C$              Disk      Default share
    IPC$            IPC       Remote IPC

For Samba:

    Sharename       Type      Comment
    ---------       ----      -------
    netlogon        Disk
    sysvol          Disk
    IPC$            IPC       IPC Service

While test packet_srvsvc_16 with share_name `netlogon`,
it passed Samba, and got a WERR_NERR_NETNAMENOTFOUND error for Windows.

Change share name to `IPC$` so Samba and Windows have it in common.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:29 +02:00
Joe Guo
51333c1538 traffic_packets: replace level 102 to 101 for packet_srvsvc_21
Level 102 will cause WERR_ACCESS_DENIED error against Windows, because:

    > If the level is 102 or 502, the Windows implementation checks whether
    > the caller is a member of one of the groups previously mentioned or
    > is a member of the Power Users local group.

It passed against Samba since this check is not implemented by Samba yet.

refer to:

    https://msdn.microsoft.com/en-us/library/cc247297.aspx#Appendix_A_80

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
34e35c4c80 traffic: add credentials to samr
lp and creds are missing in SamrContext and samr connection.
While run traffic_replay against windows, this will cause
`Access Denied` error.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
8d8ef48650 traffic_packets: support NT_STATUS_NO_SUCH_DOMAIN in packet_lsarpc_39
For packet_lsarpc_39, samba will return NT_STATUS_OBJECT_NAME_NOT_FOUND,
however, windows will return NT_STATUS_NO_SUCH_DOMAIN.

Allow both status for now to keep compatiable with both samba and
windows DC.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
4e37336632 traffic_replay: fix typo in message string
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
5ed1682905 traffic_replay: set gensec features to encrypt credentials
While running traffic_replay script against windows dc, it will fail
with a `LDAP_UNWILLING_TO_PERFORM` error for adding user.

Windows requires the credentials to be encrypted before sending.
`set_gensec_features` will fix it.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
4d950527f3 traffic: add paged_results control for ldb search
While there are more then 1000 records in the search result from Windows,
a `LDAP_SIZE_LIMIT_EXCEEDED` error will be returned.

Add paged_results control to fix.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Andrew Bartlett
2a4261c052 selftest: Add a test for creds.{get,set}_secure_channel_type()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
656ec98e5b pycredentials: add py_creds_get_secure_channel_type
We have only set, need get.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Joe Guo
6a6d14248d cmd_drsuapi: add dswriteaccountspn command
The dswriteaccountspn command is missing in drsuapi, add it so we can
use it in rpcclient.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Mathieu Parent
674fd1c283 Improve vfs_linux_xfs_sgid manpage
- Add missing refpurpose and describe the "circumstances"
- Replace dangling link by archive.org backup
- Add fixed Linux version and commit link

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Mathieu Parent
d4bbff5ce5 Fix pidl manpage sections
.TH header should match file name (i.e 3pm and not 3 for Parse::Pidl::NDR).

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:28 +02:00
Mathieu Parent
15d2f4f817 Fix spelling s/unsuported/unsupported/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
5a0fd87b6b Fix spelling s/unitialized/uninitialized/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
66a9b53457 Fix spelling s/succesfully/successfully/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
c55248bbbc Fix spelling s/specfied/specified/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
8f7749cda7 Fix spelling s/retun/return/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
44ae08858e Fix spelling s/retrive/retrieve/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
25ac1f192c Fix spelling s/receving/receiving/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
43ec8c6bbd Fix spelling s/protcol/protocol/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00
Mathieu Parent
8ed2873400 Fix spelling s/propogate/propagate/
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-05-12 02:09:27 +02:00