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

99519 Commits

Author SHA1 Message Date
Ralph Boehme
c2c5621380 s3-mdssvc: main Spotlight code
Implement all Spotlight RPC commands with the Tracker SPARQL async query
API.

Tracker uses glib for implemeting async tasks, we thus have to use a
glib mainloop for processing sheduled tasks in threads.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
0de03ce4a4 s3-mdssvc: Spotlight attribute mappings
Add mappings for metadata attribute between Spotlight and NEPOMUK for
use with Tracker.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
5d4eceae15 s3-mdssvc: (un)marshalling Spotlight RPC blob
Add code for marshalling and unmarshalling Spotlight RPC blobs
from/into a dalloc object store.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
222e863d4e s3-mdssvc: dalloc: dynamic object store based on talloc
dalloc is a hack with a bizarre API, but it does its job: it's a
simple object store that allows for storing simple and complex data
types.

We'll use it for storing Spotlight query data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
25f56f5f40 s3-mdssvc: add new option 'spotlight'
Per share option: it reflects whether a share is indexed by Tracker or
not. The global switch that controls whether Spotlight is enabled or
not, are the mdsvc RPC switches.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
63dd793cde s3-mdssvc: add Spotlight RPC stubs
'mdssvc' aka 'Metadata Search Service' is an RPC service used by Apple
for passing marshalled Spotlight search queries and results between
client to server.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
5c6e2b2b1f mdssvc: IDL file for new RPC service
'mdssvc' aka 'Metadata Search Service' is an RPC service used by Apple
for passing marshalled Spotlight search queries and results between
client to server.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
6e332abc3c s3-mdssvc: add configure option --enable-spotlight
configure check with pkg-config for libtracker-sparql, default is
disabled.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Stefan Metzmacher
66736fee3a s4:torture/rpc: use dcerpc_secondary_auth_connection with creds
This is the same as calling dcerpc_secondary_connection/dcerpc_bind_auth.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jul  7 17:07:49 CEST 2015 on sn-devel-104
2015-07-07 17:07:49 +02:00
Stefan Metzmacher
87bf1a6edd s4:torture/rpc: use dcerpc_secondary_auth_connection with anon creds
This is the same as calling dcerpc_secondary_connection/dcerpc_bind_auth_none.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
e0bb97fde6 s4:torture/samba3rpc: use pipe_bind_smb_auth()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
810d630bd5 s4:torture/samba3rpc: add pipe_bind_smb_auth()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
f42d4e9dd3 s4:torture/samba3rpc: use pipe_bind_smb2()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
1df9416bdb s4:torture/samba3rpc: add pipe_bind_smb2()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
d80c38990f s4:torture/samba3rpc: use pipe_bind_smb() in more places
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
5a849c13a7 s4:torture/samba3rpc: move pipe_bind_smb() to the top
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
07b1e375e5 s4:libnet: make use of dcerpc_secondary_auth_connection_send/recv()
This avoid the bogus usage of dcerpc_pipe_auth().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
f036683896 s4:libcli/clilsa: only remember the dcerpc_binding_handle
We don't need the 'dcerpc_pipe'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
8c22f81e9b s4:librpc/rpc: add dcerpc_secondary_auth_connection()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
9c165e5504 dcerpc.idl: fix calculatin of uint16 secondary_address_size;
This should be 0 for secondary_address = "".

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
9f62c4e47b pidl:Samba4/NDR/Parser: always initialize _mem_save_ pointers to NULL
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
856c9aa503 pidl:Samba3/ServerNDR: add pidl_reset() and pidl_return() helper functions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
16952dc7a4 pidl:Samba3/ServerNDR: make CallWithStruct() more flexible
We now pass multiple callbacks $check, $cleanup, $return
down to AllocOutVar().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Stefan Metzmacher
b3de334938 pidl:Samba3/ServerNDR: simplify CallWithStruct()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Michael Adam
365d9d8bdf docs:smb.conf: explain effect of new setting 'desired' of smb encrypt
Thereby clarify some details.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Michael Adam
14357700fd smbd:smb2: use encryption_desired in send_break
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Michael Adam
41cb881e77 smbd:smb2: only enable encryption in tcon if desired
Don't enforce it but only announce DATA_ENCRYPT,
making use of encryption_desired in tcon.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
fc228025d7 smbd:smb2: only enable encryption in session if desired
Don't enforce it but only announce ENCRYPT_DATA, using the
encryption_desired flag in session setup.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
3bb2999443 smbd:smb2: separate between encryption required and enc desired
this means we:
- accept unencrypted requests if encryption only desired
  and not required,
- but we always send encrypted responses in the desired
  case, not only when the request was encrypted.

