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

104413 Commits

Author SHA1 Message Date
Martin Schwenke
ce451c7cc6 ctdb-tcp: Fix CID 1362727 Unchecked return value from library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00
Martin Schwenke
4bc934f132 ctdb-common: Fix CID 1362728 Unchecked return value from library
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00
Martin Schwenke
6d1099a522 ctdb-common: Fix CID 1362729 Unchecked return value from library
Drop setting socket non-blocking and close-on-exec.  The socket is
closed soon after.  Only a single packet is sent, making it almost
impossible for it to block.  Also, note that sockets aren't setup this
way for IPv6.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00
Martin Schwenke
198ca88391 ctdb-tests: Update porting test to be more flexible about line numbers
This way the test doesn't need to be changed every time the code is
moved around.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00
Martin Schwenke
518683abfe ctdb-daemon: Fix CID 1125574 Operands don't affect result
Interfaces going up or down are always interesting, so log these at
error level.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:25 +02:00
Martin Schwenke
1be2cd9dd2 ctdb-daemon: Fix CID 1125575 Operands don't affect result
This is related to an error, so repeatedly log at error level instead
of trying to avoid repetition.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:24 +02:00
Martin Schwenke
b92c78a043 ctdb-daemon: Fix CID 1272855 Operands don't affect result
Failures are already logged at alert/error level above, so just log
the summary at notice level.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-08-17 23:00:24 +02:00
Amitay Isaacs
47e6c37dca ctdb-tools: Drop "ctdb rebalancenode"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12151

This was already dropped in commit d678684695.

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

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Aug 17 09:22:13 CEST 2016 on sn-devel-144
2016-08-17 09:22:13 +02:00
Amitay Isaacs
f376f346f2 ctdb-tools: Drop "ctdb rebalanceip"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12151

This was already dropped in commit aaa57fbcb3.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-08-17 05:28:19 +02:00
Amitay Isaacs
f635bd8997 ctdb-tools: Addition of IPs is deferred until the next takeover run
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12152

This makes the behaviour of "ctdb addip" similar to "ctdb delip".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-08-17 05:28:19 +02:00
Jeremy Allison
639063da8c s3: vfs: shadow_copy2. Remove any trailing slash when stripping @GMT-YYYY... from the end of a path.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 17 05:25:30 CEST 2016 on sn-devel-144
2016-08-17 05:25:30 +02:00
Jeremy Allison
6245f2c042 s3: vfs: shadow_copy2: Re-use an existing variable already set to the right value (p - name).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2016-08-17 01:22:38 +02:00
Michael Adam
b2bf61307c idmap: centrally check that unix IDs returned by the idmap backends are in range
Note: in the long run, it might be good to move this kind of
exit check (before handing the result back to the client)
to the parent winbindd code.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 17 01:21:39 CEST 2016 on sn-devel-144
2016-08-17 01:21:39 +02:00
Michael Adam
c21976d4b1 idmap: don't generally forbid id==0 from idmap_unix_id_is_in_range()
If the range allows it, then id==0 should not be forbidden.
This seems to have been taken in from idmap_ldap when the
function was originally created.

See 634cd2e045 .
The other backends don't seem to have had that
extra check for id == 0.

The reasoning for this change is that the range check should
apply to all cases. If the range includes the 0, then it
should be possible to get it as result. In particular,
this way, the function becomes applicable also to the
passdb backend case, e.g. in a samba4-ad-dc setup where
the Admin gets uid == 0.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-08-16 21:27:22 +02:00
Stefan Metzmacher
5066a6db4b s3:lib/pthreadpool: fix the build on older systems
Some systems required an explicit <signal.h>, which comes
via "system/wait.h"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 16 19:09:55 CEST 2016 on sn-devel-144
2016-08-16 19:09:55 +02:00
Uri Simchoni
3e42b69d5e smbd: look only at handle readability for COPYCHUNK dest
This commits sets the stage for a change of behavior
in a later commit.

