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

98898 Commits

Author SHA1 Message Date
Ross Lagerwall
f73bcf4934 s3: libsmbclient: Add server-side copy support
Introduce a new operation, splice, which copies data from one SMBCFILE
to another. Implement this operation using FSCTL_SRV_COPYCHUNK_WRITE for
SMB2+ protocols and using read+write for older protocols. Since the
operation may be long running, it takes a callback which gets called
periodically to indicate progress to the application and given an
opportunity to stop it.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-29 02:37:18 +02:00
Ralph Boehme
2ffa939bbe s4:torture:smb2:compound: compound read and padding
Add test to check that compound read responses are padded to an 8 byte
boundary.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11277

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu May 28 16:50:39 CEST 2015 on sn-devel-104
2015-05-28 16:50:39 +02:00
Ralph Boehme
dfa64b958b s3:smb2: add padding to last command in compound requests
Following Windows behaviour, the last command in a compound request
should be padded to an 8 byte boundary and OS X clients crash badly if
we don't pad.

[MS-SMB2] 3.3.4.1.3, "Sending Compounded Responses", doesn't make it
clear whether the padding requirement governs the last command in a
compound response, a future MS-SMB2 update will document Windwows
product behaviour in a footnote.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11277

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 14:01:30 +02:00
Volker Lendecke
a4cc7d4746 messages_ctdb: Use message_hdr_[get/put]
This also avoids the message copy when sending to ctdb by
using ctdbd_messaging_send_iov

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu May 28 14:00:29 CEST 2015 on sn-devel-104
2015-05-28 14:00:28 +02:00
Volker Lendecke
abc7b2f179 messaging: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
32d4419105 ctdbd_conn: Introduce ctdbd_messaging_send_iov()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
2416984b40 messaging: Make messaging_dispatch_rec static
It's not needed in ctdbd_conn.c anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
25fab3ebe9 messaging: With dgm_ref, don't destroy the dgm ctx
Since we use messaging_dgm_ref, we must rely on that to destroy the dgm
context when the last reference goes.

This is a real bugfix in case we have multiple messaging contexts.

I'm not sure if we should move towards just one single messaging context
per process, just like we have it for the dgm context.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
9406d09fec ctdbd_conn: ctdb_handle_message does not need msg_ctx
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
1052d3164c ctdbd_conn: Move ndr marshalling to messages_ctdb.c
The inter-node message format belongs into messages_ctdb, not into the
generic ctdb connection layer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
7ce9f3f3f5 ctdbd_conn: simplify ctdbd_register_ips
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
d669bd8243 ctdbd_conn: Move ctdbd_register_reconfigure to a callback
Move functionality out of ctdbd_conn to its right place into smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
a37398b9de ctdbd_conn: Move message handling out of ctdbd_conn.c
This also removes the deferred message handling. It's no longer required,
because the messaging_send_iov_from always goes through the kernel which
takes at least one round through tevent.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
24eb3659e3 ctdbd_conn: Call back when we get a msg
This activates the callbacks just added

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
467fee4d5a ctdbd_conn: Add callback args to register_with_ctdbd
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
4d0572a2a4 ctdbd_conn: Add callback fields for registered serverids
The idea is to move message handling out of ctdbd_conn

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
cc51e85f0a messaging: Register a tevent context for secondary dgm refs
When a secondary messaging context is initialized, we need to register
its tevent context with the lower level dgm context. Seen when using
smbstatus with clustering.

The TALLOC_FREE(r->tevent_handle) in the destructor might not be
necessary, but I want to free the tevent reference before
the context goes away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
586a959480 ctdbd_conn: Use read_data()
This is a much smaller dependency than read_data_ntstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Douglas Bagnall
d821456b84 KCC: more pythonic expression in select_istg
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-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): Thu May 28 10:14:12 CEST 2015 on sn-devel-104
2015-05-28 10:14:12 +02:00
Douglas Bagnall
77b47e1ce4 KCC: Write out more DOT files and debug
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:10 +02:00
Douglas Bagnall
03f45bf75f KCC: Comment noting verbose nature of construct_intrasite_graph()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
c7d39d0a52 KCC: Add comments regarding time handling
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Andrew Bartlett
9d2a31546c KCC: add --forced-local-dsa option for changing local dsa
For testing it is useful to pretend a DSA is local against the preferences
of the database.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
e32b52c740 KCC: add comments, idiomatic changes to intrasite_graph code
Using `x in foo_dict.keys()` is the same as `x in foo_dict`, except it
is O(n) instead of O(1) and is not the way things are done in Python.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
cee3f52d78 KCC: improve log legibility with colour; make more dot graphs
To see the colours in less, use -R.

  bin/samba_kcc --debug  -H whatever/sam.ldb | less -R

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
7375abec64 KCC: helper function to find config NC replica for a DSA
This logic is going to be used elsewhere (for dot debugging).

Also add a dedicated KCC Exception class.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
42dcaaf3b1 samba_kcc: try to implement rep deletion in translate_ntdsconn()
The trouble is it does nothing in our test case as there are no reps
that need deleting.

Also adding some tidy-ups and pointers to the reference.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
035a246679 KCC: use more pythonic construct for get_current_replica
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
aee0a9620d kcc: Reduce code verbosity in dumpstr_* functions
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
9dff16bd9c kcc: add labels to dot files
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
1fc7e5ba60 KCC: highlight our deviation from the spec in color_vertices
The documentation didn't make much sense.

Worked out by Garming.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00
Douglas Bagnall
9e78375d2c samba_kcc: add an option to set assumed current time
The KCC algorithm contains a timeouts in a couple of places, and we
need to be able to set the time for testing these.

This also means samba_kcc uses the same time in all places.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Douglas Bagnall
a59c8ed7bc KCC: Create Graphviz dot files showing network topology
This tries to record some information about what the graph is (e.g
which partition), though it is not very readable.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Douglas Bagnall
ddb5149373 KCC: correct the comparison for lost link timeout
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
0884482b00 kcc: Add a TODO for is_bridgehead_failed
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
906ed3d557 kcc: add some more debug messages
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
bb4c35011b kcc: correctly calculate the number of components
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
9864192a26 kcc: Export extended_dn to be used by import
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
e742720ad8 kcc: Make debugging slightly clearer
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
6ccbd18715 kcc: Use remote vertex instead of local vertex in getting bridgehead
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
fc93fa45da kcc: Use correct parent in kruskal algorithm
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
547cdaa120 kcc: Remove unused is_sitelink call
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
d583913337 kcc: Remove DN translation for Site GUID
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
99d4efc917 kcc: Factor out MAX_DWORD
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
6a62db3983 kcc: convert identification of sites from DN to GUID
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
6bb48d5c0e kcc: remove unnecessary find site link code
This code was originally used to form n-to-n replication.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
96ef2d556b kcc: Convert transport identification from DN to GUID
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
9c5729d182 kcc: Start using proper GUIDs for comparison
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
6decd8e94e kcc: Implement update_rodc_connection to maintain the FRS
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00
Garming Sam
5e63b8f705 samba_kcc: Add basic skeleton for KCC intersite algorithm
This enables the use of the intersite calculated list of edges

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:08 +02:00