Jeremy Allison
4e709dc42f
Rename cli_open -> cli_openx. Prelude to replacing generic cli_open()
...
with a call that uses NTCreateX in preference to OpenAndX.
2011-12-03 21:13:08 -08:00
Volker Lendecke
1c46fb5c3e
s3: Use autogenerated open_files.idl
2011-12-02 22:43:05 +01:00
Jeremy Allison
3e0d923096
Ensure we map our own Samba return of ERRSRV, ERRunknownsmb
...
on an unknown SMB request to NT_STATUS_NOT_IMPLEMENTED.
2011-12-02 20:41:02 +01:00
Jeremy Allison
af76d2588c
After a discussion with Volker, sdd a backup_intent state to the client struct.
...
This causes the backup_intent flags to be added to findfirst/findnext
and ntcreate/nttrans_create calls.
cli_set_backup_intent() sets the flag and returns the old value of
its state.
2011-12-01 13:24:22 -08:00
Volker Lendecke
29735327f6
s3: Add some const
...
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Nov 25 10:21:07 CET 2011 on sn-devel-104
2011-11-25 10:21:07 +01:00
Stefan Metzmacher
b01d80a25e
s3:smb2cli: zero tid in smb2cli_tdis*
...
metze
2011-11-24 19:02:33 +01:00
Stefan Metzmacher
cc67f7e548
s3:smb2cli: free session in smb2cli_logoff*
...
metze
2011-11-24 19:02:33 +01:00
Stefan Metzmacher
ee36217c40
s3:libsmb: make use of cli_tree_connect()
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
665593d6ac
s3:libsmb: add cli_tree_connect() for a generic tree connect
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
8428db0a17
s3:smb2cli: remove unused smb2cli_sesssetup_ntlmssp*
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
8a9bfd61b7
s3:libsmb: add SMB2 support to cli_session_setup()
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
dd28b28ede
s3:libsmb: implement cli_trans* on top of smb1cli_trans*
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
f60b768df4
s3:smb2cli: remove unused smb2cli_negprot()
...
metze
2011-11-24 19:02:32 +01:00
Stefan Metzmacher
6ab3f8cedb
s3:smb2cli: pass struct smbXcli_conn directly to smb2cli_req_create/_send()
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
9ebdee2817
s3:libsmb: implement cli_state based functions on top of smbXcli_conn/smbXcli_req
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
bf1ff0572d
s3:smb2cli: add forward declaration for struct cli_state
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
3327c1e86e
s3:smb2cli: make smb2cli_session_setup_send/recv non-static
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
99b3d57fc3
s3:smb2cli: make use of smbXcli_session and setup the session key for SMB2 signing
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
7e7bca4188
s3:smb2cli: implement smb2cli_negprot() on top of smbXcli_negprot()
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
1cfeb3f8a0
smbXcli: pass client_guid to smbXcli_conn_create()
...
metze
2011-11-24 19:02:31 +01:00
Stefan Metzmacher
349977e1a0
s3:smb2cli: replace smb2cli_base.c code with the more generic smbXcli_base.c code
...
metze
2011-11-24 19:02:30 +01:00
Stefan Metzmacher
b895f1fb01
s3:libsmb: close fd on error in cli_connect_nb()
...
metze
2011-11-21 18:03:07 +01:00
Stefan Metzmacher
20df0f34a8
s3:libsmb: verify num_setup for SMBnttrans in cli_pull_trans()
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Nov 18 15:13:52 CET 2011 on sn-devel-104
2011-11-18 15:13:52 +01:00
Stefan Metzmacher
d3cb61cf05
s3:libsmb: fix compiler warning in cli_pull_trans()
...
metze
2011-11-18 13:30:48 +01:00
Stefan Metzmacher
48bcb8c846
s3:libsmb: only align unicode pipe_name (bug #8586 )
...
metze
2011-11-18 13:30:48 +01:00
Björn Baumbach
948e010f20
s3-libsmb/passchange.c: remove some cli_nt_error() calls
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov 16 20:36:11 CET 2011 on sn-devel-104
2011-11-16 20:36:10 +01:00
Björn Baumbach
6003debf7e
s3-libsmb/clidfs.c: remove cli_nt_error()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-16 19:02:12 +01:00
Björn Baumbach
e4934a1e42
s3-libsmb: introduce option to disable dos error mapping
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-11-16 19:02:12 +01:00
Stefan Metzmacher
949f12d592
Revert "Fix bug #8453 - smbclient segfaults when dialect option -m is used for legacy dialects"
...
This reverts commit f261ac1932
.
We now handle that in cli_state_create().
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov 16 15:44:05 CET 2011 on sn-devel-104
2011-11-16 15:44:05 +01:00
Stefan Metzmacher
c96292c710
s3:libsmb: always init cli->{server_os,server_domain,server_type}
...
We should do that at creation time of cli_state.
metze
2011-11-16 14:07:35 +01:00
Stefan Metzmacher
4b31c4273c
s3:libsmb: consistently use state->size in cli_write_andx_create() (bug #5326 )
...
Otherwise we may get unexpected results.
This is a fix that was missing in commit 95595dd93f
(s3:libsmb: fix cli_write_and_x() against OS/2 print shares (bug #5326 ))
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov 9 10:13:32 CET 2011 on sn-devel-104
2011-11-09 10:13:32 +01:00
Stefan Metzmacher
95595dd93f
s3:libsmb: fix cli_write_and_x() against OS/2 print shares (bug #5326 )
...
Print shares doesn't support CAP_LARGE_WRITEX, while it's negotiated
by the file server part.
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Nov 8 17:01:36 CET 2011 on sn-devel-104
2011-11-08 17:01:36 +01:00
Stefan Metzmacher
0fb4991116
s3:libsmb: correctly parse the LANMAN2.1 negprot response from OS/2 (bug #8584 )
...
metze
2011-11-08 15:24:51 +01:00
Stefan Metzmacher
9a3fe3a329
s3:libsmb: key_len is 8bit only in the NT1 case
...
metze
2011-11-08 15:24:51 +01:00
Stefan Metzmacher
230cd1e276
s3:libsmb: return NT_STATUS_OK for if a request is not the last one in the chain
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Nov 7 11:38:05 CET 2011 on sn-devel-104
2011-11-07 11:38:05 +01:00
Stefan Metzmacher
597f2ae342
s3:libsmb: make sure have_andx_command() returns false for non AndX commands
...
metze
2011-11-07 09:18:18 +01:00
Stefan Metzmacher
b20775fb3b
s3:libsmb: remember the seqnum on all chained requests
...
This is needed in order to verify the incoming signature
correctly.
metze
2011-11-07 09:18:10 +01:00
Stefan Metzmacher
20fe7658a7
s3:libsmb: get cmd of the chained request before changing wct_ofs
...
metze
2011-11-07 09:18:10 +01:00
Stefan Metzmacher
0c1669ee4b
s3:smb2cli: ignore the NBT/Length header in smb2cli_inbuf_parse_compound()
...
This is not needed and in future we want to support SMBDirect,
which add a different header.
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Nov 6 17:17:04 CET 2011 on sn-devel-104
2011-11-06 17:17:04 +01:00
Stefan Metzmacher
e99017af72
s3:libsmb: also remember the optional server name from the negprot response
...
W2K (at least sp4) and higher also send the server name.
metze
2011-11-04 14:16:29 +01:00
Stefan Metzmacher
aea76a3aaa
s3:libsmb: the workgroup in the non-extended-security negprot is not aligned ( #8573 )
...
I've tested the fix against NT4 sp6a, W2K sp4, W2K8R2 and Win8pre0.
metze
2011-11-04 14:16:28 +01:00
Günther Deschner
185b94eefa
nbt: trim down header dependencies of nbt.idl.
...
Guenther
2011-11-03 18:35:08 +01:00
Günther Deschner
2ecd50116c
librpc: remove nbt dependency to samr.
...
Guenther
2011-11-03 18:35:08 +01:00
Stefan Metzmacher
7de694974e
s3:libsmb: make use of SMB_SIGNING_* constants
...
metze
2011-11-03 16:55:13 +01:00
Stefan Metzmacher
a7051dfcff
s3:libsmb: make use of SMB_SIGNING_* constants
...
metze
2011-11-03 16:55:13 +01:00
Stefan Metzmacher
1b04e54b57
s3:libsmb: s/Undefined/SMB_SIGNING_DEFAULT/
...
metze
2011-11-03 16:55:13 +01:00
Stefan Metzmacher
44d7774a18
s3:param: the behavior of "client/server signing = auto" is the same as "true"
...
So remove the special case for 'Auto'.
metze
2011-11-03 16:55:11 +01:00
Stefan Metzmacher
09fe037b64
s3:libsmb: restore the 3.6.x behavior signing config parameters
...
metze
2011-11-03 16:55:11 +01:00
Günther Deschner
16627ca313
s3-trustdomcache: make enumerate_domain_trusts() static.
...
Guenther
2011-11-02 16:59:32 +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
1d531090bc
s3:libsmb: make use of map_nt_error_from_unix_common() in clitrans.c
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 26 17:53:15 CEST 2011 on sn-devel-104
2011-10-26 17:53:15 +02:00
Stefan Metzmacher
9a3e5965b4
s3:libsmb: avoid using smb_flg2 in cli_trans.c
...
metze
2011-10-26 16:18:28 +02:00
Stefan Metzmacher
f3166e75ef
s3:libsmb: replace smb_size - 4 with MIN_SMB_SIZE in clitrans.c
...
metze
2011-10-26 15:44:52 +02:00
Stefan Metzmacher
7221ce9bd5
s3:libsmb: use 'tevent_' instead of 'event_' in clitrans.c
...
metze
2011-10-26 15:43:08 +02:00
Stefan Metzmacher
f8f7f4e3ab
s3:libsmb: make use of smb_buffer_oob() in clitrans.c
...
metze
2011-10-26 15:41:34 +02:00
Stefan Metzmacher
431b476868
s3:libsmb: use smb_len_nbt() in clitrans.c
...
metze
2011-10-26 15:41:02 +02:00
Stefan Metzmacher
414df4b9c4
s3:smb2cli_base: make use of [_]smb_[set]len_tcp()
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 25 19:30:43 CEST 2011 on sn-devel-104
2011-10-25 19:30:43 +02:00
Stefan Metzmacher
fc69057b8b
s3:smb2cli_base: make use of map_nt_error_from_unix_common()
...
metze
2011-10-25 17:58:33 +02:00
Stefan Metzmacher
e947acaa8a
s3:libsmb: s/event_context/tevent_context/ in async_smb.[ch]
...
metze
2011-10-25 17:58:33 +02:00
Stefan Metzmacher
242292d4de
s3:libsmb: make use of map_nt_error_from_unix_common() in async_smb.c
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 25 03:21:06 CEST 2011 on sn-devel-104
2011-10-25 03:21:06 +02:00
Stefan Metzmacher
6fb13f4c19
s3:libsmb: use HDR_* defines in cli_state_dispatch_smb1()
...
metze
2011-10-25 01:47:22 +02:00
Stefan Metzmacher
648665a008
s3:libsmb: make use of smb_[set]len_nbt() in async_smb.c
...
metze
2011-10-25 01:47:21 +02:00
Stefan Metzmacher
d670d060fc
s3:libsmb: use HDR_* defines in cli_pull_raw_error()
...
metze
2011-10-25 01:47:21 +02:00
Stefan Metzmacher
1fa7300037
libcli/smb: move smb_signing.[ch] to the toplevel
...
metze
2011-10-25 01:47:21 +02:00
Stefan Metzmacher
aa2e5cea1c
s3:libsmb/smb_signing: make use of HDR_* defines
...
metze
2011-10-25 00:24:08 +02:00
Stefan Metzmacher
13a5f27db2
s3:libsmb/smb_signing: make use of smb_len_nbt()
...
metze
2011-10-25 00:24:08 +02:00
Stefan Metzmacher
4db071cca4
s3:libsmb/smb_signing: avoid usage of smb_ss_field
...
metze
2011-10-25 00:24:07 +02:00
Stefan Metzmacher
7ebd4337ac
libcli/smb: move source3/libsmb/read_smb.* to the toplevel
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 24 10:18:06 CEST 2011 on sn-devel-104
2011-10-24 10:18:06 +02:00
Stefan Metzmacher
6e2ecaf77d
s3:libsmb/read_smb: make use of smb_len_tcp()
...
metze
2011-10-24 08:41:15 +02:00
Stefan Metzmacher
8f356baab6
s3:libsmb: remove unused sync read_smb()
...
metze
2011-10-24 08:25:31 +02:00
Stefan Metzmacher
75d146d3ed
libcli/smb: move smb_seal.c to the toplevel
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Oct 21 10:22:39 CEST 2011 on sn-devel-104
2011-10-21 10:22:39 +02:00
Andrew Bartlett
0fe4192054
s3-ntlmssp Remove references to auth_ntlmssp_context from the smb sealing code
...
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:44:48 +02:00
Andrew Bartlett
0a0839821a
s3-ntlmssp Remove auth_ntlmssp_session_key()
...
We now just call the gensec_session_key() directly.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:38 +02:00
Andrew Bartlett
3f079885b2
s3-ntlmssp Remove auth_ntlmssp_want_feature()
...
We now just call the gensec_want_feature() directly.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:33 +02:00
Andrew Bartlett
b9b170a9dd
s3-seal use gensec_[un]wrap() instead of gensec_[un]seal_packet()
...
This should not make a difference for NTLMSSP as it still calls the
low level ntlmssp_[un]seal_packet() functions with the same input parameters.
If we convert the gss-api/krb5 based code to gensec we have to use
gensec_[un]wrap() as the wire format is different compared to
gensec_[un]seal_packet() there.
Andrew Bartlett
Split from another commit by Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:28 +02:00
Andrew Bartlett
bd29f79463
s3-ntlmssp use gensec_{seal,unseal,sign,check}_packet
...
This avoids the indirection via the auth_ntlmsssp wrapper functions.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:23 +02:00
Andrew Bartlett
487545d48f
s3-ntlmssp Remove auth_ntlmssp_negotiated_sign() and auth_ntlmssp_negotiated_seal()
...
We now just call the gensec_have_feature() directly.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:18 +02:00
Andrew Bartlett
083025ccd5
s3-ntlmssp Remove auth_ntlmssp_update wrapper
...
We now just call gensec_update directly.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-21 08:43:10 +02:00
Stefan Metzmacher
07f67d8612
s3:libsmb/smb_seal: always use SAFE_FREE(buf) in common_free_enc_buffer()
...
There's no need to do gss-api specific stuff, the buffer is always
malloc'ed.
metze
2011-10-21 08:43:01 +02:00
Stefan Metzmacher
12e257999b
s3:libsmb/smb_seal: use plain malloc() in common_ntlm_encrypt_buffer()
...
metze
2011-10-21 08:43:01 +02:00
Stefan Metzmacher
2a3bf9eb2f
s3:libsmb/smb_seal: avoid ads_errstr() dependency and use gssapi_error_string()
...
metze
2011-10-21 08:43:00 +02:00
Stefan Metzmacher
8df8277b0a
s3:libsmb/smb_seal: make use of common [_]smb_[set]len_nbt() macros
...
metze
2011-10-21 08:43:00 +02:00
Stefan Metzmacher
81f71e76fd
s3:libsmb/async_smb: in cli_state_notify_pending() we always disconnect
...
So we should always set state->mid = 0.
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Oct 20 11:34:23 CEST 2011 on sn-devel-104
2011-10-20 11:34:23 +02:00
Stefan Metzmacher
d825a2add6
s3:libsmb/smb_seal: move smb_set_enclen() to smb_seal.c and make it static there
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Oct 19 19:06:35 CEST 2011 on sn-devel-104
2011-10-19 19:06:35 +02:00
Stefan Metzmacher
0e0e44a626
s3:libsmb/smb_seal: s/uint16/uint16_t
...
metze
2011-10-19 17:32:23 +02:00
Stefan Metzmacher
1b9c8d4867
s3:include: move smb_seal.c prototypes to smb_crypt.h
...
metze
2011-10-19 17:32:23 +02:00
Stefan Metzmacher
bd8b2754ba
s3:libsmb/smb_seal: make common_ntlm_[en|de]crypt_buffer static
...
metze
2011-10-19 17:32:17 +02:00
David Disseldorp
d5ea379428
s3: Remove duplicate fsctl function definitions
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-19 15:44:29 +02:00
Volker Lendecke
fbf1748984
s3: Avoid a winbind 100% cpu loop
...
When a DC goes down hard, winbind can end up in a 100% CPU loop. The next
(small) RPC request to the DC ends up as a trans2 request. If the connection
goes down, we end up trying to discard the request via the loop in
cli_state_notify_pending(). Because this is a trans2 request,
cli_smb_req_unset_pending will not kick in. Thus the pending array will always
remain at length 1.
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Oct 19 01:39:35 CEST 2011 on sn-devel-104
2011-10-19 01:39:35 +02:00
Andrew Bartlett
fa1275610b
s3-libsmb Use a gensec module to provide the ntlmssp client in ntlmssp_wrap.c
...
This removes the need to have if (ans->gensec_security) everywhere.
Andrew Bartlett
2011-10-18 12:25:30 +02:00
Andrew Bartlett
f9b042641f
s3-ntlmssp split auth_ntlmssp_client_start() into two parts
...
This will allow it to be a wrapper around a gensec module, which
requires that they options be set on a context, but before the
mechanism is started.
This also simplfies the callers, by moving the lp_*() calls
into one place.
Andrew Bartlett
2011-10-18 12:25:30 +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
0c6e4adcb2
ntlmssp: Move ntlmssp code to auth/ntlmssp
...
This brings in the code from both libcli/auth and
source4/auth/ntlmssp.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-18 13:13:31 +11:00
Andrew Bartlett
d4d4f4e07f
s3-auth Add my copyright
...
I have done plenty of work here, I deserve some of the blame :-)
Andrew Bartlett
2011-10-18 13:13:30 +11:00
Andrew Tridgell
3a4fa654d5
libsmbclient: initial ABI signatures
2011-10-18 11:24:55 +11:00
Andrew Tridgell
d226acd97a
libsmbclient: add ABI checking and pc file
...
this gives us ABI checking for libsmbclient so that the waf build will
prevent ABI breakage, and a public version number. The addition of the
pc file makes this library available via pkgconfig, including querying
of the version number
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-10-18 11:24:55 +11:00
Jeremy Allison
acc28706b5
Fix const warning.
2011-10-14 13:20:07 -07:00
Gregor Beck
85b145d745
s3:utils change data_blob_dup_talloc() to take a DATA_BLOB by value
...
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Volker Lendecke
b7b7ce5aa4
s3: Fix an uninitialized variable warning
2011-09-30 10:21:43 +02:00
Stefan Metzmacher
8daf9df514
s3:smb2cli: fix the num_expected == 0 logic in smb2cli_req_recv()
...
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Sep 29 22:15:06 CEST 2011 on sn-devel-104
2011-09-29 22:15:06 +02:00