When checking FILE_READ_DATA on the COPYCHUNK dest handle,
only check the handle readability and not the extra right
that may have been added due to the FILE_EXECUTE right.

The check for FILE_READ_DATA always seemed strange for the
dest handle, which is not read. It turns out that in Windows,
this check is not done at the SMB layer, but at a lower layer
that processes the IOCTL request - the IOCTL code has bits
that specify what type of access check needs to be done.

Therefore, this lower layer is unaware of the SMB layer's
practice of granting READ access based on the FILE_EXECUTE
right, and it only checks the handle's readability.

This subtle difference has observable behavior - the
COPYCHUNK source handle can have FILE_EXECUTE right instead
of FILE_READ_DATA, but the dest handle cannot.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Aug 16 15:21:03 CEST 2016 on sn-devel-144
2016-08-16 15:21:03 +02:00
Uri Simchoni
5bf11f6f5b s4-smbtorture: pin copychunk exec right behavior
Add tests that show copychunk behavior when the
source and dest handles have execute right instead
of read-data right.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Uri Simchoni
6ce0304eda seltest: allow opening files with arbitrary rights in smb2.ioctl tests
Separate file creation (which requires write access) from the
opening of the file for the test (which might be without write
access).

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Uri Simchoni
7dc9f58206 seltest: implicit FILE_READ_DATA non-reporting
This test (passes against Windows Server 2012R2) shows
that the implicit FILE_READ_DATA that is added whenever
FILE_EXECUTE is granted, is not reported back when querying
the handle.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Uri Simchoni
55a9d35cab s4-selftest: add test for read access check
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12149

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Uri Simchoni
1b06acafa4 s4-selftest: add functions which create with desired access
Add functions which create a file or a directory with
specific desired access.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Uri Simchoni
20b9a5bd74 s4-smbtorture: use standard macros in smb2.read test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12149

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-08-16 11:31:27 +02:00
Christof Schmitt
f1b42ec778 smbd: Fix snapshot query on shares with DFS enabled
When DFS is enabled (host msdfs = yes and msdfs root = yes), then SMB
clients send create requests in the format \hostname\service\path.
Putting the GMT tag as first element breaks the DFS parsing and results
in OBJECT_NOT_FOUND for snapshotted files.  Fix this by appending the
GMT tag to the end of the path.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 13 05:44:39 CEST 2016 on sn-devel-144
2016-08-13 05:44:38 +02:00
Uri Simchoni
b6931d5edc selftest: add tests for dfree with inherit owner enabled
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-13 01:53:15 +02:00
Uri Simchoni
f20d57ecea selftest: refactor test_dfree_quota.sh - add share parameter
Add a share parameter to individual disk-free tests. This will
allow running tests on shares other than dfq share.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-13 01:53:15 +02:00
Uri Simchoni
ea73bcd87b smbd: use owner uid for free disk calculation if owner is inherited
If "inherit owner" is enabled, then new files created under a
directory shall consume the quota of the directory's owner, so
the free disk calculation should take that quota into account,
not the quota of the user creating the file.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-13 01:53:15 +02:00
Uri Simchoni
bd2ec88dca smbd: get a valid file stat to disk_quotas
Most calls to disk_quotas originate at a state with an
open file descriptor. Pass the file's stat info down to
disk_quota, so that we can avoid extra stat's and the related
error handling.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-13 01:53:15 +02:00
Uri Simchoni
3e6ea02d42 quotas: small cleanup
Remove an internal function from proto.h

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-13 01:53:15 +02:00
Volker Lendecke
1c10c85939 ctdb: Fix the O3 developer build on RHEL7
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 13 00:55:02 CEST 2016 on sn-devel-144
2016-08-13 00:55:02 +02:00
Volker Lendecke
89a24622e7 vfs_gpfs: Load nfs4 acl params at tcon time
This reduces user-space CPU for metadata intensive workloads, lp_parm_* is
expensive doing lots of strwicmp.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Aug 12 21:03:36 CEST 2016 on sn-devel-144
2016-08-12 21:03:36 +02:00
Volker Lendecke
519b10e224 nfs4acls: Allow nfs4 acl params to be set by callers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
d982ea5246 nfs4acls: Make smbacl4_vfs_params public
vfs_gpfs & others will be able to embed this structure in their special config.

