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

475 Commits

Author SHA1 Message Date
Volker Lendecke
e2e0449a58 libsmbclient: Factor out cli_session_setup_get_account
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:25:49 -07:00
Volker Lendecke
0008d9e1c5 libsmbclient: Slightly simplify cli_session_setup_spnego
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 14:24:20 -07:00
Volker Lendecke
4627699e4f libsmbclient: Factor out cli_session_setup_get_principal
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 13:59:08 -07:00
Volker Lendecke
54316ea339 libsmbclient: Avoid a data copy
spnego_parse_negTokenInit does a asn_load of that blob, which does a data copy
itself. So we don't have to had it a copy as well.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 13:57:58 -07:00
Volker Lendecke
fbda7826b8 libsmbclient: Fix a leak on talloc_tos()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-11 13:57:44 -07:00
Volker Lendecke
b5d5b9a40e libsmbclient: Fix cli_session_setup_guest_send
This worked fine so far, but for the wrong reason: We only ever called
this through the sync wrapper. The tevent_req_nterror in the NT_STATUS_OK
case does not call tevent_req_finish. So the tevent_loop_poll did call
into the core send/receive smb code. This is a fix for the case when
smb1cli_req_chain_submit fails for some reason.

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): Wed Apr  3 18:39:30 CEST 2013 on sn-devel-104
2013-04-03 18:39:30 +02:00
Stefan Metzmacher
b041dc9451 s3:libsmb: make use of SMB_CAP_LEGACY_CLIENT_MASK instead of SMB_CAP_CLIENT_MASK
This should allow smbclient to keep using large reads against older Samba versions
(<= 3.6.x) and other servers that may also require this.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20 09:32:25 -07:00
Stefan Metzmacher
d0bca41f48 s3:libsmb: s/struct event_context/struct tevent_context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:54 +01:00
Stefan Metzmacher
c8dda78e35 s3:libsmb: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:46 +01:00
Simo Sorce
893b213876 Avoid overriding default ccache for ads operations.
Avoid overriding default ccache for ads operations.

Nowadays various samba components may need to use GSSAPI and a default cred
cache to perform their tasks.
This code was completely overriding the whole process default ccache name, thus
altering the current credentials and sometimes hijacking them (or getting
preemptively hijaked).

By using gss_krb5_import_cred we can instead use a private ccache (necessary
sometimes to use a different set of credentials fromt he default
cifs/fqdn@realm one, for example when contacting foreign DCs using trust
credentials) that does not affect the rest of the process.

For the kerberos versions which don't have gss_krb5_import_cred
we fallback to temp override of KRB5CCNAME and gss_acquire_cred.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Sep 12 21:18:09 CEST 2012 on sn-devel-104
2012-09-12 21:18:09 +02:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
Stefan Metzmacher
c32120b4e9 s3:libsmb: add EXTENDED_SIGNATURE support in cli_tcon_andx*()
metze
2012-08-04 09:10:22 +02:00
Stefan Metzmacher
3682eb80ab s3:libsmb: add a optional_support helper variable
metze
2012-08-01 14:17:16 +02:00
Stefan Metzmacher
137d65b397 s3:libsmb: add a tcon_flags helper variable
metze
2012-08-01 14:17:16 +02:00
Stefan Metzmacher
0ec50e8a2f s3:libsmb: remove unused cli_state->user_session_key
metze
2012-08-01 14:17:15 +02:00
Stefan Metzmacher
c9eac1af14 s3:libsmb: make use of smb1cli_session_set_session_key()
metze
2012-08-01 14:17:12 +02:00
Stefan Metzmacher
20e4392b25 s3:libsmb: make use of cli_state_[g|s]et_tid()
metze
2012-07-24 18:44:04 +02:00
Volker Lendecke
93e950caf8 s3: Add cli_state->pw_nt_hash
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-12 10:48:15 +02:00
Andrew Bartlett
01b726dbe8 s3-libsmb: Fix error messages to correctly mention PLAINTEXT not LM
Also make all the message say the same thing.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Jun  6 10:17:55 CEST 2012 on sn-devel-104
2012-06-06 10:17:55 +02:00
Stefan Metzmacher
7ef4ae42fe s3:libsmb: change cli_sesssetup_blob_* to use uint8_t instead of char for inbuf
metze
2012-06-05 17:33:49 +02:00
Stefan Metzmacher
2b5d4d4267 s3:libsmb: use inhdr instead of inbuf in tree connect related functions
metze
2012-06-05 17:33:49 +02:00
Stefan Metzmacher
ae627a5da8 s3:libsmb: use inhdr instead of inbuf in session setup related functions
metze
2012-06-05 17:33:49 +02:00
Luk Claes
aea996dba6 s3:libsmb: get rid of cli_smb_req_*,cli_smb_wct_ofs,cli_smb_chain_send
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jun  3 23:37:02 CEST 2012 on sn-devel-104
2012-06-03 23:37:02 +02:00
Stefan Metzmacher
9c02667b82 s3:libsmb: use cli_tree_connect() instead of cli_tcon_andx()
cli_tree_connect() is more generic and uses what the server supports