For this purpose, the do_encryption in the request
structure is separated into was_encrypted and do_encryption.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
a3ea6dbef5 smbXsrv: add bools encryption_desired to session and tcon
This is to indicate that we should sen the ENCRYPT_DATA
flag on session or tcon replies.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
204cbe3645 Introduce setting "desired" for 'smb encrypt' and 'client/server signing'
This should trigger the behaviour where the server requires
signing when the client supports it, but does not reject
clients that don't support it.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Volker Lendecke
8fec35994c vfs_fruit: Fix CID 1311244 Out-of-bounds read
We should not call memcpy if the offset is exactly AFP_INFO_SIZE

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): Tue Jul  7 14:04:39 CEST 2015 on sn-devel-104
2015-07-07 14:04:39 +02:00
Douglas Bagnall
bba177100c Treat uid_t, git_t as 64 bit in Pidl Python bindings
This follows their treatment in librpc/ndr/ndr_basic.c.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Jul  7 07:19:49 CEST 2015 on sn-devel-104
2015-07-07 07:19:49 +02:00
Christof Schmitt
cdbc6d92c6 ctdb: Accept the key in hex format for the pstore command
This follows the same pattern as the tstore command, and it allows
specifying key strings with a trailing \0 character.

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): Mon Jul  6 23:23:22 CEST 2015 on sn-devel-104
2015-07-06 23:23:22 +02:00
Christof Schmitt
1d25a51591 sharesec: Remove error message for unmarshall_sec_desc failure
In a cluster setup, running sharesec -D results in an empty record that
triggers this message. The situation is correctly handled in the code
(unmarshall_sec_desc fails and sharesec uses the default), so simply
remove the message in this case.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-06 20:19:12 +02:00
Volker Lendecke
589de04178 docs: Document smbclient "notify" command
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 Jul  3 18:30:21 CEST 2015 on sn-devel-104
2015-07-03 18:30:21 +02:00
Stefan Metzmacher
9ebf3804eb lib/util:charset/tests: improve strlen_m[_term[_null]]() testing
They differ in their "" vs. NULL handling.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Jul  3 05:02:45 CEST 2015 on sn-devel-104
2015-07-03 05:02:45 +02:00
Stefan Metzmacher
bf6f032094 lib/util: let strlen_m_term[_null]() use strlen_m_ext_term[_null]()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
cd8bcecf18 lib/util: add strlen_m_ext_term_null() helper function
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
3cdac4a855 s4:pyrpc: remove pointless alter_context() method
This will always result in a rpc protocol error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
84993440aa python:samba/tests: don't use the x.alter_context() method in dcerpc/bare.py
Establishing a new context on a given connection using alter_context
is supposed to be done by using y = ClientConnection(..., basis_connection=x)

The current x.alter_context() can work as it's not allowed to
change the abstract or transfer syntax of an existing presentation
context.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
828e1d3f83 s4:torture/rpc: expect NT_STATUS_CONNECTION_DISCONNECTED in torture_rpc_alter_context()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
58a874111b s4:torture/rpc: expect NT_STATUS_CONNECTION_DISCONNECTED when a dcerpc connection is not connected
We still also allow NT_STATUS_INVALID_HANDLE and NT_STATUS_IO_DEVICE_ERROR for now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
7e095eb334 libcli/smb: let tstream_smbXcli_np report connection errors as EPIPE instead of EIO
This maps to NT_STATUS_CONNECTION_DISCONNECTED instead of
NT_STATUS_IO_DEVICE_ERROR.

EPIPE, NT_STATUS_CONNECTION_DISCONNECTED matches what other tstream backends
e.g. tcp and unix report.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
793af3f2ae s3:winbindd: use check dcerpc_binding_handle_is_connected() instead of a specific status
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
24ea9175f4 python/samba/tests: add fallbacks for assert{Less,Greater}[Equal]()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
c7e9968cf8 python/samba/tests: let the output of hexdump() match our C code in dump_data_cb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
7a07f6a764 python/samba/tests: move hexdump() from DNSTest to TestCase
This is useful in a lot of test cases.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
2b163012aa librpc/ndr: make use of dump_data_cb() in ndr_dump_data()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
4a0370bdfd lib/util: fix output format in dump_data*()
This changes:

  [0000] 4E 54 4C 4D 53 53 50 00   01 00 00 00 05 82 08 60   NTLMSSP. .......`
  [0010] 09 00 09 00 20 00 00 00   00 00 00 00 29 00 00 00   .... ... ....)...
  [0020] 57 4F 52 4B 47 52 4F 55   50                       WORKGROU P

into:

  [0000] 4E 54 4C 4D 53 53 50 00   01 00 00 00 05 82 08 60   NTLMSSP. .......`
  [0010] 09 00 09 00 20 00 00 00   00 00 00 00 29 00 00 00   .... ... ....)...
  [0020] 57 4F 52 4B 47 52 4F 55   50                        WORKGROU P

Note the alignment of 'WORKGROU P'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00