We could have gone with an anonymous struct and a talloc'ed object, but for my
taste this is specialized and hidden enough that it's not worth the
indirection.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
e3523c8d46 nfs4acls: Add "smbacl4_vfs_params" parameter to smb_set_nt_acl_nfs4
Pure placeholder right now, this will allow vfs modules to load the params in
advance

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
02882b44df nfs4acls: Add "smbacl4_vfs_params" parameter to smb_get_nt_acl_nfs4
Pure placeholder right now, this will allow vfs modules to load the params in
advance

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
fbddf56f17 nfs4acls: Add "smbacl4_vfs_params" parameter to smb_fget_nt_acl_nfs4
Pure placeholder right now, this will allow vfs modules to load the params
in advance. nfs4 acl parameters should not change while a tcon is live,
and lp_parm_get_* show up in profiles. Loading the parameters once at
tcon time will remove this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
41bb898d0a nfs4acls: Add some const
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Volker Lendecke
baaf4e393b nfs4acls: Remove a typedef
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-08-12 17:15:20 +02:00
Douglas Bagnall
e7ad8727be KCC: Fix misnamed variable in DSA object
Found by Garming. Unlikely to affect anyone.

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

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Aug 12 08:20:31 CEST 2016 on sn-devel-144
2016-08-12 08:20:31 +02:00
Volker Lendecke
57001580bb lib: Use replace.h properly in pthreadpool
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 12 04:26:09 CEST 2016 on sn-devel-144
2016-08-12 04:26:09 +02:00
Amitay Isaacs
499bfce3e9 ctdb-pmda: Use 1s timeout for fetching statistics
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12138

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-12 00:32:17 +02:00
Volker Lendecke
e001dceadf ldb: Fix some signed/unsigned hickups
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 11 23:49:38 CEST 2016 on sn-devel-144
2016-08-11 23:49:38 +02:00
Jeremy Allison
df83b17c60 s3: oplock: Fix race condition when closing an oplocked file.
We must send the 'oplock released' message whilst the lock
is held in the close path. Otherwise the messaged smbd can
race with the share mode delete.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-08-11 19:55:12 +02:00
Jeremy Allison
cb394abe52 smbd: oplock: Factor out internals of remove_oplock() into new remove_oplock_under_lock().
Allows this to be called elsewhere.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-08-11 19:55:11 +02:00
Jeremy Allison
de7180151f smbd: oplock: Fixup debug messages inside remove_oplock().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12139

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-08-11 19:55:11 +02:00
Stefan Metzmacher
98d289d2e5 script/autobuild.py: include the branch name in the output
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Aug 11 08:38:47 CEST 2016 on sn-devel-144
2016-08-11 08:38:47 +02:00
Stefan Metzmacher
c064357428 selftest/flapping: add some samba3.blackbox.smbclient_s3 tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12108

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 11 04:42:30 CEST 2016 on sn-devel-144
2016-08-11 04:42:30 +02:00
Stefan Metzmacher
119e7d094d Revert "s4: tests: Skip drs tests."
This reverts commit 08d03f79de49826dc5dff3bc09193f1404e5f549.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-11 00:49:15 +02:00
Andrew Bartlett
3ce5ad1e6c selftest: Move repl_schema test to a distinct OID prefix
We also take the chance to make it clearer that the number
being passed in should be unique.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-08-11 00:49:15 +02:00
Andrew Bartlett
108697402c s4:dsdb/repl_meta_data: Add more info on which DN we failed to find an attid on
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-11 00:49:15 +02:00
Stefan Metzmacher
111c5fd83f s4:dsdb/repl: let dsdb_replicated_objects_convert() change remote to local attid for linked attributes
We already do that for objects in dsdb_convert_object_ex().

We need to be consistent and do the same for linked attributes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-08-11 00:49:15 +02:00