metze
2012-05-30 10:24:57 +02:00
Stefan Metzmacher
bce43d75da s3:libsmb: fallback to SMBtcon for old servers
metze
2012-05-30 10:24:57 +02:00
Luk Claes
4688107800 s3:libsmb: get rid of cli_ucs2
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon May 28 16:58:03 CEST 2012 on sn-devel-104
2012-05-28 16:58:03 +02:00
Luk Claes
93ed99d6ff s3:libsmb: get rid of clisigning routines
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:51 +02:00
Luk Claes
f7f73c4dba s3:libsmb: get rid of cli_has_async_calls
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:50 +02:00
Luk Claes
764b5e5610 s3:libsmb: get rid of cli_negprot
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:49 +02:00
Luk Claes
278ba9928a s3:libsmb: get rid of cli_state_security_mode
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:48 +02:00
Luk Claes
5f10bd9fe4 s3:libsmb: get rid of cli_state_server_gss_blob
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:48 +02:00
Luk Claes
2be7e23b99 s3:libsmb: get rid of cli_state_server_challenge
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:47 +02:00
Luk Claes
7c69ca09d0 s3:libsmb: get rid of cli_state_server_session_key
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:46 +02:00
Luk Claes
3c9c06ac05 s3:libsmb: get rid of cli_state_capabilities
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:46 +02:00
Luk Claes
d8c0646a5d s3:libsmb: get rid of cli_state_protocol
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:45 +02:00
Luk Claes
4f6f4ea93c s3:libsmb: get rid of cli_state_remote_name
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-28 14:49:45 +02:00
Simo Sorce
08c733d75f Make krb5 wrapper library common so they can be used all over 2012-04-23 19:20:38 -04:00
Stefan Metzmacher
1334ed723e s3:libsmb/cliconnect: make use of ntlmssp_is_anonymous()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Apr 17 16:16:51 CEST 2012 on sn-devel-104
2012-04-17 16:16:51 +02:00
Stefan Metzmacher
66d7553b0e s3:libsmb: 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
2012-04-16 12:54:54 +02: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
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
Andreas Schneider
8080dbad78 s3-lib: Fix util_cmdline which doesn't use popt.
This creates its own header file for util_cmdline so it doesn't need to
link against popt.
This should fix linking on FreeBSD.
2012-02-01 21:54:21 +01:00
Andrew Bartlett
860ad734ba s3-libads Factor out a new routine kerberos_get_principal_from_service_hostname()
This is now used in the GSE GSSAPI client, so that when we connect to
a target server at the CIFS level, we use the same name to connect
at the DCE/RPC level.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-05 17:17:28 +01:00
Volker Lendecke
75d3b9ce08 s3: Fix some False/NULL hickups
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-20 13:13:17 +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
8a9bfd61b7 s3:libsmb: add SMB2 support to cli_session_setup()
metze
2011-11-24 19:02:32 +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
b895f1fb01 s3:libsmb: close fd on error in cli_connect_nb()
metze
2011-11-21 18:03:07 +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
0fb4991116 s3:libsmb: correctly parse the LANMAN2.1 negprot response from OS/2 (bug #8584)
metze
2011-11-08 15:24:51 +01:00