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

2582 Commits

Author SHA1 Message Date
Volker Lendecke
a93946b2fe lib: Use asn1_extract_blob()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-01-06 00:54:18 +01:00
Andrew Bartlett
374d73617d lib/tls: Add new 'tls priority' option
This adds a new option to the smb.conf to allow administrators to disable
TLS protocols in GnuTLS without changing the code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11076
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-07-20 03:08:26 +02:00
Douglas Bagnall
9658112e10 Fix ldap_bind compilation for i386
More size_t != uintmax_t issues:

../source4/libcli/ldap/ldap_bind.c: In function ‘ldap_bind_sasl’:
../source4/libcli/ldap/ldap_bind.c:237:3: error: format ‘%ju’ expects argument of type ‘uintmax_t’, but argument 2 has type ‘size_t’ [-Werror=format=]

   DEBUG(1, ("SASL bind triggered with non empty send_queue[%ju]: %s\n",
      ^
      cc1: all warnings being treated as errors

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +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
Volker Lendecke
e1a87d8676 libldap: Fix CID 1308982 Unchecked return value from library
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): Wed Jul  1 00:11:41 CEST 2015 on sn-devel-104
2015-07-01 00:11:41 +02:00
Stefan Metzmacher
67c5d5849e s4:libcli/ldap: conversion to tstream
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-23 22:12:08 +02:00
Stefan Metzmacher
dd037b0be4 s4:libcli/raw: make sure smbcli_transport_connect_send/recv correctly cleanup on error
We need to make sure that we remove any pending writev_send or read_smb_send
request before closing the socket fd. As a side effect we always close the
socket fd if we don't return success for any any reason.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-12 17:08:17 +02:00
Alexander Bokovoy
eb029b32e9 s4: libcli/finddcs_cldap: continue processing CLDAP until all addresses are used
This is a subtle bug that causes CLDAP pings to fail if SRV records
discovered cannot be resolved or connection to them cannot be
established. The code that fires up CLDAP ping will silently cancel
the whole tevent request without going to the next server in the queue.

This may happen, for example, when connection to IPv6 addresses couldn't
be established, or when IPv4 address is not online or blocked by
firewall.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-20 19:29:30 +02:00
Richard Sharpe
f0e9ba91c0 Rename SMB2_OP_FIND to SMB2_OP_QUERY_DIRECTORY so that it conforms with the MS document MS-SMB2.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 27 01:24:47 CET 2015 on sn-devel-104
2015-03-27 01:24:47 +01:00
David Disseldorp
d1e664f154 s4/ntvfs: support FS_SECTOR_SIZE_INFORMATION query-info
Return the same values as used by s3fs.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-18 18:57:21 +01:00
David Disseldorp
664dca2b44 s4/client: add FS_SECTOR_SIZE_INFORMATION query support
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-18 18:57:20 +01:00
Günther Deschner
87054a5355 pidl/python: support HRESULT errors in generated python bindings.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-03-13 23:58:07 +01:00
Petr Viktorin
02980268e8 Remove use of the "staticforward" macro
This macro was used for compatibility with broken compilers.
Since Python 2.3, it is always defined as `static`, and only exists
"for source compatibility with old C extensions".

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-01-22 10:51:07 +01:00
Andreas Schneider
f45c633814 s4-libcli: Remove obsolete support for file resolving.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Andreas Schneider
7f00fcf558 addns: Remove support for dns_host_file.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Ralph Boehme
b942d6b05f s4:libcli/raw: make short_name available in buffer
This will be used in smb2/create AAPL context torture tests, where the
server returns an Mac OS X specific data blob in the short name
buffer. It's not a string, so the existing string extraction doesn't
cut it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:08 +01:00
Stefan Metzmacher
38b0fded58 s4:libcli/smb2: initialize ls->lease_version
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
3327615c23 s4:libcli/smb2: add new_epoch to struct smb2_lease_break
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
d0a1995b93 s4:libcli/smb2: allow the caller to specify a specific value for max_protocol.
The default is still PROTOCOL_LATEST. As smb2_connect*() is about SMB2/3 only
we upgrade to PROTOCOL_LATEST if PROTOCOL_NT1 or lower is given.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
bc83e45a19 s4:libcli/raw: fix up the max_protocol value for the current transport connection
This allows the caller to pass PROTOCOL_DEFAULT,
which results in PROTOCOL_NT1.

As smbcli_transport_init() is about SMB1 only we downgrade
to PROTOCOL_NT1 if a higher value (for SMB2 or SMB3) was given.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
55750f0104 s4:libcli/smb_composite: use the options on the transport
These are the options which really belong to the connection
and might not be the the same as the hints given from the caller.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-27 16:45:05 +01:00
Stefan Metzmacher
ff732ed6b5 s4:libcli/raw: use smb_setfsinfo_level in smb_setfsinfo
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:45 +01:00
Stefan Metzmacher
a51b6232d2 s4:libcli/tcon: remove unused smb2_tree_connect*()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
c723d57e66 s4:libcli/smb2: make use of smb2cli_tcon*() in connect.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
d11b0c4222 s3:libsmb: remove unused smb2cli.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
854f579372 s4:libcli/smb_composite: don't try anonymous smb signing
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Jeremy Allison
69a7e3cfdc s4: libcli: ldap message - Ensure all asn1_XX returns are checked.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 26 03:15:00 CEST 2014 on sn-devel-104
2014-09-26 03:15:00 +02:00
Jeremy Allison
b1a1f691c8 s4: libcli: ldap controls - Ensure all asn1_XX returns are checked.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-26 00:51:16 +02:00
Stefan Metzmacher
4b6febc670 s4:libcli/composite: correctly finish composite smb and smb2 requests
Without this we would hang forever if the connection was already disconnected,
instead of directly propagating NT_STATUS_CONNECTION_DISCONNECTED;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:10 +02:00
Christof Schmitt
aea680b7db s4:libcli/raw: Make flags2 and offset available to callers of readx
This will be used by smbtorture.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-30 00:27:13 +02:00
Volker Lendecke
f77c3a65db libcli: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-07-31 18:49:46 +02:00
Stefan Metzmacher
720189f246 s4:libcli/smb2: add smb2_session_channel()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:06 +02:00
Stefan Metzmacher
78e46d7349 s4:libcli/smb2: remove unused 'primary' argument of smb2_session_init()
This also gets rid of a talloc_reference() usage.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-07-24 19:07:05 +02:00
Volker Lendecke
1dda098401 libsmb: Put the "smb2_lease" struct into idl
This will make it easier in the future to NDR_PRINT a lease and
a lease key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 12 03:34:41 CEST 2014 on sn-devel-104
2014-06-12 03:34:41 +02:00
Andreas Schneider
2522bb8090 selftest: Rename WINBINDD_SOCKET_DIR environment variable.
It is very confusing if the env var uses the same name as the define in
the source code. So prefix it with SELFTEST.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andrew Bartlett
88ba81140e s4-wbclient: Fix wbc_sids_to_xids to correctly indicate the length of the SID list
This uses the fact that we know the end of the string in p to avoid
needing a strlen() call.  Otherwise the winbindd validation that the
extra_data is terminated may fail, if the un-initiliased memory is not
zero.

Andrew Bartlett

Change-Id: I9b28068e4fbd3754c8d14724af93638d657810dd
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr  9 18:26:40 CEST 2014 on sn-devel-104
2014-04-09 18:26:40 +02:00
Andrew Bartlett
9d91f01b7b s4-wbclient: Cope with winbind returning an error
Change-Id: I8eaf858f9e9e55eec20aa2c585db5459fb73b887
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Apr  8 12:53:13 CEST 2014 on sn-devel-104
2014-04-08 12:53:13 +02:00
Stefan Metzmacher
6788a4085c s4:libcli/tests: add missing #include "torture/local/proto.h"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:44 +02:00
Stefan Metzmacher
ba107816b5 s4:libcli/resolve: avoid some const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:43 +02:00
Stefan Metzmacher
7cd8fbcca5 s4:libcli: make use of gensec_update_ev()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-27 00:36:31 +01:00
Volker Lendecke
13affa6109 auth4: Remove unused wbc_context
Signed-off-by: Volker Lendecke <vl@samba.org>

Change-Id: I07d9f7d8028429564d91da39f8d1e73cc13a646c
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Volker Lendecke
dcf29a88ba libwbclient4: Remove unused composite-based functions
Signed-off-by: Volker Lendecke <vl@samba.org>

Change-Id: Iff6169e35f7a82e31c42df7b2d30d122b5f67451
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Volker Lendecke
53b7665fc2 libwbclient4: Add wbc_xids_to_sids
Signed-off-by: Volker Lendecke <vl@samba.org>

Change-Id: Ibb67f6aabd9a3fbd023ff9ec1a34d82ae599177c
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Volker Lendecke
22dabda4c6 libwbclient4: Add wbc_sids_to_xids
Signed-off-by: Volker Lendecke <vl@samba.org>

Change-Id: I79f4b87a14e7074970bd024626e5838a4461cc2e
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-05 16:33:21 +01:00
Garming Sam
c28d16e52d Define the winbindd socket directory when building wbclient
Change-Id: I2a730e41f45cff0f4836fbc8f993947e3a30aa18
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Feb 19 16:25:42 CET 2014 on sn-devel-104
2014-02-19 16:25:42 +01:00
Volker Lendecke
97a62e2279 Revert "libwbclient4: Add wbc_sids_to_xids"
This reverts commit fefc59619b.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-18 10:29:27 +01:00
Volker Lendecke
9017764a71 Revert "libwbclient4: Add wbc_xids_to_sids"
This reverts commit f275ce4e43.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-18 10:29:21 +01:00
Volker Lendecke
c1bffac7e5 Revert "libwbclient4: Remove unused composite-based functions"
This reverts commit ba5f02739c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-18 10:29:10 +01:00
Volker Lendecke
279ee16254 Revert "auth4: Remove unused wbc_context"
This reverts commit 6b04558c5e.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-02-18 10:28:41 +01:00
Volker Lendecke
6b04558c5e auth4: Remove unused wbc_context
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-10 10:57:42 +01:00
Volker Lendecke
ba5f02739c libwbclient4: Remove unused composite-based functions
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-10 10:57:14 +01:00
Volker Lendecke
f275ce4e43 libwbclient4: Add wbc_xids_to_sids
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-10 10:57:08 +01:00
Volker Lendecke
fefc59619b libwbclient4: Add wbc_sids_to_xids
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
2014-02-10 10:56:55 +01:00
Andrew Bartlett
fc77a69461 s4-resolve: Add lmhosts support into the source4 name resolve code
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-01-31 08:05:52 +01:00
Matthias Dieter Wallnöfer
0c2fbe5a0c samba:python - Py_RETURN_NONE remove compatibility code for releases < 2.4
http://www.python.org/doc//current/c-api/none.html

Reviewed-By: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date(master): Thu Jan  9 16:27:47 CET 2014 on sn-devel-104
2014-01-09 16:27:47 +01:00
Stefan Metzmacher
ef28ed685f libcli/smb: move some *TRANSACT_* flags to smb_constants.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:38 +01:00
Stefan Metzmacher
306cba4b8c libcli/smb: move some FILE_* flags to smb_constants.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:38 +01:00
Christian Ambach
2e1ed2c74b s4:libcli fix compiler warnings
about potentially uninitialized variables

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-12 14:21:28 -08:00
Jeremy Allison
0dc6181894 CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:46 +01:00
Jeremy Allison
b0ba4a5621 CVE-2013-4408:s3:Ensure LookupSids replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:46 +01:00
Andreas Schneider
9d53d9f7e5 s4-libcli: Add smb2_util_handle_empty().
Will be used in the next commit.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-06 01:14:09 +01:00
Stefan Metzmacher
e6eb6b9e94 libcli/smb: move Filesystem Attributes defines to smb_constants.h
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:08:29 +02:00
Volker Lendecke
064433f265 libcli4: Remove an unused variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Oct 13 17:58:23 CEST 2013 on sn-devel-104
2013-10-13 17:58:23 +02:00
Michael Adam
596f802d5d s4:libcli:smb2: make smbcli_options argument to smb2_connect_(send|ext) const
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05 14:04:07 +02:00
Michael Adam
5736f13400 s4:libcli:smb2: add the smb2_capabilities to the smbcli_options
and initialize them in lpcfg_smbcli_options() instead of
in smb2_transport_init() as previously.

This will allow us to control them from callers later.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05 14:04:07 +02:00
Michael Adam
4e99a0fbfe s4:libcli:smb2: add the client_guid to the smbcli_options
and initialize it in lpcfg_smbcli_options() instead of
in smb2_transport_init() as previously.

Having the client guid in the smbcli_options will allow
us to control them from callers later.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05 14:04:07 +02:00
Matthieu Patou
ea3db09f69 libcli: continue to read from the socket even if the size is 0
This is an issue found by Codenomicon, with a malicious packet with 0
bytes UDP payload we will continiously be looping trying to react from
the socket event and continiously do nothing as we will bail out
thinking that we had a memory allocation error.

Original fix comes from Volker Lendecke <vl@samba.org>

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 20 04:46:47 CEST 2013 on sn-devel-104
2013-09-20 04:46:47 +02:00
Howard Chu
b3bb304036 Prepare for SASL/EXTERNAL support
Signed-off-by: Howard Chu <hyc@symas.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
2013-09-18 19:47:55 +02:00
Volker Lendecke
1927676412 libsmb2: Fix opening the rootdirectory, part 1
[MS-SMB2], 2.2.13 says: In the request, the Buffer field MUST be at least one
byte in length. Implement that for the 0-length filename without create blobs.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:40 -07:00
Stefan Metzmacher
44b53937d5 libcli/smb: pass max_dyn_len to smb2cli_req_send()
This way we can calculate the correct credit charge
for requests with large output buffers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Volker Lendecke
d672535551 libcli: Fix improper use of tevent_req_simple_recv_ntstatus
tevent_req_simple_recv_ntstatus is just for the simple return without
anything to do after it.

Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:58 +12:00
Stefan Metzmacher
fd54ffa66c s4:libcli: avoid talloc_reference() in finddcs_nbt_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 16:48:47 +12:00
Stefan Metzmacher
71c63e85e7 auth/gensec: introduce gensec_internal.h
We should treat most gensec related structures private.

It's a long way, but this is a start.

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

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-10 09:19:02 +02:00
Jeremy Allison
c4cba824d9 Fix bug #10010 - Missing integer wrap protection in EA list reading can cause server to loop with DOS.
Fix client-side parsing also. Found by David Disseldorp <ddiss@suse.de>

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Mon Aug  5 14:39:04 CEST 2013 on sn-devel-104
2013-08-05 14:39:04 +02:00
Andrew Bartlett
fc13489c91 build: Build with system md5.h on OpenIndiana
This changes (again...) our system md5 detection to cope with how
OpenIndiana does md5.  I'm becoming increasingly convinced this isn't
worth our while (we should have just done samba_md5...), but for now
this change seems to work on FreeBSD, OpenIndiana and Linux with
libbsd.

This needs us to rename struct MD5Context -> MD5_CTX, but we provide a
config.h define to rename the type bad if MD5_CTX does not exist (it does
however exist in the md5.h from libbsd).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 19 21:32:36 CEST 2013 on sn-devel-104
2013-06-19 21:32:36 +02:00
Volker Lendecke
5f82641553 libsmb: Use sizeof instead of explicit numbers
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Apr 30 16:02:19 CEST 2013 on sn-devel-104
2013-04-30 16:02:19 +02:00
Volker Lendecke
b8c1e30a6f libsmb: Use smb2_lease_push in smb2_create_send
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-30 14:14:44 +02:00
Volker Lendecke
96a8f6e0fb libsmb: Move "struct smb2_lease" to common
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-30 14:13:41 +02:00
Sam Lang
727c611fe3 source4/libcli: Only set ctemp set on success
If open fails ctemp.out.name probably won't be valid and strdup
will cause a segv.  Only set the path if open succeeds.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 24 23:58:44 CEST 2013 on sn-devel-104
2013-04-24 23:58:43 +02:00
Stefan Metzmacher
3c9846cafd s4:torture/smb2: add smb2_lease_v2_create_share() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-18 15:11:48 +02:00
Stefan Metzmacher
6c81893b34 s4:libcli/smb2: add support for SMB2 LEASES v2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-18 15:11:48 +02:00
Andreas Schneider
5207d456f1 s4-libcli: Check return value of smbcli_request_setup().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:13 +01:00
Andreas Schneider
318ecbc208 s4-libcli: Check return code of smbcli_request_setup().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Andreas Schneider
a3ac48d07f s4-libcli: Add null check for ndr functions in rap.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:12 +01:00
Andrew Bartlett
dcc94f0933 s4-nbt: Ensure source4/ nbt client and server honour 'disable netbios'
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Feb 17 11:25:34 CET 2013 on sn-devel-104
2013-02-17 11:25:34 +01:00
Landon Fuller
6dfb35f3ff Fallback to the internal resolver on EAI_FAIL.
On Linux, non-RFC 1034-complaint names (such as gc._msdsc.example.org)
will result in the resolver returning the non-POSIX EAI_NODATA. In that
case, the case statement here would fall back on the internal resolver,
allowing resolution to complete successfully.

On FreeBSD, the libc resolver uses the same validation code, but
the POSIX result of EAI_FAIL is returned instead of EAI_NODATA. Since
there was no case for this error code, no fallback to the internal
resolver would occur. This led to replication failing on FreeBSD.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Feb 17 07:06:36 CET 2013 on sn-devel-104
2013-02-17 07:06:36 +01:00
David Disseldorp
65983aac12 smb2_ioctl: remove ioctl error response assumptions
MS-SMB2 3.3.4.4 documents cases where a ntstatus indicating an error
should not be considered a failure. In such a case the output data
buffer should be sent to the client rather than an error response
packet.

Add a new fsctl copy_chunk test to confirm field limits are sent back
in response to an oversize chunk request.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:07 +01:00
Arvid Requate
bdc172aca5 s4-resolve: Fix parsing of IPv6/AAAA in dns_lookup (bug #9555)
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-12 10:32:28 +01:00
Andreas Schneider
bc3edaa6ad s4-libcli: Use a do-while loop.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:01 +01:00
Andreas Schneider
b4accd365d s4-libcli: Fix comparison of chosen_oid.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Stefan Metzmacher
a42c49c93a s4:libcli/finddcs_cldap: allow io->in.server_address as hostname
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-02 23:24:58 +01:00
Stefan Metzmacher
c4d51d8d17 s4:libcli/finddcs_cldap: try all NBT#1C addresses
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-12-02 23:19:28 +01:00
Andrew Bartlett
d6c7e9b1ed smbd: Remove NT4 compatability handling in posix -> NT ACL conversion
NT4 is long dead, and we should not change which ACL we return based
on what we think the client is.  The reason we should not do this, is
that if we are using vfs_acl_xattr then the hash will break if we do.
Additionally, it would require that the python VFS interface set the
global remote_arch to fake up being a modern client.

This instead seems cleaner and removes untested code (the tests are
updated to then handle the results of the modern codepath).

The supporting 'acl compatability' parameter is also removed.

Andrew Bartlett

Reviewed by: Jeremy Allison <jra@samba.org>
2012-11-13 22:48:19 +01:00
Andrew Tridgell
0e6c5c036f s4-ldapclient: cope with logon failure retry in LDAP
similar to what was done for rpc and cifs, we now retry once on logon
failure for ldap, allowing for a new ticket to be fetched when a
server password changes while we have a valid ticket for the old
password

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:41 +11:00
Andrew Tridgell
d4ea637eb8 libcli: use cli_credentials_failed_kerberos_login() to cope with server changes
if a server changes while we have a valid ticket we want to retry
after removing the ccache entry.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2012-11-01 15:40:40 +11:00
Michael Adam
a397c85164 s4:libci: add a SMB2_CREATE_APP_INSTANCE_ID blob to the request if the in.app_instance_id is present 2012-09-19 21:21:37 +02:00
Michael Adam
562719f75f s4:libcli: add a app_instance_id member to the smb2_create input struct 2012-09-19 21:21:37 +02:00
Matthias Dieter Wallnöfer
c8bfb8eb09 s4:dsdb - always fail if a search filter could not be parsed
A NULL string/expression returns the generic "(objectClass=*)" filter

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-22 01:31:55 +02:00
Stefan Metzmacher
e2b07c0adc s4:libcli/smb2: reset trsnport->compound.related when a compound chain is finished
metze
2012-08-17 14:51:57 +02:00
Björn Jacke
13f8674a15 build: rename security → samba-security
there is a libsecurity on OSF1 which clasheѕ with our security lib. see bug #9023.

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

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Aug 10 14:22:21 CEST 2012 on sn-devel-104
2012-08-10 14:22:20 +02:00
Christian Ambach
b20fb153e1 s4:libcli/smb2/write correct error checking
Server might return STATUS_BUFFER_OVERFLOW, which is not caught by NT_STATUS_IS_ERR

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Aug  6 20:01:01 CEST 2012 on sn-devel-104
2012-08-06 20:01:01 +02:00
Stefan Metzmacher
efe28b1247 s4:libcli/pyerrors: add PyErr_NTSTATUS_NOT_OK_RAISE()
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Aug  6 18:06:50 CEST 2012 on sn-devel-104
2012-08-06 18:06:50 +02:00
Stefan Metzmacher
a370792cbc s4:libcli/pyerrors: s/PyErr_WERROR_IS_ERR_RAISE/PyErr_WERROR_NOT_OK_RAISE/
metze
2012-08-06 15:50:16 +02:00
Stefan Metzmacher
67767de4e9 s4:libcli: add support for SMB_EXTENDED_SIGNATURES during SMBtconX
metze
2012-08-04 09:10:22 +02:00
Stefan Metzmacher
95b64f08a3 s4:libcli: send the TCONX_FLAG_EXTENDED_RESPONSE flag
metze
2012-08-02 09:00:24 +02:00
Stefan Metzmacher
d3aaa1ebc8 libcli/smb: move some TCON related defines to smb_constants.h
metze
2012-08-01 14:17:16 +02:00
Stefan Metzmacher
00cde56bfd s4:libcli/raw: remove unused smbcli_session->user_session_key
metze
2012-08-01 14:17:14 +02:00
Stefan Metzmacher
ac1452c4f9 s4:libcli/smb_composite: make use of smb1cli_session_set_session_key()
metze
2012-08-01 14:17:12 +02:00
Stefan Metzmacher
1a9a910ce3 s4:libcli/smb_composite: always use set_user_session_key() helper
metze
2012-08-01 14:17:12 +02:00
Stefan Metzmacher
0aac3c09f1 libcli/smb: pass smbXcli_session to smb2cli_tcon_set_values()
metze
2012-07-25 14:48:50 +02:00
Stefan Metzmacher
4d6d783afe s4:libcli/smb2: remove unused smb2_session->pid
metze
2012-07-25 12:15:05 +02:00
Stefan Metzmacher
e20e84d527 s4:libcli/smb2: remove unused variable
metze
2012-07-25 12:15:05 +02:00
Stefan Metzmacher
56aa419d87 libcli/smb: there's no PID field in the SMB2/3 header anymore
It's a reserved field...

metze
2012-07-25 12:15:05 +02:00
Stefan Metzmacher
7de4ae7f9f libcli/smb: pass smbXcli_tcon to smb2cli_req_create/send()
metze
2012-07-25 12:15:04 +02:00
Stefan Metzmacher
57fda88dfb s4:libcli/smb2: remove unused elements from smb2_tree
metze
2012-07-25 12:15:04 +02:00
Stefan Metzmacher
41538b17c5 s4:libcli/smb2: setup a smbXcli_tcon for each smb2_tree
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
b9100a7ac4 libcli/smb: pass down smbXcli_tcon to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 21:22:44 CEST 2012 on sn-devel-104
2012-07-24 21:22:44 +02:00
Stefan Metzmacher
29dc01b175 s4:libcli/raw: setup a smbXcli_tcon for each smbcli_tree
metze
2012-07-24 18:44:05 +02:00
Stefan Metzmacher
cc0d490630 s4:libcli/raw: parse extended SMBtconX responses
metze
2012-07-24 18:44:04 +02:00
Stefan Metzmacher
a6e5b98827 s4:libcli/raw: fix SMBtconX response parsing
metze
2012-07-24 18:44:03 +02:00
Stefan Metzmacher
43b070d8dd libcli/smb: pass down smbXcli_session to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 00:08:58 CEST 2012 on sn-devel-104
2012-07-24 00:08:58 +02:00
Stefan Metzmacher
af90c71ed8 s4:libcli/raw: setup a smbXcli_session for each smbcli_session
metze
2012-07-23 22:13:29 +02:00
Amitay Isaacs
e3828d4ccb s4-pysmb: Add deltree() method to remove directory and its contents
Thanks to Denis Bonnenfant <denis.bonnenfant@diderot.org> for patch.
2012-07-03 15:20:41 +10:00
Matthieu Patou
f110f2d63f s4-ldap: handle VERIFY_NAME control encoding/decoding 2012-06-22 23:22:02 -07:00
Amitay Isaacs
0c29804bb0 s4-pysmb: Parse security info as an unsigned integer 2012-06-21 09:41:46 +10:00
Andrew Bartlett
7f498f8987 Revert "s4-libcli: Remove unused finddcs_nbt"
This reverts commit 06c90cb6f5.

There is genuine interest in using this currently unused code, so put
it back into the tree to avoid folks having to rewrite it.

It should be carefully hooked back into libnet at some point, and
possibly told how to talk to the s3 nmbd socket if nbt_server isn't
running.

The wscript patches are skipped, due to the way the extra
dep interacted with the build system.  When used, this will be resolved.

Andrew Bartlett
2012-06-20 16:22:40 +10:00
Andrew Bartlett
06c90cb6f5 s4-libcli: Remove unused finddcs_nbt
This would only do the NBT getdc lookup for a single DC (but would
find multiple DCs at first stage), but more particular it of course
uses Netbios rather than DNS names.

In any case it was also unused, as we use CLDAP for reliable DC
location these days.

Found by callcatcher

Andrew Bartlett
2012-06-07 06:45:06 +02:00
Alexander Bokovoy
f32d43763d dns: fix comments and make s4/libcli/resolve dns resolver working
After migrating to use libaddns, reply_to_addrs() needed to change the
way answers are iterated through. Originally libroken implementation
gave all answers as separate records with last one being explicitly NULL.
libaddns unmarshalling code gives all non-NULL answers and should be
iterated with explicit reply->num_answers in use.
2012-05-23 17:51:49 +03:00
Simo Sorce
c54fe86a63 s4-resolve: Remove dependency on libroken
Use available native samba resolver functions
2012-05-23 17:51:49 +03:00
Michael Adam
d36aecc9c5 s4:libcli:raw: fix a comment typo in smb_setfileinfo()
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue May  8 20:45:16 CEST 2012 on sn-devel-104
2012-05-08 20:45:16 +02:00
Stefan Metzmacher
49acba37e7 s4:libcli/smb2: use PROTOCOL_LATEST
metze
2012-05-06 14:50:39 +02:00
Stefan Metzmacher
42b403c19f libcli/smb: move SMB2_IOCTL_FLAG_IS_FSCTL to smb2_constants.h
metze
2012-04-27 08:31:37 +02:00
Andrew Bartlett
e346bba1fc s4-torture: enable raw.composite test again, and convert to new style test
This test has been skipped for some time, but is an important test for parallel operation.

Andrew Bartlett
2012-04-25 17:43:23 +10:00
Jeremy Allison
c1dbbbc40c Add smb_raw_setfsinfo() - currently only available level is SMB_SET_CIFS_UNIX_INFO. 2012-04-18 12:38:52 -07:00
Michael Adam
9e9887d323 s4:samdb:rootdse: implement the schemaUpgradeInProgress operation in ldap modify
This is preliminary in that it is implemented as a no-op for a start
just to be able to successfully answer the request, which seems to be
sufficient in order to e.g. survive the exchange schema extensions.

Signed-off-by: Matthieu Patou <mat@matws.net>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Apr 18 02:48:28 CEST 2012 on sn-devel-104
2012-04-18 02:48:28 +02:00
Stefan Metzmacher
51e3bbd3e0 s4:libcli/smb2: fix anonymous session setups against windows servers
Windows server doesn't set the SMB2_SESSION_FLAG_IS_GUEST nor
SMB2_SESSION_FLAG_IS_NULL flag.

This fix makes sure we don't try to verify a signature on the
final session setup response.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Apr 16 14:44:46 CEST 2012 on sn-devel-104
2012-04-16 14:44:46 +02:00
Stefan Metzmacher
daa5cec1ba s4:libcli/smb2: remove unused dependency to LIBPACKET
metze
2012-04-16 12:54:54 +02:00
Richard Sharpe
2c322ca95a Fix some of the issues that Jelmer identified in my first patch. This might be
changed again, especially when I figure out how to return the file as an
object.

Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Apr  2 01:43:44 CEST 2012 on sn-devel-104
2012-04-02 01:43:44 +02:00
Richard Sharpe
36101d3fa4 Add an open and close method to samba.smb.SMB so we can open and close files.
Also, fix up some documentation.

Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Sun Apr  1 16:29:52 CEST 2012 on sn-devel-104
2012-04-01 16:29:52 +02:00
Richard Sharpe
cb7220d721 Fix the PyDoc comments in samba.smb.SMB and add a security_info argument to both get_acl and set_acl to allow the caller to specify what info is wanted. Defaults to 0 which means all info.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Mar 26 04:05:25 CEST 2012 on sn-devel-104
2012-03-26 04:05:24 +02:00
Jelmer Vernooij
d9975a13fd LIBCLI_SMB2: Depend on cli_smb_common rather than libsmb.
The latter pulls in a fair number of other libraries, including popt and the Samba registry library.
2012-03-25 17:15:42 +02:00
Jelmer Vernooij
48c2f803e8 libsmbclient-raw: Install smb_composite.h.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Mar 15 02:57:59 CET 2012 on sn-devel-104
2012-03-15 02:57:59 +01:00
Gregor Beck
7e9a4c6c11 s4:libcli/smb2: allow smb2_session_setup_spnego to handle reauth
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-07 10:57:27 +01:00
Amitay Isaacs
b47959a5c5 s4-libcli: pysmb: Fix typo in secinfo_flags
Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Wed Mar  7 10:56:09 CET 2012 on sn-devel-104
2012-03-07 10:56:09 +01:00
Michael Adam
f6047afb2d s4:libcli:smb2: set SMB2_CAP_ALL in the negprot 2012-03-03 17:03:07 +01:00
Michael Adam
1451e5f663 s4:libcli:smb2: store the share capabilites in the smb2_tree object 2012-03-03 17:03:07 +01:00
Michael Adam
ac43937ce4 smbXcli: add the possiblilty to negotiate client capabilites in smb >= 2.2
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-03 17:03:07 +01:00
Michael Adam
5a5f98dc70 s4:libcli:smb2: allow max protocol 0x0224 2012-03-03 17:03:07 +01:00
Michael Adam
a92b5f33de s4:libcli:smb2: add support for parsing the durable handle v2 response in smb2_create_recv() 2012-03-03 17:03:07 +01:00
Michael Adam
dfbf55bb36 s4:libcli:smb2: add support durable handle reconnect v2 blob in smb2_create_send 2012-03-03 17:03:07 +01:00
Michael Adam
b1a2ab1fa9 s4:libcli:smb2: add support durable handle request v2 blob in smb2_create_send 2012-03-03 17:03:06 +01:00
Michael Adam
edeed1552d s4:libcli:smb2: add durable handle v2 data to the smb2_create i/o structure 2012-03-03 17:03:06 +01:00
Michael Adam
28b77605c4 s4:libcli:smb2: add a smb2_connect_ext variant of smb2_connect that takes a previous_session argument 2012-02-28 00:08:54 +01:00
Michael Adam
e9210987c6 s4:libcli:smb2: add a previous session argument to smb2_connect_send() 2012-02-28 00:08:53 +01:00
Michael Adam
69a64e6695 s4:libcli:smb2: add a previous session argument to smb2_session_setup_spnego()
So that we can do a session reconnect.
2012-02-28 00:08:53 +01:00
Michael Adam
727f3ee6ac s3:libsmb:smb2: pass previous session ID to session setup, not previous session
We only need the session, and under some circumstances, it might complicate
things for the caller to have to cope with the whole structure (talloc...).
2012-02-28 00:08:52 +01:00
Stefan Metzmacher
b7684f2ac6 s4:libcli/smb2: remove unused 'session_key' from struct smb2_session
metze
2012-02-27 12:51:34 +01:00
Stefan Metzmacher
aa4331be9e libcli/smb/smbXcli: maintain smb2 channel_signing_key separate from the signing_key
The signing_key is fix across all channels and is used for session setups
on a channel binding.

Note:
 - the last session setup response is signed with the new channel signing key.
 - the reauth session setups are signed with the channel signing key.

It's also not needed to remember the main session key.

metze
2012-02-27 12:51:33 +01:00
Michael Adam
fe24ab4e53 s4:smbcli:smb2: add a random GUID to the transport connection in smb2_transport_init()
This GUID is used in the smb2 negprot when max protocol is bigger than 0x0202.
According to section 2.2.3 of the MS-SMB2 document, the Client GUID filed in the
SMB2 negotiate request must be filled with a (non-zero) GUID if there are other
dialects than 0x0202 in the dialects field.

http://msdn.microsoft.com/en-us/library/cc246543%28v=prot.13%29.aspx

Apart from corresponding to the docs, this change makes some of our durable-open
tests (e.g reopen2 and open-oplock) _not_ hang when running against windows 8
preview (which might be still buggy).

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Feb 23 03:23:57 CET 2012 on sn-devel-104
2012-02-23 03:23:57 +01:00
Michael Adam
6a93475dd0 s4:libcli:smb2: don't allocate the smb2_tree struct earlier than necessary in smb2_connect()
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-02-03 11:10:30 +01:00
Michael Adam
97823b69e9 s4:libcli/torture:smb2: change smb2_tree_connect to take a smb2_session instead of smb2_tree arguement.
Only the tree->session is needed. This way it is less confusing.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-02-03 11:10:30 +01:00
Matthias Dieter Wallnöfer
2bc7b8f4c9 s4:libcli/finddcs_nbt.c - free "req" consistently with "finddcs_cldap.c"
It is more obvious to free where the context for the first time appears.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-12-23 10:36:19 +01:00
Stefan Metzmacher
35605fa0a3 s4:libcli/rap: the caller should get talloc children from call->ndr_pull_{param,data}
This should fix the flakey 'rap.printing.rap_printq_getinfo' test,
see https://git.samba.org/autobuild.flakey/2011-12-16-0022/samba4.stdout

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 16 13:11:42 CET 2011 on sn-devel-104
2011-12-16 13:11:42 +01:00
Stefan Metzmacher
0e04cc2ea4 s4:libcli/rap: call->ndr_push_{param,data} can be talloc childs of 'call'
metze
2011-12-16 11:31:48 +01:00
Stefan Metzmacher
17781b1c86 s4:libcli/rap: use talloc_zero() and initialize everything
metze
2011-12-16 11:31:48 +01:00
Stefan Metzmacher
850b374ded s4:libcli/rap: remove unused members from struct rap_call
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 16 10:53:42 CET 2011 on sn-devel-104
2011-12-16 10:53:42 +01:00
Stefan Metzmacher
d0ff10d40c s4:libcli/rap: initialize call->rcv_datalen
metze
2011-12-16 09:20:08 +01:00
Andrew Bartlett
079d1572c2 s4-resolv: fix dns_ex so as to fail correctly when a name does not exist
Without this, netbios name lookups do not work, as we never fall back to them.

This caused segfaults from e38d97e042 to
251209bd6f and then name lookup failure
or timeouts until this patch.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Dec 14 01:16:37 CET 2011 on sn-devel-104
2011-12-14 01:16:37 +01:00
Stefan Metzmacher
4e57bb0b36 s4:libcli/smb2: mark a request as error if we can't ship it
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec  9 15:13:11 CET 2011 on sn-devel-104
2011-12-09 15:13:11 +01:00
Stefan Metzmacher
4486336bd8 s4:libcli/raw: mark a request as error if we can't ship it
metze
2011-12-09 13:38:37 +01:00
Matthieu Patou
059523e203 s4-resolver: do not use all the A and AAAA records, those after a NS are not the one we want to use 2011-12-05 18:23:08 +01:00
Stefan Metzmacher
4afbda221c s4:libcli/raw: implement on top of smbXcli_conn/req
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov 30 15:13:36 CET 2011 on sn-devel-104
2011-11-30 15:13:36 +01:00
Stefan Metzmacher
99ef6a4bec s4:libcli: do the nbss session request within smbcli_sock_connect_*()
metze
2011-11-30 13:41:09 +01:00
Stefan Metzmacher
52dd549eb6 s4:libcli/raw: remove unused functions
metze
2011-11-30 13:41:08 +01:00
Stefan Metzmacher
b21f344079 s4:libcli: use smbcli_sock_connect() in smbcli_socket_connect()
metze
2011-11-30 13:41:08 +01:00
Stefan Metzmacher
4877be53df s4:libcli: move smbcli_transport_establish() logic into smbcli_socket_connect()
metze
2011-11-30 13:41:08 +01:00
Stefan Metzmacher
b51c92a903 s4:libcli: convert smbcli_transport_connect_* to tevent_req
metze
2011-11-30 13:41:08 +01:00
Stefan Metzmacher
6b5cfa39f2 s4:libcli/raw: copy smbcli_transport_connect_* to clisocket.c
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Nov 29 17:34:52 CET 2011 on sn-devel-104
2011-11-29 17:34:52 +01:00
Stefan Metzmacher
b3d3395e01 s4:libcli/raw: add transport->ev as copy of transport->socket->event.ctx
We'll remove transport->socket soon, but removing transport->ev
will take a bit longer.

metze
2011-11-29 16:00:08 +01:00
Stefan Metzmacher
04fa5b4957 s4:libcli/smb2: make sure only one idle event runs at a time
metze
2011-11-29 16:00:08 +01:00
Matthias Dieter Wallnöfer
ad19aa6331 s4:libcli/finddcs_cldap.c - let "finddcs_cldap" work either with the IP address or the domain name
This will be useful for a new "samba-tool domain info" command.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-26 10:26:52 +01:00
Stefan Metzmacher
4958d7cb44 s4:libcli/smb2: use talloc_zero() in smb2_request_init()
metze
2011-11-24 19:02:33 +01:00
Stefan Metzmacher
f132ad32cc s4:libcli/smb2: fix compiler warning in smb2_push_o16s16_string()
metze
2011-11-24 19:02:33 +01:00
Stefan Metzmacher
300343d16c s4:libcli/smb2: implement on top of smbXcli_conn/req
metze
2011-11-24 19:02:33 +01:00
Stefan Metzmacher
88bcdbb16a s4:finddcs_cldap: debug the correct server address instead of NULL
metze
2011-11-10 14:59:10 +01:00
Matthieu Patou
2a8650ed79 s4-resolver: fix bug with DNS servers returning AAAA records when asked for A records
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sun Nov  6 03:18:00 CET 2011 on sn-devel-104
2011-11-06 03:18:00 +01:00
Günther Deschner
6e67073900 waf: convert NDR_NBT into shared library.
Guenther
2011-11-03 18:35:09 +01:00
Günther Deschner
e426f37b64 librpc: only let NDR_NBT depend on NDR_NBT_BUF.
Guenther
2011-11-03 18:35:08 +01:00
Stefan Metzmacher
f07274978a s4:libcli/smb2: s/SMB_SIGNING_SUPPORTED/SMB_SIGNING_IF_REQUIRED/
metze
2011-11-03 16:55:12 +01:00
Stefan Metzmacher
2d55bfd8de s4:libcli/raw: s/SMB_SIGNING_SUPPORTED/SMB_SIGNING_IF_REQUIRED/
metze
2011-11-03 16:55:12 +01:00
Stefan Metzmacher
01ccd59ce0 s4:libcli/smb2: remove unused SMB_SIGNING_AUTO handling
metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
4fe0e828af s4:libcli/raw: remove unused SMB_SIGNING_AUTO handling
metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
22902ef9b8 s4:libcli/smb2: SMB_SIGNING_DEFAULT matches SMB_SIGNING_SUPPORTED on the client for now
metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
0789fbf697 s4:libcli/raw: SMB_SIGNING_DEFAULT matches SMB_SIGNING_SUPPORTED on the client for now
metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
f293438abd s4:libcli/smb2: let SMB_SIGNING_AUTO behave like SMB_SIGNING_SUPPORTED
This matches the smb1 behavior.

metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
418908eb21 s4:libcli/raw: only use smb signing if required
This matches the source3 code, I want to have the behavior
in common before I put the config options in common.
Later we may change this consitently in all code.

metze
2011-11-03 16:55:11 +01:00
Matthieu Patou
251209bd6f s4-resolver: make it work back with ipv4 only DNS records
It turns out that if there is no AAAA record the dns server (bind and MS
windows at least) do not return the A record when just asked for AAAA.

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Nov  2 11:15:34 CET 2011 on sn-devel-104
2011-11-02 11:15:34 +01:00
Michael Adam
530cd2aac6 s4:libcli: in smb2_create_recv, map SMB2_CREATE_DURABLE_HANDLE_RESPONSE buffer smb2_create.out.durable_open 2011-10-30 18:41:22 +01:00
Michael Adam
d01b248d4f source4/libcli: add bool durable_open to smb2_create.out.
The server gives indication whether the open was durable
we should record this.
2011-10-30 18:41:21 +01:00
Andreas Schneider
7b5fb7d9e8 replace: Add don't include unistd.h directly and add uid_wrapper. 2011-10-27 13:32:02 +02:00
Stefan Metzmacher
0d9bd56afb libcli/smb: merge NEGOTIATE_SECURITY_* flags to smb_constants.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 26 11:27:12 CEST 2011 on sn-devel-104
2011-10-26 11:27:12 +02:00
Stefan Metzmacher
ad3cabb6cb s4:libcli: rename smb_signing.h to smb_raw_signing.h in the install directory
metze
2011-10-25 00:24:07 +02:00
Stefan Metzmacher
f3c25bc6a5 libcli/smb: merge LOCKING_ANDX_* and OPLOCK_* defines to smb_constants.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 24 17:46:47 CEST 2011 on sn-devel-104
2011-10-24 17:46:47 +02:00
Stefan Metzmacher
2414169241 s4:libcli/raw: remove unuded CMD_REPLY define
metze
2011-10-24 16:10:37 +02:00
Stefan Metzmacher
ec7cc700b2 libcli/smb: move more defines to smb_constants.h
metze
2011-10-24 16:10:36 +02:00
Stefan Metzmacher
6fef69562b libcli/smb: move CAP_* defines to smb_constants.h
metze
2011-10-24 16:10:36 +02:00
Stefan Metzmacher
60d9afa806 s4:finddcs_cldap: talloc free old memory before allocating a new netlogon struct
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Oct 22 04:55:54 CEST 2011 on sn-devel-104
2011-10-22 04:55:53 +02:00
Stefan Metzmacher
7e4e4d0909 s4:finddcs_cldap: close the socket when it's not used anymore
The amount of possible fd's might be restricted, so close them early.

metze
2011-10-22 03:20:09 +02:00
Stefan Metzmacher
40dc29bca7 s4:finddcs_cldap: finddcs_cldap_recv() returns NTSTATUS
We need to convert the errno based error to NTSTATUS
before calling tevent_req_error (via tevent_req_nterror).

metze
2011-10-22 03:11:57 +02:00
Matthieu Patou
950f1218b3 s4-cldap: fix cldap_socket_init to always specify the dest if local is NULL
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sat Oct 22 00:02:00 CEST 2011 on sn-devel-104
2011-10-22 00:01:59 +02:00
Matthieu Patou
e38d97e042 s4-resolv: fix resolution of SRV records pointing to A and AAAA records 2011-10-21 22:29:09 +02:00
Stefan Metzmacher
32938ce60d libcli/smb: move some common defines to smb_constants.h
metze
2011-10-21 08:42:59 +02:00
Stefan Metzmacher
ba08ad5f39 s4:libcli/raw: remove unused smb_len(), _smb_setlen() and _smb2_setlen() macros
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 19 17:15:23 CEST 2011 on sn-devel-104
2011-10-19 17:15:23 +02:00
Stefan Metzmacher
8574d509a9 s4:libcli/smb2: make use of _smb_setlen_tcp()
metze
2011-10-19 15:44:29 +02:00
Stefan Metzmacher
8eed525e0b s4:libcli/raw: make use of _smb_setlen_nbt()
metze
2011-10-19 15:44:29 +02:00
David Disseldorp
5e6c477ef8 s3: remove duplicate fsctl fn definitions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-19 15:44:29 +02:00
David Disseldorp
281fc93c6b libcli: move ioctl function field defs to smb_constants
Currently there are a lot of duplicate ioctl function field definitions
between source3 and source4.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-19 15:44:29 +02:00
Andrew Bartlett
e7d5f0a357 gensec: move event context from gensec_*_init() to gensec_update()
This avoids keeping the event context around on a the gensec_security
context structure long term.

In the Samba3 server, the event context we either supply is a NULL
pointer as no server-side modules currently use the event context.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-18 13:13:33 +11:00
Andrew Bartlett
b21b012756 lib/param move source4 param code to the top level
This is done so that the lpcfg_ functions are available across the whole
build, either with the struct loadparm_context loaded from an smb.conf directly
or as a wrapper around the source3 param code.

This is not the final, merged loadparm, but simply one step to make
it easier to solve other problems while we make our slow progress
on this difficult problem.

Andrew Bartlett
2011-10-11 13:41:34 +11:00
Stefan Metzmacher
b787b6e1bd libcli/cldap: don't pass tevent_context to cldap_socket_init()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 10 23:23:07 CEST 2011 on sn-devel-104
2011-10-10 23:23:07 +02:00
Stefan Metzmacher
2cd76b0931 libcli/cldap: pass tevent_context to cldap_netlogon_send()
metze
2011-10-10 21:50:26 +02:00
Andrew Tridgell
7244e254cc s4-ldap: added DSDB_CONTROL_NO_GLOBAL_CATALOG to ldap encoding list
also remove all the duplicated comments

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-04 15:08:58 +11:00
David Disseldorp
08573c2b92 s4: add SMB2_FSCTL opcodes
Also, skip samba4.smb2.ioctl for now. Snapshots are not supported by
default.

Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Thu Sep 29 14:47:05 CEST 2011 on sn-devel-104
2011-09-29 14:47:05 +02:00
Stefan Metzmacher
1f4bf0fb0f s4:libcli/smb2: ignore SMB2_OP_CANCEL responses
If there're a problem with signing or the session doesn't exists
any more the server responses with a failure, instead of not
sending a response.

For now we ignore the reponse, as there's not much we could do with it
and it's not likely that we generate bad requests, which trigger
that behavior, except for testing.

metze
2011-09-28 17:29:12 +02:00
Stefan Metzmacher
caef1c7d21 s4:libcli/smb2: correctly sign SMB2_OP_CANCEL request if they belong to a session
metze
2011-09-28 17:29:11 +02:00
Stefan Metzmacher
28b48f8498 s4:libcli/smb2: don't try to check the signing if we got NT_STATUS_USER_SESSION_DELETED
metze
2011-09-28 17:29:11 +02:00
Jelmer Vernooij
f4fa725b95 libcli: Install libcli.h.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Wed Sep 28 14:19:20 CEST 2011 on sn-devel-104
2011-09-28 14:19:20 +02:00
Stefan Metzmacher
14c05cf93a s4:libcli/resolve: only try broadcast messages to ipv4 addresses
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep 28 05:10:53 CEST 2011 on sn-devel-104
2011-09-28 05:10:53 +02:00
Jelmer Vernooij
c74de09d81 libcliraw: Make smb_raw_write_recv public and include it in a public header.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Sep 25 17:12:05 CEST 2011 on sn-devel-104
2011-09-25 17:12:05 +02:00
Matthias Dieter Wallnöfer
50310ad75d s4:auth - remove unused variables
Reviewed-by: Jelmer
2011-09-19 16:31:07 +02:00
Stefan Metzmacher
e6a2affe89 s4:libcli/wrepl: return NT_STATUS_CONNECTION_DISCONNECTED
We should return the same in all places.

metze
2011-09-14 18:03:19 +02:00
Andrew Bartlett
21c2e8b378 build: make LIBWBCLIENT_OLD and auth_unix_token libraries
This assists with avoiding duplicate symbols.

Andrew Bartlett
2011-09-08 19:33:13 +10:00
Stefan Metzmacher
3102bc9424 s4:libcli/raw: make use of PROTOCOL_SMB2_02
metze
2011-09-05 13:25:00 +02:00
Jeremy Allison
ef3bb09db6 RAW_SFILEINFO_RENAME_INFORMATION_SMB2 sends 4 bytes of uninitialized data out on the network.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Aug 27 07:48:30 CEST 2011 on sn-devel-104
2011-08-27 07:48:29 +02:00
Jelmer Vernooij
292fe74971 credentials: Rename library to samba-credentials to avoid name clashes.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Aug 18 22:16:38 CEST 2011 on sn-devel-104
2011-08-18 22:16:38 +02:00
Jelmer Vernooij
9ee1e1f0ac cli-raw: Add public libsmbclient-raw library. 2011-08-18 14:19:18 +02:00
Jelmer Vernooij
6fefd217ca libcliraw: Install more header files. 2011-08-18 14:01:12 +02:00
Jelmer Vernooij
f0d15e8ffa smb_common: Install some more headers. 2011-08-18 13:43:42 +02:00
Jelmer Vernooij
9fc20f4d26 libcliraw: Install request.h and signing.h. 2011-08-18 13:31:03 +02:00
Jelmer Vernooij
6e8f6da31a smb_composite: Remove unnecessary include of signing header. 2011-08-18 13:08:34 +02:00
Jelmer Vernooij
56f7bebd3a smb_composite: Integrate prototypes in header file. 2011-08-18 12:59:25 +02:00
Simo Sorce
ab81505e08 s4:libcli: use tevent_ fn names instead of legacy event_ ones 2011-08-13 09:54:15 -04:00
Jelmer Vernooij
f8ec7f6cb1 pytalloc: Use consistent prefix for functions, add ABI file. 2011-08-10 15:36:21 +02:00
Andrew Bartlett
af5f494bd2 build: provide tevent-util as a public library
This is needed so that OpenChange can get at _tevent_req_nterr(), which is referenced
by generated PIDL output.

Andrew Bartlett
2011-08-08 13:34:06 +02:00
Andrew Bartlett
35b309fa0c gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett
2011-08-03 18:48:02 +10:00
Andrew Bartlett
16b2118b43 gensec: split GENSEC into mechanism-dependent and runtime functions
The startup and runtime functions that have no dependencies are moved
into the top level.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:01 +10:00
Amitay Isaacs
f854209996 s4-libcli: Fix the fd leak. Close open file descriptor before return.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Aug  3 07:49:12 CEST 2011 on sn-devel-104
2011-08-03 07:49:12 +02:00
Amitay Isaacs
65dcf82e64 s4-libcli: get_acl and set_acl require raw_open to set security descriptor
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:04 +10:00
Amitay Isaacs
52d602335b s4-libcli: Check if short_name is not null, before converting to python string
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:02 +10:00
Amitay Isaacs
38b8d38b30 s4-libcli: Replace smb_composite_connect() with smb_full_connection()
Python smb connection now uses smb_full_connection method.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:00 +10:00