From c1bbd1868f90b672ab88e53e039732854dca1f8d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Sep 1998 22:34:40 +0000 Subject: Moved the extra struct definitions Luke added to smb.h into rpcclient.h and client.h. They are still included from smb.h so nothing should change (or break) but this keeps the new definitions easier to maintain. This is similar to what I did with ntdomain.h Jeremy. (This used to be commit 2831e5c9c46e05ecd8c858fac2d93e8baa96d102) --- source3/include/client.h | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 source3/include/client.h (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h new file mode 100644 index 0000000000..6d0be057ae --- /dev/null +++ b/source3/include/client.h @@ -0,0 +1,79 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Luke Kenneth Casson Leighton 1996-1998 + Copyright (C) Jeremy Allison 1998 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _CLIENT_H +#define _CLIENT_H + +/* + * These definitions depend on smb.h + */ + +struct cli_state { + int fd; + int cnum; + int pid; + int mid; + int uid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + + fstring eff_name; + fstring desthost; + fstring user_name; + fstring domain; + + fstring share; + fstring dev; + struct nmb_name called; + struct nmb_name calling; + fstring full_dest_host_name; + struct in_addr dest_ip; + + struct pwd_info pwd; + char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + /* + * Only used in NT domain calls. + */ + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ +}; + +#endif /* _CLIENT_H */ -- cgit From cf3a9741dc7427efb97eff09a3c197a906ce6767 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Sep 1998 21:43:48 +0000 Subject: Changes to test in configure if capabilities are enabled on a system. Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09) --- source3/include/client.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 6d0be057ae..dde377f484 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -28,6 +28,34 @@ * These definitions depend on smb.h */ +typedef struct +{ + SMB_OFF_T size; + int mode; + uid_t uid; + gid_t gid; + /* these times are normally kept in GMT */ + time_t mtime; + time_t atime; + time_t ctime; + pstring name; +} file_info; + +struct pwd_info +{ + BOOL null_pwd; + BOOL cleartext; + BOOL crypted; + + fstring password; + + uchar smb_lm_pwd[16]; + uchar smb_nt_pwd[16]; + + uchar smb_lm_owf[24]; + uchar smb_nt_owf[24]; +}; + struct cli_state { int fd; int cnum; @@ -52,7 +80,7 @@ struct cli_state { struct in_addr dest_ip; struct pwd_info pwd; - char cryptkey[8]; + unsigned char cryptkey[8]; uint32 sesskey; int serverzone; uint32 servertime; -- cgit From 9066025a8a4afe1f7f559c455d86fc023792ed17 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Sep 1998 20:24:17 +0000 Subject: Got very strict about the differences and uses of uid_t, gid_t and vuid. Added sys_getgroups() to get around the int * return problem. Set correct datatypes for all uid, gid and vuid variables. Jeremy. (This used to be commit e570db46fc3a78e499523fd342e9a34cebb18998) --- source3/include/client.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index dde377f484..2b71b37524 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -58,10 +58,10 @@ struct pwd_info struct cli_state { int fd; - int cnum; - int pid; - int mid; - int uid; + uint16 cnum; + uint16 pid; + uint16 mid; + uint16 vuid; int protocol; int sec_mode; int rap_error; -- cgit From 7b463b5f04617de19b405ca131113271183aa811 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Oct 1998 12:34:14 +0000 Subject: a couple of mode for smbwrapper (This used to be commit 07dd2aedf1e8ad143669694b504554de74bbaa1d) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 2b71b37524..40bd48de46 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -28,7 +28,7 @@ * These definitions depend on smb.h */ -typedef struct +typedef struct file_info { SMB_OFF_T size; int mode; -- cgit From 392cdc89e737f8bf9fe42e899421ff4cf3884686 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 08:08:03 +0000 Subject: added capabilities ab win95 fields to client structure. Used for detecting win95 server for bug handling (This used to be commit 76b5c8243791358be1a4781ff2e6929e56d98887) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 40bd48de46..628834925b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -92,6 +92,8 @@ struct cli_state { char *inbuf; int bufsize; int initialised; + int win95; + uint32 capabilities; /* * Only used in NT domain calls. */ -- cgit From 5ade894f32377ffaed3fc085810892509a6e8c66 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 06:22:08 +0000 Subject: modified cli_read() and cli_write() to issue multiple outstanding read/write requests for large reads. up to max_mux requests may be outstanding. This gives _much_ better throughput and should allow smbsh to saturate just about any network. this is an implementation of the "fast SMB" method I described on the CIFS list a couple of months back. (This used to be commit c728d1c5d6e4626d2f8e318eab4df32acc8cb505) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 628834925b..c312d29bf7 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -88,6 +88,7 @@ struct cli_state { int writebraw_supported; int timeout; int max_xmit; + int max_mux; char *outbuf; char *inbuf; int bufsize; -- cgit From 944d7e2c7e7f2fa8d0a69c89ad8740a1a6d96051 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 07:50:44 +0000 Subject: set a default 16k client buffer size (This used to be commit cc1a0cf82b25e259c35f8accbb948814cc28a9ba) --- source3/include/client.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c312d29bf7..79fb96dad2 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -24,6 +24,10 @@ #ifndef _CLIENT_H #define _CLIENT_H +/* the client asks for a smaller buffer to save ram and also to get more + overlap on the wire */ +#define CLI_BUFFER_SIZE (0x4000) + /* * These definitions depend on smb.h */ -- cgit From 6760e69a68571e01ee57b959193a56278962a23c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 09:42:51 +0000 Subject: added support for printing via smbwrapper You can print using "cp filename /smb/SERVER/PRINTER/jobname" You can list the current printqueue using ls (This used to be commit 080fb61b69620e26e8122705383dc2bd0468a519) --- source3/include/client.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 79fb96dad2..495780cbaa 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -25,8 +25,9 @@ #define _CLIENT_H /* the client asks for a smaller buffer to save ram and also to get more - overlap on the wire */ -#define CLI_BUFFER_SIZE (0x4000) + overlap on the wire. This size gives us a nice read/write size, which + will be a multiple of the page size on almost any system */ +#define CLI_BUFFER_SIZE (0x4400) /* * These definitions depend on smb.h @@ -45,6 +46,16 @@ typedef struct file_info pstring name; } file_info; +struct print_job_info +{ + uint16 id; + uint16 priority; + size_t size; + fstring user; + fstring name; + time_t t; +}; + struct pwd_info { BOOL null_pwd; -- cgit From 6909350ed9b87875ee40191b2e636c6049749195 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 8 Oct 1998 23:57:46 +0000 Subject: dce/rpc (This used to be commit 62fdeef1b79c5c4c9bf0e860881651711bb80b9a) --- source3/include/client.h | 101 +++++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 48 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 495780cbaa..44ac147665 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -72,54 +72,59 @@ struct pwd_info }; struct cli_state { - int fd; - uint16 cnum; - uint16 pid; - uint16 mid; - uint16 vuid; - int protocol; - int sec_mode; - int rap_error; - int privilages; - - fstring eff_name; - fstring desthost; - fstring user_name; - fstring domain; - - fstring share; - fstring dev; - struct nmb_name called; - struct nmb_name calling; - fstring full_dest_host_name; - struct in_addr dest_ip; - - struct pwd_info pwd; - unsigned char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - int max_mux; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; - int win95; - uint32 capabilities; - /* - * Only used in NT domain calls. - */ - uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ + int fd; + uint16 cnum; + uint16 pid; + uint16 mid; + uint16 vuid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + + fstring eff_name; + fstring desthost; + fstring user_name; + fstring domain; + + fstring share; + fstring dev; + struct nmb_name called; + struct nmb_name calling; + fstring full_dest_host_name; + struct in_addr dest_ip; + + struct pwd_info pwd; + unsigned char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + int max_mux; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + int win95; + uint32 capabilities; + + /* + * Only used in NT domain calls. + */ + + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + unsigned char ntlmssp_hash[256]; /* ntlmssp data. */ + uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ + uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ }; #endif /* _CLIENT_H */ -- cgit From 755986764f5a6b0ec25c7f20fde0a80eb4d121ba Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 9 Oct 1998 19:05:19 +0000 Subject: dce/rpc (This used to be commit 32d0f5e4a564686ad6b270dd24423ee49a81f223) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 44ac147665..0da4b40c18 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -118,7 +118,7 @@ struct cli_state { uint32 nt_error; /* NT RPC error code. */ uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ - unsigned char ntlmssp_hash[256]; /* ntlmssp data. */ + unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ DOM_CRED clnt_cred; /* Client credential. */ -- cgit From 935dc98f6670ba630bd2086ef9eddcc94a0562e2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 14 Oct 1998 06:29:20 +0000 Subject: dce/rpc (This used to be commit 69f5f9f88935de1f63ffc9aa19c0629b395e66e6) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0da4b40c18..53674fe80a 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -121,6 +121,7 @@ struct cli_state { unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ + uint32 ntlmssp_seq_num; /* ntlmssp sequence number */ DOM_CRED clnt_cred; /* Client credential. */ fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ -- cgit From a42afcdcc7ab9aa9ed193ae36d3dbb10843447f0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 15 Oct 1998 05:47:29 +0000 Subject: bug-fixing against: AS/U: it returns dce/rpc "first" and "last" bits _clear_ in a bind/ack response, when they should be set in a (small) packet. they also, in the bind/ack do not set a secondary address string at all, so we can't check against that... Win95: client-side dce/rpc code is a bit odd. it does a "WaitNamedPipeState" and has slightly different pipe-naming (\PIPE\LANMAN is joined by \PIPE\SRVSVC, \PIPE\WINREG etc whereas nt just has \PIPE\LANMAN and \PIPE\). Win95-USRMGR.EXE: added LsaOpenPolicy (renamed existing to LsaOpenPolicy2). added SamrConnect (renamed existing to SamrConnect2). (This used to be commit a7fccd807b938cbb51002ebae8c7a48b40dbb655) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 53674fe80a..a393ee25a8 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -126,6 +126,8 @@ struct cli_state { fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ fstring clnt_name_slash; /* \\local client. */ + uint16 max_xmit_frag; + uint16 max_recv_frag; }; #endif /* _CLIENT_H */ -- cgit From fb556e14f3b47d5a1f465589084e8b30d84af8ca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 24 Oct 1998 08:08:05 +0000 Subject: volker was concerned about unique inode numbers and smbsh. This set of changes uses the unique index number from a SMB_QUERY_FILE_ALL_INFO to try to provide inode numbers. If it is 0 then use the hash of the filename as before. (This used to be commit 2565ccf9de9d5e80fdb5bcadbc7130faba386d95) --- source3/include/client.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index a393ee25a8..1caf78bf0e 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -35,15 +35,15 @@ typedef struct file_info { - SMB_OFF_T size; - int mode; - uid_t uid; - gid_t gid; - /* these times are normally kept in GMT */ - time_t mtime; - time_t atime; - time_t ctime; - pstring name; + SMB_OFF_T size; + int mode; + uid_t uid; + gid_t gid; + /* these times are normally kept in GMT */ + time_t mtime; + time_t atime; + time_t ctime; + pstring name; } file_info; struct print_job_info -- cgit From e4f974c611c179a5e7827ec8325e01811db6540b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Nov 1998 20:33:37 +0000 Subject: Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions. client/client.c: client/clitar.c: include/client.h: smbwrapper/smbw_dir.c: smbwrapper/smbw_stat.c: smbwrapper/smbw.c: lib/util.c: Converted all use of 'mode' to uint16. smbd/quotas.c: Fixed stupid comment bug I put in there :-(. printing/printing.c: Fix from J.F. to new code. Jeremy. (This used to be commit bacd3e9d2036a804e73644a28fc498f229c8446c) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 1caf78bf0e..0d5d2ea8fb 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -36,7 +36,7 @@ typedef struct file_info { SMB_OFF_T size; - int mode; + uint16 mode; uid_t uid; gid_t gid; /* these times are normally kept in GMT */ -- cgit From d30b6ab54847164aa3add34f3b50132af58f9453 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Thu, 12 Nov 1998 22:17:51 +0000 Subject: .cvsignore: Removed old entries. client/client.c: include/client.h: Added some debug messages that the old client used to generate. These are needed to make scripts such as 'findsmb' work - there may be other changes to keep backwards output compatibility. Do we need a -old-client-compat argument ? libsmb/clientgen.c: Fixed crash bug where malloc'ed data wasn't being cleared - corrupted malloc chains. web/swat.c: John's changes to get rid of "ghost" table entries. (This used to be commit 3c45a3503ea57d17e98eb3e57514161a5c82e45e) --- source3/include/client.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0d5d2ea8fb..0f28fa0d08 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -87,6 +87,15 @@ struct cli_state { fstring user_name; fstring domain; + /* + * The following strings are the + * ones returned by the server if + * the protocol > NT1. + */ + fstring server_type; + fstring server_os; + fstring server_domain; + fstring share; fstring dev; struct nmb_name called; -- cgit From 9c848ec329a6ce86cffb2304746590116d9292f0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 7 Dec 1998 20:23:41 +0000 Subject: removed nt_pipe_fnum from struct cli_state. need to be able to call LsaLookupSids etc from within SamrQueryAliasMembers, for example. fnum is now a parameter to client functions. thanks to mike black for starting the ball rolling. (This used to be commit bee8f7fa6b0f7f995f71303f4e14a4aaed0c2437) --- source3/include/client.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0f28fa0d08..25f8436079 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -125,7 +125,6 @@ struct cli_state { */ uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ -- cgit From f5f913b001ab66c2266e3325f8c91af2486116a2 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Mon, 25 Jan 1999 01:46:14 +0000 Subject: Putting back the -p flag in smbclient. However, it seems that the -s flag in smbclient is also ignored :-( (This used to be commit f6c78192664d611d4663ed7459a2789315861eec) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 25f8436079..89bcf49248 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -72,6 +72,7 @@ struct pwd_info }; struct cli_state { + int port; int fd; uint16 cnum; uint16 pid; -- cgit From 73891ca8e4f6cca6aa8bb0ae043f660a64baa056 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 29 Jun 1999 18:47:06 +0000 Subject: improving authentication code (tidyup). (This used to be commit ab1a6aa42db5217f025941fb5107436556bc23b7) --- source3/include/client.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 89bcf49248..b06d877181 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -58,17 +58,22 @@ struct print_job_info struct pwd_info { - BOOL null_pwd; - BOOL cleartext; - BOOL crypted; + BOOL null_pwd; + BOOL cleartext; + BOOL crypted; - fstring password; + fstring password; - uchar smb_lm_pwd[16]; - uchar smb_nt_pwd[16]; + uchar smb_lm_pwd[16]; + uchar smb_nt_pwd[16]; - uchar smb_lm_owf[24]; - uchar smb_nt_owf[24]; + uchar smb_lm_owf[24]; + uchar smb_nt_owf[128]; + size_t nt_owf_len; + + uchar lm_cli_chal[8]; + uchar nt_cli_chal[128]; + size_t nt_cli_chal_len; }; struct cli_state { @@ -106,6 +111,12 @@ struct cli_state { struct pwd_info pwd; unsigned char cryptkey[8]; + unsigned char lm_cli_chal[8]; + unsigned char nt_cli_chal[128]; + size_t nt_cli_chal_len; + + BOOL use_ntlmv2; + uint32 sesskey; int serverzone; uint32 servertime; -- cgit From dab1a1227873f1a88dc7a4b8f63edcccd60ada85 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 21 Nov 1999 19:24:01 +0000 Subject: you know what? this sort of thing makes me laugh. hmm, what functions have we got. and what data do we have. hmm.. i wonder what the NTLMv2 user session key can be... hmmm... weell.... there's some hidden data here, generated from the user password that doesn't go over-the-wire, so that's _got_ to be involved. and... that bit of data took a lot of computation to produce, so it's probably _also_ involved... and md4 no, md5? no, how about hmac_md5 yes let's try that one (the other's didn't work) oh goodie, it worked! i love it when this sort of thing happens. took all of fifteen minutes to guess it. tried concatenating client and server challenges. tried concatenating _random_ bits of client and server challenges. tried md5 of the above. tried hmac_md5 of the above. eventually, it boils down to this: kr = MD4(NT#,username,domainname) hmacntchal=hmac_md5(kr, nt server challenge) sess_key = hmac_md5(kr, hmacntchal); (This used to be commit ab174759cd210fe1be888d0c589a5b2669f7ff1e) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index b06d877181..7c5854b556 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -74,6 +74,8 @@ struct pwd_info uchar lm_cli_chal[8]; uchar nt_cli_chal[128]; size_t nt_cli_chal_len; + + uchar sess_key[16]; }; struct cli_state { -- cgit From 2803a72751cf511aa0b5e6745e1b169faa66f68a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 24 Nov 1999 22:45:09 +0000 Subject: ok. *whew*. this is the first completed part of the restructure. verified that lsaquery, lsalookupsids work, and found some bugs in the parameters of these commands :-) soo... we now have an lsa_* api that has the same arguments as the nt Lsa* api! cool! the only significant coding difference is the introduction of a user_credentials structure, containing user, domain, pass and ntlmssp flags. (This used to be commit 57bff6fe82d777e599d535f076efb2328ba1188b) --- source3/include/client.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 7c5854b556..78c7d977c0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -78,7 +78,17 @@ struct pwd_info uchar sess_key[16]; }; -struct cli_state { +struct user_credentials +{ + fstring user_name; + fstring domain; + struct pwd_info pwd; + + uint32 ntlmssp_flags; +}; + +struct cli_state +{ int port; int fd; uint16 cnum; @@ -88,12 +98,12 @@ struct cli_state { int protocol; int sec_mode; int rap_error; - int privilages; + int privileges; + + struct user_credentials usr; fstring eff_name; fstring desthost; - fstring user_name; - fstring domain; /* * The following strings are the @@ -108,10 +118,8 @@ struct cli_state { fstring dev; struct nmb_name called; struct nmb_name calling; - fstring full_dest_host_name; struct in_addr dest_ip; - struct pwd_info pwd; unsigned char cryptkey[8]; unsigned char lm_cli_chal[8]; unsigned char nt_cli_chal[128]; -- cgit From 3fc5ec73be6009d50ec1e8e83505572ad16c1943 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 27 Nov 1999 21:50:11 +0000 Subject: further abstraction involving client states. main client-side code is pretty much independent of SMB client states, which will make it easier to add other transports. (This used to be commit a1ff7e8fc3129ba4a04722f977bc2d3725d13624) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 78c7d977c0..066c5e73f3 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -160,4 +160,6 @@ struct cli_state uint16 max_recv_frag; }; +struct cli_connection; + #endif /* _CLIENT_H */ -- cgit From e302cb2b189f679bcf7efe60d5ae9fb4218c1411 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 29 Nov 1999 19:46:57 +0000 Subject: first attempt at getting \PIPE\NETLOGON working. it's pretty horrible. (This used to be commit 44dd3efa6380544e9a515e91960f9271498cefaf) --- source3/include/client.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 066c5e73f3..edc20bdde0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -153,9 +153,6 @@ struct cli_state uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ uint32 ntlmssp_seq_num; /* ntlmssp sequence number */ DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; }; -- cgit From 7d01f964ff3c1a11bd72d987312f9826fee1c124 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 3 Dec 1999 18:16:08 +0000 Subject: cool! a unix socket smb redirector. code based on smbfilter and ideas from ssh-agent. the intent is to be able to share smb sessions using cli_net_use_add() across multiple processes, where one process knows the target server name, user name and domain, but not the smb password. (This used to be commit 294b653f2e9cdc1864ec638ae8b4300df25723cf) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index edc20bdde0..821a333e54 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -126,6 +126,7 @@ struct cli_state size_t nt_cli_chal_len; BOOL use_ntlmv2; + BOOL redirect; uint32 sesskey; int serverzone; -- cgit From c2a3b11b0738f57accafe19c84b682f761fa9631 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 3 Dec 1999 22:02:03 +0000 Subject: starting "connection reuse" system in smb-agent. added version number which isn't actually used right now :-) (This used to be commit d54a64ae3ab7cdc1ac67fb49f7255e6a106d624e) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 821a333e54..477ceb1160 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -85,6 +85,7 @@ struct user_credentials struct pwd_info pwd; uint32 ntlmssp_flags; + BOOL reuse; }; struct cli_state -- cgit From 4ab9d91428b66bd2fe407b0dba94f4130160b576 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 8 Dec 1999 21:43:03 +0000 Subject: ABOUT TIME!!!!!!!! damn, this one is bad. started, at least two days ago, to add an authentication mechanism to the smbd<->msrpc redirector/relay, such that sufficient unix / nt information could be transferred across the unix socket to do a become_user() on the other side of the socket. it is necessary that the msrpc daemon inherit the same unix and nt credentials as the smbd process from which it was spawned, until such time as the msrpc daemon receives an authentication request of its own, whereupon the msrpc daemon is responsible for authenticating the new credentials and doing yet another become_user() etc sequence. (This used to be commit 30c7fdd6ef10ecd35594311c1b250b95ff895489) --- source3/include/client.h | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 477ceb1160..275f3b44da 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -56,38 +56,6 @@ struct print_job_info time_t t; }; -struct pwd_info -{ - BOOL null_pwd; - BOOL cleartext; - BOOL crypted; - - fstring password; - - uchar smb_lm_pwd[16]; - uchar smb_nt_pwd[16]; - - uchar smb_lm_owf[24]; - uchar smb_nt_owf[128]; - size_t nt_owf_len; - - uchar lm_cli_chal[8]; - uchar nt_cli_chal[128]; - size_t nt_cli_chal_len; - - uchar sess_key[16]; -}; - -struct user_credentials -{ - fstring user_name; - fstring domain; - struct pwd_info pwd; - - uint32 ntlmssp_flags; - BOOL reuse; -}; - struct cli_state { int port; @@ -101,7 +69,8 @@ struct cli_state int rap_error; int privileges; - struct user_credentials usr; + struct ntuser_creds usr; + BOOL retry; fstring eff_name; fstring desthost; @@ -128,6 +97,7 @@ struct cli_state BOOL use_ntlmv2; BOOL redirect; + BOOL reuse; uint32 sesskey; int serverzone; -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/include/client.h | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 275f3b44da..15ba66e3e1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -27,7 +27,7 @@ /* the client asks for a smaller buffer to save ram and also to get more overlap on the wire. This size gives us a nice read/write size, which will be a multiple of the page size on almost any system */ -#define CLI_BUFFER_SIZE (0x4400) +#define CLI_BUFFER_SIZE (0xFFFF) /* * These definitions depend on smb.h @@ -56,8 +56,22 @@ struct print_job_info time_t t; }; -struct cli_state +struct pwd_info { + BOOL null_pwd; + BOOL cleartext; + BOOL crypted; + + fstring password; + + uchar smb_lm_pwd[16]; + uchar smb_nt_pwd[16]; + + uchar smb_lm_owf[24]; + uchar smb_nt_owf[24]; +}; + +struct cli_state { int port; int fd; uint16 cnum; @@ -69,11 +83,10 @@ struct cli_state int rap_error; int privileges; - struct ntuser_creds usr; - BOOL retry; - fstring eff_name; fstring desthost; + fstring user_name; + fstring domain; /* * The following strings are the @@ -88,23 +101,17 @@ struct cli_state fstring dev; struct nmb_name called; struct nmb_name calling; + fstring full_dest_host_name; struct in_addr dest_ip; + struct pwd_info pwd; unsigned char cryptkey[8]; - unsigned char lm_cli_chal[8]; - unsigned char nt_cli_chal[128]; - size_t nt_cli_chal_len; - - BOOL use_ntlmv2; - BOOL redirect; - BOOL reuse; - uint32 sesskey; int serverzone; uint32 servertime; int readbraw_supported; int writebraw_supported; - int timeout; + int timeout; /* in milliseconds. */ int max_xmit; int max_mux; char *outbuf; @@ -119,16 +126,20 @@ struct cli_state */ uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ uint32 ntlmssp_seq_num; /* ntlmssp sequence number */ DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; -}; -struct cli_connection; + BOOL use_oplocks; /* should we use oplocks? */ +}; #endif /* _CLIENT_H */ -- cgit From fbd17c8dafeefac788f4bc1c41045726825f513f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 3 Jan 2000 19:19:48 +0000 Subject: simple mods to add msrpc pipe redirection. default behaviour: fall back to using internal msrpc code in smbd. (This used to be commit 8976e26d46cb991710bc77463f7f928ac00dd4d8) --- source3/include/client.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 15ba66e3e1..2a780ece26 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -56,21 +56,6 @@ struct print_job_info time_t t; }; -struct pwd_info -{ - BOOL null_pwd; - BOOL cleartext; - BOOL crypted; - - fstring password; - - uchar smb_lm_pwd[16]; - uchar smb_nt_pwd[16]; - - uchar smb_lm_owf[24]; - uchar smb_nt_owf[24]; -}; - struct cli_state { int port; int fd; -- cgit From 71e7974f3f847759ba6f844ea7f482786cc5db02 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Apr 2000 04:45:16 +0000 Subject: YIPEE!!!!! We finally have a perfect emulation of Microsoft wildcard matching. The routine ms_fnmatch() does wildcard matching with all MS wildcards (including the unicode wildcards), and masktest against a NT4 workstation with hundreds of thousands of random exmaples has not found a single error. amazingly it is only about 60 lines of code, but it has taken us years to get it right. I didn't sleep much last night :) (This used to be commit cc9e007cdfdd300189f89e2a55e4234e47fa842d) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 2a780ece26..406f2e972c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -44,6 +44,7 @@ typedef struct file_info time_t atime; time_t ctime; pstring name; + char short_name[13]; } file_info; struct print_job_info -- cgit From 8d429db41075618372b6a18e7d4eb064f7839467 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 3 Jul 2000 04:26:37 +0000 Subject: first pass at merging rpcclient from TNG to HEAD. You can get a semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. The changes to the header files were minor. A few struct's and a few additional fields to existing ones. No deletions. **minimal change necessary** :-) Well, maybe not minimal, but I tried. All other programs compile, link and run ok from what I can tell so I don;t think I broke anything. --jerry (This used to be commit cd7f0b0b91afd3331c0607ba2fcb3ccdd41ecebf) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 406f2e972c..625277d856 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -124,6 +124,8 @@ struct cli_state { fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; + vuser_key key; + uint32 ntlmssp_flags; BOOL use_oplocks; /* should we use oplocks? */ }; -- cgit From 5ec1642809d9de83da8c88c65d6595c6eb0270f5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Jul 2000 00:47:19 +0000 Subject: Ok - this is a *BIG* change - but it fixes the problems with static strings in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy. (This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 625277d856..748c7375e1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -107,6 +107,8 @@ struct cli_state { int win95; uint32 capabilities; + TALLOC_CTX *mem_ctx; + /* * Only used in NT domain calls. */ -- cgit From 6f58dd587124c8b85fc62177b26129aaea5819b0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Nov 2000 00:59:18 +0000 Subject: Ok - fixed a bug in our levelII oplock code. We need to break a level II on a byte range lock (write lock only, but Win2k breaks on read lock also so I do the same) - if you think about why, this is obvious. Also fixed our client code to do level II oplocks, if requested, and fixed the code where we would assume the client wanted level II if it advertised itself as being level II capable - it may not want that. Jeremy. (This used to be commit 213cd0b5192307cd4b0026cae94b2f52fb1b0c02) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 748c7375e1..ae7229b516 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -130,6 +130,7 @@ struct cli_state { uint32 ntlmssp_flags; BOOL use_oplocks; /* should we use oplocks? */ + BOOL use_level_II_oplocks; /* should we use level II oplocks? */ }; #endif /* _CLIENT_H */ -- cgit From 6492d6b2f6a2743f5e794447911cbbba7e031d5d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Feb 2001 08:09:06 +0000 Subject: initial client side unicode support (needed for netapp filer) I've currently got this code disabled by default as it is incomplete. You enable it by setting a USE_UNICODE environment variable. Once the support is complete this check will be removed and the CAP_UNICODE capability bit will be the sole determination of whether the client library code uses unicode right now I have converted session_setup and tconx. I will do more fns over the next few days. see clistr.c for the new client side string interface. Luckily it tends to make the code smaller and neater while adding unicode support. (This used to be commit e1a04e621f1c28d8e6e543d43741ca0272e2237f) --- source3/include/client.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index ae7229b516..1f4cd55a83 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -29,6 +29,12 @@ will be a multiple of the page size on almost any system */ #define CLI_BUFFER_SIZE (0xFFFF) + +/* clistr flags - see clistr.c */ +#define CLISTR_TERMINATE 1 +#define CLISTR_CONVERT 2 +#define CLISTR_UPPER 4 + /* * These definitions depend on smb.h */ -- cgit From 3910d7baca440b21e66c1dc15556748c6f028085 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Feb 2001 02:51:22 +0000 Subject: added support for a CLISTR_ASCII flag so we can use a uniform interface for ascii-only fields (This used to be commit cdf0316610803e6743936b29f232b32f9ec81422) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 1f4cd55a83..1296b03370 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -34,6 +34,7 @@ #define CLISTR_TERMINATE 1 #define CLISTR_CONVERT 2 #define CLISTR_UPPER 4 +#define CLISTR_ASCII 8 /* * These definitions depend on smb.h -- cgit From 0d54de536c03f941739359a121a337aa33a2dc84 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Feb 2001 06:53:42 +0000 Subject: made some LANMAN1 wildcard progress it now handles -M LANMAN1 -f '.x' -m '?x' nicely (This used to be commit e7ccb9be6da9b1426eb136b4a0a1171232471768) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 1296b03370..ddfc65db32 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -35,6 +35,7 @@ #define CLISTR_CONVERT 2 #define CLISTR_UPPER 4 #define CLISTR_ASCII 8 +#define CLISTR_UNICODE 16 /* * These definitions depend on smb.h -- cgit From 45c2ee3ff2d01fdd0a2db9fa90457cff4663c43d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 10 Mar 2001 11:35:25 +0000 Subject: to use the same macros in the client and server rename the CLISTR_ macros to STR_ (This used to be commit 95c9e4e0ba8f37f565aaf136f41eb76489441ff7) --- source3/include/client.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index ddfc65db32..bdc2383f8e 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -30,13 +30,6 @@ #define CLI_BUFFER_SIZE (0xFFFF) -/* clistr flags - see clistr.c */ -#define CLISTR_TERMINATE 1 -#define CLISTR_CONVERT 2 -#define CLISTR_UPPER 4 -#define CLISTR_ASCII 8 -#define CLISTR_UNICODE 16 - /* * These definitions depend on smb.h */ -- cgit From e324e21457b232acb13a06fa5a4b8f363b3dec7c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Jun 2001 08:26:15 +0000 Subject: added a oplock break handler hook to the client code, this allows for more complete testing of oplocks from smbtorture and would also be essential if a client app ever really did want to use oplocks properly (This used to be commit 3d4a3bfacd9ef225aeaab801e5a216d12814b60a) --- source3/include/client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index bdc2383f8e..ecd97c1433 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -132,6 +132,9 @@ struct cli_state { BOOL use_oplocks; /* should we use oplocks? */ BOOL use_level_II_oplocks; /* should we use level II oplocks? */ + + /* a oplock break request handler */ + BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); }; #endif /* _CLIENT_H */ -- cgit From af0af3d42a9a3f80af5db0efb57692fc87f81763 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 10 Aug 2001 05:50:20 +0000 Subject: Removed nt_error field from cli_state as it was not used anywhere. (This used to be commit 589aaa5fb1ac55d8b0d5ae95921f071eb6ddacf6) --- source3/include/client.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index ecd97c1433..61a5633b98 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -114,7 +114,6 @@ struct cli_state { * Only used in NT domain calls. */ - uint32 nt_error; /* NT RPC error code. */ uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ -- cgit From 4fe127dbe88af47178a0dad46e42aa6400ade67e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Sep 2001 05:20:43 +0000 Subject: added a little smbtorture test for dumping the unicode table of a server. This is just a framework right now - I want this to eventually replace the win32 test code from monyo The interesting this about this test is that it shows up a really horrible performance bug in our stat cache code. I'll see if I can fix it. (This used to be commit eb668b54af4925194c07b217724657f406ec00d0) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 61a5633b98..d694afd72b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -45,7 +45,7 @@ typedef struct file_info time_t atime; time_t ctime; pstring name; - char short_name[13]; + char short_name[13*3]; /* the *3 is to cope with multi-byte */ } file_info; struct print_job_info -- cgit From 81f56139b6964ddbe2c03232475f87f474136490 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Oct 2001 07:42:52 +0000 Subject: initial kerberos/ADS/SPNEGO support in libsmb and smbclient. To activate you need to: - install krb5 libraries - run configure - build smbclient - run kinit to get a TGT - run smbclient with the -k option to choose kerberos auth (This used to be commit d33057585644e1337bac743e25ed7653bfb39eef) --- source3/include/client.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d694afd72b..24a9d47090 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -92,7 +92,7 @@ struct cli_state { struct in_addr dest_ip; struct pwd_info pwd; - unsigned char cryptkey[8]; + DATA_BLOB secblob; /* cryptkey or negTokenInit */ uint32 sesskey; int serverzone; uint32 servertime; @@ -128,6 +128,7 @@ struct cli_state { uint16 max_recv_frag; vuser_key key; uint32 ntlmssp_flags; + BOOL use_spnego; /* until we do NTLMSSP we need to make this optional */ BOOL use_oplocks; /* should we use oplocks? */ BOOL use_level_II_oplocks; /* should we use level II oplocks? */ -- cgit From 9f7cb41f11c0d2fc09104f6998f75c59bc363b26 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Oct 2001 04:49:42 +0000 Subject: added NTLMSSP authentication to libsmb. It seems to work well so I have enabled it by default if the server supports it. Let me know if this breaks anything. Choose kerberos with the -k flag to smbclient, otherwise it will use SPNEGO/NTLMSSP/NTLM (This used to be commit 076aa97bee54d182288d9e93ae160ae22a5f7757) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 24a9d47090..22ea10b9a7 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -128,7 +128,7 @@ struct cli_state { uint16 max_recv_frag; vuser_key key; uint32 ntlmssp_flags; - BOOL use_spnego; /* until we do NTLMSSP we need to make this optional */ + BOOL use_kerberos; BOOL use_oplocks; /* should we use oplocks? */ BOOL use_level_II_oplocks; /* should we use level II oplocks? */ -- cgit From 4ccdb15532ef707dea44e2c7316e2a3334abab86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 22 Oct 2001 06:48:35 +0000 Subject: a quick fix to get rpcclient working again. This just disables NTLMSSP in cli_establish_connection() What we really need to do is kill off the pwd_cache code. It is horrible, and assumes the challenge comes in the negprot reply. (This used to be commit 3f919b4360b3bfcc133f7d88bc5177e9d93f2db2) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 22ea10b9a7..46c8254b09 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -129,6 +129,7 @@ struct cli_state { vuser_key key; uint32 ntlmssp_flags; BOOL use_kerberos; + BOOL use_spnego; BOOL use_oplocks; /* should we use oplocks? */ BOOL use_level_II_oplocks; /* should we use level II oplocks? */ -- cgit From e92823610acb138ca63648f04a57427f8dbf0b41 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 25 Nov 2001 02:58:15 +0000 Subject: oops, I forgot to include the header file (This used to be commit c28956d8601c103c3f8dab4253de80e6a00a02d7) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 46c8254b09..9dd41313f2 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -136,6 +136,8 @@ struct cli_state { /* a oplock break request handler */ BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); + + BOOL force_dos_errors; }; #endif /* _CLIENT_H */ -- cgit From 701ecfc7a0a944844cadfd0b2c19f104ab7984b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 27 Nov 2001 03:29:20 +0000 Subject: prevent a memory leak of cli structures (This used to be commit 911c57403bd116405876e73913ad73efd15f659b) --- source3/include/client.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 9dd41313f2..fde001813d 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -138,6 +138,10 @@ struct cli_state { BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); BOOL force_dos_errors; + + /* was this structure allocated by cli_initialise? If so, then + free in cli_shutdown() */ + BOOL allocated; }; #endif /* _CLIENT_H */ -- cgit From 8d5f5825c4a534a0704e52f93eba878b860c4835 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 2 Jan 2002 05:38:09 +0000 Subject: struct cli_state remembers the pipe name that it's talking to, if any, so that we can print it in later debug messages. (This used to be commit 37ae84f782e1de6fcea92acb2189683cdf8e7e92) --- source3/include/client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index fde001813d..a8be1d16e1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -142,6 +142,9 @@ struct cli_state { /* was this structure allocated by cli_initialise? If so, then free in cli_shutdown() */ BOOL allocated; + + /* Name of the pipe we're talking to, if any */ + fstring pipe_name; }; #endif /* _CLIENT_H */ -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/include/client.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index a8be1d16e1..e6d1f429a1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-1998 Copyright (C) Luke Kenneth Casson Leighton 1996-1998 -- cgit From d58af01dcc1c0c872d9d376b58f812b81e7adf1d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sat, 16 Feb 2002 01:16:13 +0000 Subject: Removed some random crap that isn't used anymore. (This used to be commit 3fb3bc0a1546dadb24231065b422349bd199e1bf) --- source3/include/client.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index e6d1f429a1..0974cd0666 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -125,7 +125,6 @@ struct cli_state { fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; - vuser_key key; uint32 ntlmssp_flags; BOOL use_kerberos; BOOL use_spnego; -- cgit From e90b65284812aaa5ff9e9935ce9bbad7791cbbcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Jul 2002 10:35:28 +0000 Subject: updated the 3.0 branch from the head branch - ready for alpha18 (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce) --- source3/include/client.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0974cd0666..711ae1fd19 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -57,6 +57,15 @@ struct print_job_info time_t t; }; +typedef struct smb_sign_info { + BOOL use_smb_signing; + BOOL negotiated_smb_signing; + size_t mac_key_len; + uint8 mac_key[44]; + uint32 send_seq_num; + uint32 reply_seq_num; +} smb_sign_info; + struct cli_state { int port; int fd; @@ -69,7 +78,6 @@ struct cli_state { int rap_error; int privileges; - fstring eff_name; fstring desthost; fstring user_name; fstring domain; @@ -109,6 +117,8 @@ struct cli_state { TALLOC_CTX *mem_ctx; + smb_sign_info sign_info; + /* * Only used in NT domain calls. */ @@ -145,4 +155,8 @@ struct cli_state { fstring pipe_name; }; +#define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 +#define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002 +#define CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK 0x0004 + #endif /* _CLIENT_H */ -- cgit From a834a73e341059be154426390304a42e4a011f72 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 25 Sep 2002 15:19:00 +0000 Subject: sync'ing up for 3.0alpha20 release (This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 711ae1fd19..1e8d1c3d29 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -60,6 +60,7 @@ struct print_job_info typedef struct smb_sign_info { BOOL use_smb_signing; BOOL negotiated_smb_signing; + BOOL temp_smb_signing; size_t mac_key_len; uint8 mac_key[44]; uint32 send_seq_num; -- cgit From 5cec60b31b63821ebc35f0a3f02b96329a08387d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 1 Oct 2002 01:41:20 +0000 Subject: Added error string for server timeout on client call. Jeremy. (This used to be commit 28d2eb934318818a3b0527e391987ea139dbf4a3) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 1e8d1c3d29..7a8889edc5 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -70,6 +70,7 @@ typedef struct smb_sign_info { struct cli_state { int port; int fd; + int smb_read_error; /* Copy of last read error. */ uint16 cnum; uint16 pid; uint16 mid; -- cgit From 8147df0b6b4674670e70b45c603e8323e5c61c33 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 1 Oct 2002 06:50:38 +0000 Subject: Cope with rw errors and timeout to peer. Jeremy. (This used to be commit d8d351eb01ea7c84828dbc96224d7b13d643b558) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 7a8889edc5..17fd150065 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -70,7 +70,7 @@ typedef struct smb_sign_info { struct cli_state { int port; int fd; - int smb_read_error; /* Copy of last read error. */ + int smb_rw_error; /* Copy of last read or write error. */ uint16 cnum; uint16 pid; uint16 mid; -- cgit From 3fc4d88d99b8629e7e3f97d6e70254ef0865a5e5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 10 Dec 2002 23:44:33 +0000 Subject: Fix client reporting of 64 bit files. Jeremy. (This used to be commit 8dcbfa4e770d74d4ce6faaf1a0597d07d0a5cc81) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 17fd150065..853ee7ae42 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -35,7 +35,7 @@ typedef struct file_info { - SMB_OFF_T size; + SMB_BIG_UINT size; uint16 mode; uid_t uid; gid_t gid; -- cgit From d1221c9b6c369113a531063737890b58d89bf6fe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 24 Feb 2003 02:55:00 +0000 Subject: Merge from HEAD client-side authentication changes: - new kerberos code, allowing the account to change it's own password without special SD settings required - NTLMSSP client code, now seperated from cliconnect.c - NTLMv2 client code - SMB signing fixes Andrew Bartlett (This used to be commit 837680ca517982f2e5944730581a83012d4181ae) --- source3/include/client.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 853ee7ae42..73e29a1fff 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -62,9 +62,10 @@ typedef struct smb_sign_info { BOOL negotiated_smb_signing; BOOL temp_smb_signing; size_t mac_key_len; - uint8 mac_key[44]; + uint8 mac_key[64]; uint32 send_seq_num; uint32 reply_seq_num; + BOOL allow_smb_signing; } smb_sign_info; struct cli_state { @@ -121,6 +122,10 @@ struct cli_state { smb_sign_info sign_info; + /* the session key for this CLI, outside + any per-pipe authenticaion */ + unsigned char user_session_key[16]; + /* * Only used in NT domain calls. */ -- cgit From dbe2858b862232ede390fe0088f82d1e826612f9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 13 Mar 2003 00:51:05 +0000 Subject: Change size parameters from signed to unsigned to fix up warnings. Jeremy. (This used to be commit 33b11d5eb53bdeb9d279d221fd5c01579253e1c7) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 73e29a1fff..3375bacb0f 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -113,7 +113,7 @@ struct cli_state { int max_mux; char *outbuf; char *inbuf; - int bufsize; + unsigned int bufsize; int initialised; int win95; uint32 capabilities; -- cgit From e88eab35bc03a2d108b27f2209ec4cfb395dcdba Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 17 Mar 2003 23:04:03 +0000 Subject: Merge from HEAD: signed/unsigned (mostly i counters) a little bit of const. Andrew Bartlett (This used to be commit 50f0ca752e5058c4051f42a9337361373ba1f727) --- source3/include/client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 3375bacb0f..28d6a8c330 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -109,8 +109,8 @@ struct cli_state { int readbraw_supported; int writebraw_supported; int timeout; /* in milliseconds. */ - int max_xmit; - int max_mux; + size_t max_xmit; + size_t max_mux; char *outbuf; char *inbuf; unsigned int bufsize; -- cgit From 892599fb92b6158e86a3934c8f2045ee457f38e3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 18 Mar 2003 12:01:47 +0000 Subject: Merge from HEAD: A much better SMB signing module, that allows for mulitple signing algorithms and correctly backs down from signing when the server cannot sign the reply. This also attempts to enable SMB signing on NTLMSSP connections, but I don't know what NTLMSSP flags to set yet. This would allow 'client use signing' to be set by default, for server compatability. (A seperate option value should be provided for mandetory signing, which would not back down). Andrew Bartlett (This used to be commit 1c87be7a3d127201a6ab78d22d17c971af16b86b) --- source3/include/client.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 28d6a8c330..0ea793de68 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -58,14 +58,15 @@ struct print_job_info }; typedef struct smb_sign_info { - BOOL use_smb_signing; + void (*sign_outgoing_message)(struct cli_state *cli); + BOOL (*check_incoming_message)(struct cli_state *cli); + void (*free_signing_context)(struct cli_state *cli); + void *signing_context; + BOOL negotiated_smb_signing; - BOOL temp_smb_signing; - size_t mac_key_len; - uint8 mac_key[64]; - uint32 send_seq_num; - uint32 reply_seq_num; BOOL allow_smb_signing; + BOOL doing_signing; + BOOL mandetory_signing; } smb_sign_info; struct cli_state { -- cgit From 7238bf5f40e16360439e028fa7607a5a28e02965 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 9 Apr 2003 15:54:17 +0000 Subject: This is the netlogon schannel client code. Try a rpcclient -S pdc -U% -c "samlogon user password" and it should work with the schannel. Needs testing against platforms different from NT4SP6. Volker (This used to be commit eaef0d8aeff1aa5a067679be3f17e08d7434e1e8) --- source3/include/client.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0ea793de68..d75effd7d0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -132,6 +132,12 @@ struct cli_state { */ uint16 nt_pipe_fnum; /* Pipe handle. */ + + uint16 saved_netlogon_pipe_fnum; /* The "first" pipe to get + the session key for the + schannel. */ + struct netsec_auth_struct auth_info; + unsigned char sess_key[16]; /* Current session key. */ unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ -- cgit From 456f51bcbe04ccbb37a27b6e115a851cc134adcd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Jul 2003 08:46:32 +0000 Subject: Jeremy requested that I get my NTLMSSP patch into CVS. He didn't request the schannel code, but I've included that anyway. :-) This patch revives the client-side NTLMSSP support for RPC named pipes in Samba, and cleans up the client and server schannel code. The use of the new code is enabled by the 'sign', 'seal' and 'schannel' commands in rpcclient. The aim was to prove that our separate NTLMSSP client library actually implements NTLMSSP signing and sealing as per Microsoft's NTLMv1 implementation, in the hope that knowing this will assist us in correctly implementing NTLMSSP signing for SMB packets. (Still not yet functional) This patch replaces the NTLMSSP implementation in rpc_client/cli_pipe.c with calls to libsmb/ntlmssp.c. In the process, we have gained the ability to use the more secure NT password, and the ability to sign-only, instead of having to seal the pipe connection. (Previously we were limited to sealing, and could only use the LM-password derived key). Our new client-side NTLMSSP code also needed alteration to cope with our comparatively simple server-side implementation. A future step is to replace it with calls to the same NTLMSSP library. Also included in this patch is the schannel 'sign only' patch I submitted to the team earlier. While not enabled (and not functional, at this stage) the work in this patch makes the code paths *much* easier to follow. I have also included similar hooks in rpccleint to allow the use of schannel on *any* pipe. rpcclient now defaults to not using schannel (or any other extra per-pipe authenticiation) for any connection. The 'schannel' command enables schannel for all pipes until disabled. This code is also much more secure than the previous code, as changes to our cli_pipe routines ensure that the authentication footer cannot be removed by an attacker, and more error states are correctly handled. (The same needs to be done to our server) Andrew Bartlett (This used to be commit 5472ddc9eaf4e79c5b2e1c8ee8c7f190dc285f19) --- source3/include/client.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d75effd7d0..f3f4ef109a 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -131,25 +131,30 @@ struct cli_state { * Only used in NT domain calls. */ + int pipe_idx; /* Index (into list of known pipes) + of the pipe we're talking to, + if any */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + /* Secure pipe parameters */ + int pipe_auth_flags; + uint16 saved_netlogon_pipe_fnum; /* The "first" pipe to get the session key for the schannel. */ struct netsec_auth_struct auth_info; + NTLMSSP_CLIENT_STATE *ntlmssp_pipe_state; + unsigned char sess_key[16]; /* Current session key. */ - unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ - uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ - uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ - uint32 ntlmssp_seq_num; /* ntlmssp sequence number */ DOM_CRED clnt_cred; /* Client credential. */ fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; - uint32 ntlmssp_flags; + BOOL use_kerberos; BOOL use_spnego; -- cgit From c44a9d25a2bfff9d5ebede80f30e13e41aca797c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Jul 2003 23:05:57 +0000 Subject: Added the "required" keyword to the "client signing" parameter to force it on. Fail if missmatch. Small format tidyups in smbd/sesssetup.c. Preparing to add signing on server side. Jeremy. (This used to be commit c390b3e4cd68cfc233ddf14d139e25d40f050f27) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index f3f4ef109a..fad2c099b9 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -66,7 +66,7 @@ typedef struct smb_sign_info { BOOL negotiated_smb_signing; BOOL allow_smb_signing; BOOL doing_signing; - BOOL mandetory_signing; + BOOL mandatory_signing; } smb_sign_info; struct cli_state { -- cgit From 6ab5e14494ed6b579658f4fe3410759582d909cd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 Jul 2003 22:57:56 +0000 Subject: Refactor signing code to remove most dependencies on 'struct cli'. Ensure a server can't do a downgrade attack if client signing is mandatory. Add a lp_server_signing() function and a 'server signing' parameter that will act as the client one does. Jeremy (This used to be commit 203e4bf0bfb66fd9239e9a0656438a71280113cb) --- source3/include/client.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index fad2c099b9..598e6c0bda 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -57,18 +57,6 @@ struct print_job_info time_t t; }; -typedef struct smb_sign_info { - void (*sign_outgoing_message)(struct cli_state *cli); - BOOL (*check_incoming_message)(struct cli_state *cli); - void (*free_signing_context)(struct cli_state *cli); - void *signing_context; - - BOOL negotiated_smb_signing; - BOOL allow_smb_signing; - BOOL doing_signing; - BOOL mandatory_signing; -} smb_sign_info; - struct cli_state { int port; int fd; -- cgit From fcbfc7ad0669009957c65fa61bb20df75a9701b4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 22 Nov 2003 13:19:38 +0000 Subject: Changes all over the shop, but all towards: - NTLM2 support in the server - KEY_EXCH support in the server - variable length session keys. In detail: - NTLM2 is an extension of NTLMv1, that is compatible with existing domain controllers (unlike NTLMv2, which requires a DC upgrade). * This is known as 'NTLMv2 session security' * (This is not yet implemented on the RPC pipes however, so there may well still be issues for PDC setups, particuarly around password changes. We do not fully understand the sign/seal implications of NTLM2 on RPC pipes.) This requires modifications to our authentication subsystem, as we must handle the 'challege' input into the challenge-response algorithm being changed. This also needs to be turned off for 'security=server', which does not support this. - KEY_EXCH is another 'security' mechanism, whereby the session key actually used by the server is sent by the client, rather than being the shared-secret directly or indirectly. - As both these methods change the session key, the auth subsystem needed to be changed, to 'override' session keys provided by the backend. - There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation. - The 'names blob' in NTLMSSP is always in unicode - never in ascii. Don't make an ascii version ever. - The other big change is to allow variable length session keys. We have always assumed that session keys are 16 bytes long - and padded to this length if shorter. However, Kerberos session keys are 8 bytes long, when the krb5 login uses DES. * This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. * - Add better DEBUG() messages to ntlm_auth, warning administrators of misconfigurations that prevent access to the privileged pipe. This should help reduce some of the 'it just doesn't work' issues. - Fix data_blob_talloc() to behave the same way data_blob() does when passed a NULL data pointer. (just allocate) REMEMBER to make clean after this commit - I have changed plenty of data structures... (This used to be commit f3bbc87b0dac63426cda6fac7a295d3aad810ecc) --- source3/include/client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 598e6c0bda..968b73f0b4 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -113,7 +113,7 @@ struct cli_state { /* the session key for this CLI, outside any per-pipe authenticaion */ - unsigned char user_session_key[16]; + DATA_BLOB user_session_key; /* * Only used in NT domain calls. @@ -133,7 +133,7 @@ struct cli_state { schannel. */ struct netsec_auth_struct auth_info; - NTLMSSP_CLIENT_STATE *ntlmssp_pipe_state; + NTLMSSP_STATE *ntlmssp_pipe_state; unsigned char sess_key[16]; /* Current session key. */ DOM_CRED clnt_cred; /* Client credential. */ -- cgit From 2acd0848663f28afedff9b11b738e048f5ead2cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 15 Jun 2004 18:36:45 +0000 Subject: r1154: Change default setting for case sensitivity to "auto". If set to auto then is the client supports it (current clients supported are Samba and CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare "NT LM 0.12" string) then the setting of the per packet flag smb_flag FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows the linux CIFS client to use Samba in a case sensitive manner. Additional command in smbclient "case_sensitive", toggles the flag in subsequent packets. Docs to follow. Jeremy. (This used to be commit cf84c0fe1a061acc0313f7db124b8f947cdf623d) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 968b73f0b4..52a6c76299 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -153,6 +153,7 @@ struct cli_state { BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); BOOL force_dos_errors; + BOOL case_sensitive; /* False by default. */ /* was this structure allocated by cli_initialise? If so, then free in cli_shutdown() */ -- cgit From 5b713a206bf9c05faad750512886f4bbeebb21f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Dec 2004 00:25:11 +0000 Subject: r4186: Fix client & server to allow 127k READX calls. Jeremy. (This used to be commit 831cb21a874601e4536c2cf76c5351e1d0defcb5) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 52a6c76299..b556538f74 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -27,7 +27,7 @@ overlap on the wire. This size gives us a nice read/write size, which will be a multiple of the page size on almost any system */ #define CLI_BUFFER_SIZE (0xFFFF) - +#define CLI_MAX_LARGE_READX_SIZE (127*1024) /* * These definitions depend on smb.h -- cgit From c85d9e735c8294088203f1656ae07a4b0835292c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 6 Jan 2005 15:35:02 +0000 Subject: r4570: Replace cli->nt_pipe_fnum with an array of NT file numbers, one for each supported pipe. Netlogon is still special, as we open that twice, one to do the auth2, the other one with schannel. The client interface is completely unchanged for those who only use a single pie. cli->pipe_idx is used as the index for everything except the "real" client rpc calls, which have been explicitly converted in my last commit. Next step is to get winbind to just use a single smb connection for multiple pipes. Volker (This used to be commit dc294c52e0216424236057ca6cd35e1ebf51d0da) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index b556538f74..c182544362 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -123,7 +123,7 @@ struct cli_state { of the pipe we're talking to, if any */ - uint16 nt_pipe_fnum; /* Pipe handle. */ + uint16 nt_pipe_fnum[PI_MAX_PIPES]; /* Pipe handle. */ /* Secure pipe parameters */ int pipe_auth_flags; -- cgit From c24c328a9e006473f4dba49fdf1842fb28952ec7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Jan 2005 20:21:15 +0000 Subject: r4970: Fix for bug 2092, allowing fallback after kerberos and allow gnome vfs to prevent auto-anonymous logon. Jeremy. (This used to be commit 843e85bcd978d025964c4d45d9a3886c7cf7f63c) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c182544362..8ae8faf90d 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -144,6 +144,7 @@ struct cli_state { uint16 max_recv_frag; BOOL use_kerberos; + BOOL fallback_after_kerberos; BOOL use_spnego; BOOL use_oplocks; /* should we use oplocks? */ -- cgit From 01b87c63c90083dbb7a56d038f714bde1a49fb2a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Feb 2005 17:29:28 +0000 Subject: r5518: Add initial msdfs support to smbclient. Currently I can only cd up and down the tree and get directory listings. Still have to figure out how to get a directory listing on a 2k dfs root. Also have to work out some issues with relative paths that cross dfs mount points. We're protected from the new code paths when connecting to a non-dfs root share ( the flag from the tcon&X is stored in the struct cli_state* ) (This used to be commit e57fd2c5f00de2b11a2b44374830e89a90bc0022) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 8ae8faf90d..61c420c06b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -106,6 +106,7 @@ struct cli_state { int initialised; int win95; uint32 capabilities; + BOOL dfsroot; TALLOC_CTX *mem_ctx; -- cgit From fed660877c16562265327c6093ea645cf4176b5c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 22:10:34 +0000 Subject: r7415: * big change -- volker's new async winbindd from trunk (This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8) --- source3/include/client.h | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 61c420c06b..e9d40c3b7c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -57,6 +57,27 @@ struct print_job_info time_t t; }; +struct rpc_pipe_client { + TALLOC_CTX *mem_ctx; + + struct cli_state *cli; + + int pipe_idx; + uint16 fnum; + + int pipe_auth_flags; + + NTLMSSP_STATE *ntlmssp_pipe_state; + const char *user_name; + const char *domain; + struct pwd_info pwd; + + struct netsec_auth_struct auth_info; + + uint16 max_xmit_frag; + uint16 max_recv_frag; +}; + struct cli_state { int port; int fd; @@ -124,25 +145,19 @@ struct cli_state { of the pipe we're talking to, if any */ - uint16 nt_pipe_fnum[PI_MAX_PIPES]; /* Pipe handle. */ + struct rpc_pipe_client pipes[PI_MAX_PIPES]; /* Secure pipe parameters */ int pipe_auth_flags; - uint16 saved_netlogon_pipe_fnum; /* The "first" pipe to get - the session key for the - schannel. */ - struct netsec_auth_struct auth_info; - - NTLMSSP_STATE *ntlmssp_pipe_state; - + struct rpc_pipe_client netlogon_pipe; /* The "first" pipe to get + the session key for the + schannel. */ unsigned char sess_key[16]; /* Current session key. */ DOM_CRED clnt_cred; /* Client credential. */ fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ fstring clnt_name_slash; /* \\local client. */ - uint16 max_xmit_frag; - uint16 max_recv_frag; BOOL use_kerberos; BOOL fallback_after_kerberos; -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/include/client.h | 58 ++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index e9d40c3b7c..df52e227f0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -57,25 +57,39 @@ struct print_job_info time_t t; }; +struct cli_pipe_auth_data { + enum pipe_auth_type auth_type; /* switch for the union below. Defined in ntdomain.h */ + enum pipe_auth_level auth_level; /* defined in ntdomain.h */ + union { + struct schannel_auth_struct *schannel_auth; + NTLMSSP_STATE *ntlmssp_state; + struct kerberos_auth_struct *kerberos_auth; + } a_u; + void (*cli_auth_data_free_func)(struct cli_pipe_auth_data *); +}; + struct rpc_pipe_client { + struct rpc_pipe_client *prev, *next; + TALLOC_CTX *mem_ctx; struct cli_state *cli; int pipe_idx; + const char *pipe_name; uint16 fnum; - int pipe_auth_flags; - - NTLMSSP_STATE *ntlmssp_pipe_state; - const char *user_name; const char *domain; + const char *user_name; struct pwd_info pwd; - struct netsec_auth_struct auth_info; - uint16 max_xmit_frag; uint16 max_recv_frag; + + struct cli_pipe_auth_data auth; + + /* The following is only non-null on a netlogon pipe. */ + struct dcinfo *dc; }; struct cli_state { @@ -92,8 +106,11 @@ struct cli_state { int privileges; fstring desthost; - fstring user_name; + + /* The credentials used to open the cli_state connection. */ fstring domain; + fstring user_name; + struct pwd_info pwd; /* * The following strings are the @@ -111,7 +128,6 @@ struct cli_state { fstring full_dest_host_name; struct in_addr dest_ip; - struct pwd_info pwd; DATA_BLOB secblob; /* cryptkey or negTokenInit */ uint32 sesskey; int serverzone; @@ -137,27 +153,8 @@ struct cli_state { any per-pipe authenticaion */ DATA_BLOB user_session_key; - /* - * Only used in NT domain calls. - */ - - int pipe_idx; /* Index (into list of known pipes) - of the pipe we're talking to, - if any */ - - struct rpc_pipe_client pipes[PI_MAX_PIPES]; - - /* Secure pipe parameters */ - int pipe_auth_flags; - - struct rpc_pipe_client netlogon_pipe; /* The "first" pipe to get - the session key for the - schannel. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ + /* The list of pipes currently open on this connection. */ + struct rpc_pipe_client *pipe_list; BOOL use_kerberos; BOOL fallback_after_kerberos; @@ -175,9 +172,6 @@ struct cli_state { /* was this structure allocated by cli_initialise? If so, then free in cli_shutdown() */ BOOL allocated; - - /* Name of the pipe we're talking to, if any */ - fstring pipe_name; }; #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 -- cgit From 057060feaf7395f475a32f9dad9e149ab0fa6a1c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 13 Oct 2005 15:51:25 +0000 Subject: r10964: BUG 1051: store the directory path so we can send the full name in the unlink call (del tmp\foo) (This used to be commit 49b8d7d7f5ed93a2b9b21404194452f35bcf7b26) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index df52e227f0..30e0fae874 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -44,6 +44,7 @@ typedef struct file_info time_t atime; time_t ctime; pstring name; + pstring dir; char short_name[13*3]; /* the *3 is to cope with multi-byte */ } file_info; -- cgit From 7b75d2c650cc8dfe8c9d5b9e396afce1cedb0645 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 22 Apr 2006 02:33:11 +0000 Subject: r15162: Patch for bug #3668. Windows has a bug with LARGE_READX where if you ask for exactly 64k bytes it returns 0. Jeremy. (This used to be commit dcef65acb5bc08ea4b61ef490a518b7e668ff2ee) --- source3/include/client.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 30e0fae874..c6d7b162fc 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -27,7 +27,8 @@ overlap on the wire. This size gives us a nice read/write size, which will be a multiple of the page size on almost any system */ #define CLI_BUFFER_SIZE (0xFFFF) -#define CLI_MAX_LARGE_READX_SIZE (127*1024) +#define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ +#define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ /* * These definitions depend on smb.h @@ -143,6 +144,7 @@ struct cli_state { unsigned int bufsize; int initialised; int win95; + BOOL is_samba; uint32 capabilities; BOOL dfsroot; -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/include/client.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c6d7b162fc..d11d198e1a 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -171,10 +171,6 @@ struct cli_state { BOOL force_dos_errors; BOOL case_sensitive; /* False by default. */ - - /* was this structure allocated by cli_initialise? If so, then - free in cli_shutdown() */ - BOOL allocated; }; #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 -- cgit From a64925ddff467a47f7adfac4b1b977ddc0c7f4ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Aug 2006 16:44:00 +0000 Subject: r17800: Start using struct timespec internally for file times on the wire. This allows us to go to nsec resolution for systems that support it. It should also now be easy to add a correct "create time" (birth time) for systems that support it (*BSD). I'll be watching the build farm closely after this one for breakage :-). Jeremy. (This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d) --- source3/include/client.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d11d198e1a..a89e39d160 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -41,9 +41,9 @@ typedef struct file_info uid_t uid; gid_t gid; /* these times are normally kept in GMT */ - time_t mtime; - time_t atime; - time_t ctime; + struct timespec mtime_ts; + struct timespec atime_ts; + struct timespec ctime_ts; pstring name; pstring dir; char short_name[13*3]; /* the *3 is to cope with multi-byte */ -- cgit From b80cbfc20e0d0ede84531a37e187274ba04e822c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Sep 2006 03:21:49 +0000 Subject: r18969: Fix typo. Guenther (This used to be commit 31f21282cd5fb27c867615790e7fd27df4cd4c0e) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index a89e39d160..dc266995c6 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -175,6 +175,6 @@ struct cli_state { #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002 -#define CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK 0x0004 +#define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004 #endif /* _CLIENT_H */ -- cgit From 540911001d1bf25d9534b72b90a32fc7e5efc4b0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Mar 2007 23:54:57 +0000 Subject: r21768: Fix the client dfs code such that smbclient can process deep dfs links (ie. links that go to non root parts of a share). Make the directory handling conanonical in POSIX and Windows pathname processing. dfs should not be fully working in client tools. Please bug me if not. Jeremy. (This used to be commit 1c9e10569cd97ee41de39f9f012bea4e4c932b5d) --- source3/include/client.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index dc266995c6..aa8a647947 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -34,21 +34,6 @@ * These definitions depend on smb.h */ -typedef struct file_info -{ - SMB_BIG_UINT size; - uint16 mode; - uid_t uid; - gid_t gid; - /* these times are normally kept in GMT */ - struct timespec mtime_ts; - struct timespec atime_ts; - struct timespec ctime_ts; - pstring name; - pstring dir; - char short_name[13*3]; /* the *3 is to cope with multi-byte */ -} file_info; - struct print_job_info { uint16 id; @@ -173,6 +158,21 @@ struct cli_state { BOOL case_sensitive; /* False by default. */ }; +typedef struct file_info { + struct cli_state *cli; + SMB_BIG_UINT size; + uint16 mode; + uid_t uid; + gid_t gid; + /* these times are normally kept in GMT */ + struct timespec mtime_ts; + struct timespec atime_ts; + struct timespec ctime_ts; + pstring name; + pstring dir; + char short_name[13*3]; /* the *3 is to cope with multi-byte */ +} file_info; + #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002 #define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004 -- cgit From c48b610b516b72edd6232235a6f83d388f5a0552 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Mar 2007 20:39:58 +0000 Subject: r21876: Start adding in the seal implementation - prototype code for the server side enc. (doesn't break anything). I'll keep updating this until I've got NTLM seal working on both client and server, then add in the gss level seal. Jeremy. (This used to be commit 530ac29abf23e920baa549e7cec55199edd8bd74) --- source3/include/client.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index aa8a647947..97922ba232 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -34,8 +34,7 @@ * These definitions depend on smb.h */ -struct print_job_info -{ +struct print_job_info { uint16 id; uint16 priority; size_t size; @@ -79,6 +78,19 @@ struct rpc_pipe_client { struct dcinfo *dc; }; +/* Transport encryption state. */ +enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_KRB5 }; + +struct smb_trans_enc_state { + enum smb_trans_enc_type smb_enc_type; + union { + NTLMSSP_STATE *ntlmssp_state; +#if defined(HAVE_GSSAPI_SUPPORT) && defined(HAVE_KRB5) + gss_ctx_id_t context_handle; +#endif + }; +}; + struct cli_state { int port; int fd; @@ -137,6 +149,8 @@ struct cli_state { smb_sign_info sign_info; + struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ + /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; -- cgit From 7ccf45684a1f83d7d48a4227aa56c53081d68283 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Mar 2007 22:45:35 +0000 Subject: r21880: Make client and server calls into encryption code symetrical, depending on encryption context pointer. Jeremy. (This used to be commit d3f3ced6c8a03d971143baf878158d671dfcbc3b) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 97922ba232..0f268834c6 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -83,6 +83,7 @@ enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_KRB5 }; struct smb_trans_enc_state { enum smb_trans_enc_type smb_enc_type; + BOOL enc_on; union { NTLMSSP_STATE *ntlmssp_state; #if defined(HAVE_GSSAPI_SUPPORT) && defined(HAVE_KRB5) -- cgit From 42238c78bb8820a21cfb08fc29a5109ee1a62bab Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Mar 2007 19:15:14 +0000 Subject: r21917: Start to do the gss versions of sign+seal. Jeremy. (This used to be commit a226645353a40047b72de1b96c3a7676a2bf1034) --- source3/include/client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0f268834c6..a81c19bc55 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -79,14 +79,14 @@ struct rpc_pipe_client { }; /* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_KRB5 }; +enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; struct smb_trans_enc_state { enum smb_trans_enc_type smb_enc_type; BOOL enc_on; union { NTLMSSP_STATE *ntlmssp_state; -#if defined(HAVE_GSSAPI_SUPPORT) && defined(HAVE_KRB5) +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) gss_ctx_id_t context_handle; #endif }; -- cgit From f93d75c932e7a48da8bcd589d7505bf5445b89df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Mar 2007 02:24:12 +0000 Subject: r21926: Fix missing enum specifier pointed out by Don McCall @ HP. Thanks Don ! Jeremy. (This used to be commit 662344d1ec3593689de7602afa518ed98e10dc37) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index a81c19bc55..817ab0d540 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -89,7 +89,7 @@ struct smb_trans_enc_state { #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) gss_ctx_id_t context_handle; #endif - }; + } s; }; struct cli_state { -- cgit From 8b63654c2e63448cc21505d7996e1a4805e391df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 Mar 2007 00:50:53 +0000 Subject: r21969: Start working on the gss-side of the server negotiation. Jeremy. (This used to be commit fbc569b530104679e47fe743963eb0c4384de6ae) --- source3/include/client.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 817ab0d540..3185f05ac1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -81,13 +81,20 @@ struct rpc_pipe_client { /* Transport encryption state. */ enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) +struct smb_tran_enc_state_gss { + gss_ctx_id_t gss_ctx; + gss_cred_id_t creds; +}; +#endif + struct smb_trans_enc_state { enum smb_trans_enc_type smb_enc_type; BOOL enc_on; union { NTLMSSP_STATE *ntlmssp_state; #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) - gss_ctx_id_t context_handle; + struct smb_tran_enc_state_gss *gss_state; #endif } s; }; -- cgit From 4a66d0e232271968ba96da50274428916a393975 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 Mar 2007 21:13:31 +0000 Subject: r21991: I hate Steve French :-). Add support for encryption contexts.... Jeremy. (This used to be commit ae8f3649f773b8a8dcb55921536d038d3475322e) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 3185f05ac1..4df2459fb2 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -90,6 +90,7 @@ struct smb_tran_enc_state_gss { struct smb_trans_enc_state { enum smb_trans_enc_type smb_enc_type; + uint16 enc_ctx_num; BOOL enc_on; union { NTLMSSP_STATE *ntlmssp_state; -- cgit From 32106b23951e01fb17f814584ebbcc8d7288cb75 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 16 May 2007 00:07:38 +0000 Subject: r22920: Add in the UNIX capability for 24-bit readX, as discussed with the Apple guys and Linux kernel guys. Still looking at how to do writeX as there's no recvfile(). Jeremy. (This used to be commit a53268fb2082de586e2df250d8ddfcff53379102) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 4df2459fb2..741ce6470d 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -29,6 +29,7 @@ #define CLI_BUFFER_SIZE (0xFFFF) #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ +#define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ /* * These definitions depend on smb.h @@ -152,6 +153,7 @@ struct cli_state { int win95; BOOL is_samba; uint32 capabilities; + uint32 posix_capabilities; BOOL dfsroot; TALLOC_CTX *mem_ctx; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 741ce6470d..fc28e4e82c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/include/client.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index fc28e4e82c..f8f6504442 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef _CLIENT_H -- cgit From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/include/client.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index f8f6504442..5165b85df1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -78,28 +78,6 @@ struct rpc_pipe_client { struct dcinfo *dc; }; -/* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; - -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) -struct smb_tran_enc_state_gss { - gss_ctx_id_t gss_ctx; - gss_cred_id_t creds; -}; -#endif - -struct smb_trans_enc_state { - enum smb_trans_enc_type smb_enc_type; - uint16 enc_ctx_num; - BOOL enc_on; - union { - NTLMSSP_STATE *ntlmssp_state; -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) - struct smb_tran_enc_state_gss *gss_state; -#endif - } s; -}; - struct cli_state { int port; int fd; @@ -159,8 +137,6 @@ struct cli_state { smb_sign_info sign_info; - struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ - /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/client.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 5165b85df1..597348d162 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -128,10 +128,10 @@ struct cli_state { unsigned int bufsize; int initialised; int win95; - BOOL is_samba; + bool is_samba; uint32 capabilities; uint32 posix_capabilities; - BOOL dfsroot; + bool dfsroot; TALLOC_CTX *mem_ctx; @@ -144,18 +144,18 @@ struct cli_state { /* The list of pipes currently open on this connection. */ struct rpc_pipe_client *pipe_list; - BOOL use_kerberos; - BOOL fallback_after_kerberos; - BOOL use_spnego; + bool use_kerberos; + bool fallback_after_kerberos; + bool use_spnego; - BOOL use_oplocks; /* should we use oplocks? */ - BOOL use_level_II_oplocks; /* should we use level II oplocks? */ + bool use_oplocks; /* should we use oplocks? */ + bool use_level_II_oplocks; /* should we use level II oplocks? */ /* a oplock break request handler */ - BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); + bool (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level); - BOOL force_dos_errors; - BOOL case_sensitive; /* False by default. */ + bool force_dos_errors; + bool case_sensitive; /* False by default. */ }; typedef struct file_info { -- cgit From f88b7a076be74a29a3bf876b4e2705f4a1ecf42b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Oct 2007 14:16:54 -0700 Subject: This is a large patch (sorry). Migrate from struct in_addr to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 597348d162..c4669dbf2e 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -112,7 +112,7 @@ struct cli_state { struct nmb_name called; struct nmb_name calling; fstring full_dest_host_name; - struct in_addr dest_ip; + struct sockaddr_storage dest_ss; DATA_BLOB secblob; /* cryptkey or negTokenInit */ uint32 sesskey; -- cgit From 329365684bca99bf9020b6638a1357df65c1d938 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Nov 2007 12:21:34 -0700 Subject: Change the client library to write directly out of the incoming buffer in the non-signed case. Speeds up writes by over 10% or so. Complete the server recvfile implementation. Jeremy. (This used to be commit 81ca5853b2475f123faab3b550f0a7b24ae3c208) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c4669dbf2e..e38017fe7b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -29,6 +29,7 @@ #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ #define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ +#define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */ /* * These definitions depend on smb.h -- cgit From 73d407968002587eadd0ff13eb413ddf07c78771 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Nov 2007 15:12:42 -0700 Subject: Remove the smb_read_error global variable and replace it with accessor functions. "One global or pstring a day...." :-). Jeremy. (This used to be commit d50d14c300abc83b7015718ec48acc8b3227a273) --- source3/include/client.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index e38017fe7b..d8c35780a4 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -82,7 +82,8 @@ struct rpc_pipe_client { struct cli_state { int port; int fd; - int smb_rw_error; /* Copy of last read or write error. */ + /* Copy of last read or write error. */ + enum smb_read_errors smb_rw_error; uint16 cnum; uint16 pid; uint16 mid; -- cgit From 36441da4240f3e3a296eed65f0796b25b7b05a3a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Nov 2007 11:12:56 -0800 Subject: Remove the horror that was the global smb_rw_error. Each cli struct has it's own local copy of this variable, so use that in client code. In the smbd server, add one static to smbd/proccess.c and use that inside smbd. Fix a bunch of places where smb_rw_error could be set by calling read_data() in places where we weren't reading from the SMB client socket (ie. winbindd). Jeremy. (This used to be commit 255c2adf7b6ef30932b5bb9f142ccef4a5d3d0db) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d8c35780a4..dd8bb0dba9 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -82,7 +82,7 @@ struct rpc_pipe_client { struct cli_state { int port; int fd; - /* Copy of last read or write error. */ + /* Last read or write error. */ enum smb_read_errors smb_rw_error; uint16 cnum; uint16 pid; -- cgit From d2cf97aeba14a4d336fb57b01f19bd5a08dcb003 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 29 Nov 2007 13:24:54 -0800 Subject: Remove the explicit TALLOC_CTX * from cli_struct. Make us very explicit about how long a talloc ctx should last. Jeremy. (This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62) --- source3/include/client.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index dd8bb0dba9..c601e1a91c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -135,7 +135,10 @@ struct cli_state { uint32 posix_capabilities; bool dfsroot; - TALLOC_CTX *mem_ctx; +#if 0 + TALLOC_CTX *longterm_mem_ctx; + TALLOC_CTX *call_mem_ctx; +#endif smb_sign_info sign_info; @@ -170,8 +173,8 @@ typedef struct file_info { struct timespec mtime_ts; struct timespec atime_ts; struct timespec ctime_ts; - pstring name; - pstring dir; + char name[1024]; + char dir[1024]; /* Should use allocated PATH_MAX here.... */ char short_name[13*3]; /* the *3 is to cope with multi-byte */ } file_info; -- cgit From 1b92ea5559bfa00016103508feac9a06ea4b66ae Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 Dec 2007 17:16:33 -0800 Subject: Remove pstrings from client/client.c by doing a large rewrite. Mostly compiles.... Jeremy. (This used to be commit c87f3eba9aa52f4ab25d77e2167262bf5c43b1a6) --- source3/include/client.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c601e1a91c..0047b2bf23 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -142,7 +142,7 @@ struct cli_state { smb_sign_info sign_info; - /* the session key for this CLI, outside + /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; @@ -173,8 +173,7 @@ typedef struct file_info { struct timespec mtime_ts; struct timespec atime_ts; struct timespec ctime_ts; - char name[1024]; - char dir[1024]; /* Should use allocated PATH_MAX here.... */ + char *name; char short_name[13*3]; /* the *3 is to cope with multi-byte */ } file_info; -- cgit From afc93255d183eefb68e45b8ec6275f6a62cf9795 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 26 Dec 2007 17:12:36 -0800 Subject: Add SMB encryption. Still fixing client decrypt but negotiation works. Jeremy. (This used to be commit d78045601af787731f0737b8627450018902b104) --- source3/include/client.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0047b2bf23..f8adf567de 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -27,7 +27,9 @@ will be a multiple of the page size on almost any system */ #define CLI_BUFFER_SIZE (0xFFFF) #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ +#define CLI_SAMBA_MAX_LARGE_WRITEX_SIZE (127*1024) /* Works for Samba servers */ #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ +#define CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ #define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ #define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */ @@ -79,6 +81,28 @@ struct rpc_pipe_client { struct dcinfo *dc; }; +/* Transport encryption state. */ +enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; + +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) +struct smb_tran_enc_state_gss { + gss_ctx_id_t gss_ctx; + gss_cred_id_t creds; +}; +#endif + +struct smb_trans_enc_state { + enum smb_trans_enc_type smb_enc_type; + uint16 enc_ctx_num; + bool enc_on; + union { + NTLMSSP_STATE *ntlmssp_state; +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) + struct smb_tran_enc_state_gss *gss_state; +#endif + } s; +}; + struct cli_state { int port; int fd; @@ -142,6 +166,8 @@ struct cli_state { smb_sign_info sign_info; + struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ + /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; -- cgit From a763f4b79f56b09d633114aed776f168356741ae Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Feb 2008 05:54:50 -0800 Subject: Don't define SMB_TRANS_ENC_GSS if we don't have KRB5. Jeremy. (This used to be commit 6f2b33f6072629be393f88d4450fa6631ef672f6) --- source3/include/client.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index f8adf567de..d29a2e7341 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -82,7 +82,12 @@ struct rpc_pipe_client { }; /* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; +enum smb_trans_enc_type { + SMB_TRANS_ENC_NTLM +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) + , SMB_TRANS_ENC_GSS +#endif +}; #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) struct smb_tran_enc_state_gss { -- cgit From 1d41b5bd2a58dcc6966a3a49ccb063ff05e46125 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 28 Feb 2008 14:41:25 +0100 Subject: Add infrastructure to support async SMB requests (This used to be commit f5356825698a02df2d400b51dd95d1f857c83e81) --- source3/include/client.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d29a2e7341..52dc513d65 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -192,6 +192,36 @@ struct cli_state { bool force_dos_errors; bool case_sensitive; /* False by default. */ + + struct event_context *event_ctx; + struct fd_event *fd_event; + char *evt_inbuf; + + struct cli_request *outstanding_requests; +}; + +struct cli_request { + struct cli_request *prev, *next; + struct async_req *async; + + struct cli_state *cli; + + struct smb_trans_enc_state *enc_state; + + uint16_t mid; + + char *outbuf; + size_t sent; + char *inbuf; + + union { + struct { + off_t ofs; + size_t size; + ssize_t received; + uint8_t *rcvbuf; + } read; + } data; }; typedef struct file_info { -- cgit From 45a877f392a5449f4c3b7d39f9f8c78b57733d39 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 1 Mar 2008 09:26:27 +0100 Subject: Revert "Add infrastructure to support async SMB requests" This reverts commit f5356825698a02df2d400b51dd95d1f857c83e81. (This used to be commit 5f53a62be8a21b8d92ac44b18d202882500356e8) --- source3/include/client.h | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 52dc513d65..d29a2e7341 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -192,36 +192,6 @@ struct cli_state { bool force_dos_errors; bool case_sensitive; /* False by default. */ - - struct event_context *event_ctx; - struct fd_event *fd_event; - char *evt_inbuf; - - struct cli_request *outstanding_requests; -}; - -struct cli_request { - struct cli_request *prev, *next; - struct async_req *async; - - struct cli_state *cli; - - struct smb_trans_enc_state *enc_state; - - uint16_t mid; - - char *outbuf; - size_t sent; - char *inbuf; - - union { - struct { - off_t ofs; - size_t size; - ssize_t received; - uint8_t *rcvbuf; - } read; - } data; }; typedef struct file_info { -- cgit From 1ea0a5d0cdaf9cbc1d1a5c0720ae466f07cea816 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 28 Feb 2008 14:41:25 +0100 Subject: Add infrastructure to support async SMB requests (This used to be commit e2153301351559f30f2714345f4c1ca6c5f1a45f) --- source3/include/client.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d29a2e7341..52dc513d65 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -192,6 +192,36 @@ struct cli_state { bool force_dos_errors; bool case_sensitive; /* False by default. */ + + struct event_context *event_ctx; + struct fd_event *fd_event; + char *evt_inbuf; + + struct cli_request *outstanding_requests; +}; + +struct cli_request { + struct cli_request *prev, *next; + struct async_req *async; + + struct cli_state *cli; + + struct smb_trans_enc_state *enc_state; + + uint16_t mid; + + char *outbuf; + size_t sent; + char *inbuf; + + union { + struct { + off_t ofs; + size_t size; + ssize_t received; + uint8_t *rcvbuf; + } read; + } data; }; typedef struct file_info { -- cgit From 5e86a172a567ca9a60d74d1076430fb5e70b27a6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 12 Mar 2008 16:19:56 +0100 Subject: For convenience reasons, always create cli->srv_name_slash in the rpc_client. Guenther (This used to be commit 6363c383d6989d2dfb2ee488ffa7aeb128c5385b) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 52dc513d65..0787712efb 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -123,6 +123,7 @@ struct cli_state { int privileges; fstring desthost; + fstring srv_name_slash; /* The credentials used to open the cli_state connection. */ fstring domain; -- cgit From e49200c1a2836bda4a86b034153365b8d9e99ce1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 8 Apr 2008 14:10:48 +0200 Subject: Add CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS define. This allows to switch on the cli->fallback_after_kerberos switch. Guenther (This used to be commit 15ba45e567d910c1b2336dcc0c475e12b082f30f) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0787712efb..0e73745edb 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -242,5 +242,6 @@ typedef struct file_info { #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002 #define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004 +#define CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS 0x0008 #endif /* _CLIENT_H */ -- cgit From b46d340fd5d7e88684ac77000e17c1899ff608b2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 18:17:13 +0200 Subject: Refactoring: Make struct rpc_pipe_client its own talloc parent (This used to be commit a6d74a5a562b54f0b36934965f545fdeb1e8b34a) --- source3/include/client.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 0e73745edb..3c0b65576c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -60,8 +60,6 @@ struct cli_pipe_auth_data { struct rpc_pipe_client { struct rpc_pipe_client *prev, *next; - TALLOC_CTX *mem_ctx; - struct cli_state *cli; int pipe_idx; -- cgit From 2a2188591b5ed922d09dc723adcf10f8b8f5e5a0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 21:56:43 +0200 Subject: Add "desthost" to rpc_pipe_client This reduces the dependency on cli_state (This used to be commit 783afab9c891dd7bcb78895b2a639b6f3a0edf5b) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 3c0b65576c..02575e4109 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -66,6 +66,8 @@ struct rpc_pipe_client { const char *pipe_name; uint16 fnum; + const char *desthost; + const char *domain; const char *user_name; struct pwd_info pwd; -- cgit From 9048cafbeaf82d1916de6538024fd660612dd25f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 23:03:16 +0200 Subject: Move srv_name_slash from cli_state to rpc_pipe_client (This used to be commit a9061e52e1ff8e31aa480f4a30cda64c9d93214e) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 02575e4109..af03e2bb60 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -67,6 +67,7 @@ struct rpc_pipe_client { uint16 fnum; const char *desthost; + const char *srv_name_slash; const char *domain; const char *user_name; @@ -123,7 +124,6 @@ struct cli_state { int privileges; fstring desthost; - fstring srv_name_slash; /* The credentials used to open the cli_state connection. */ fstring domain; -- cgit From f56eedb95c64593ceff0ef91b99729c5071aa7ac Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 11:45:41 +0200 Subject: Remove the pipe_idx variable from rpc_pipe_client (This used to be commit 4840febcd481563c3d9b2fabc1fe1b2ae5a76cf6) --- source3/include/client.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index af03e2bb60..d9f4727203 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -62,10 +62,12 @@ struct rpc_pipe_client { struct cli_state *cli; - int pipe_idx; const char *pipe_name; uint16 fnum; + const struct ndr_syntax_id *abstract_syntax; + const struct ndr_syntax_id *transfer_syntax; + const char *desthost; const char *srv_name_slash; -- cgit From 33592bdcb97c05a85a9c5a8e11b351d63c326f0e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 12:19:27 +0200 Subject: Refactoring: Move stuff around for creating a pipe (This used to be commit 45be749ed69f8c1ad3ebe8ea1f35c806db2ed5d0) --- source3/include/client.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d9f4727203..5cfc9a6f92 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -68,11 +68,11 @@ struct rpc_pipe_client { const struct ndr_syntax_id *abstract_syntax; const struct ndr_syntax_id *transfer_syntax; - const char *desthost; - const char *srv_name_slash; + char *desthost; + char *srv_name_slash; - const char *domain; - const char *user_name; + char *domain; + char *user_name; struct pwd_info pwd; uint16 max_xmit_frag; -- cgit From b78453326bf41cf3af239a5415dfef80a842d555 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Apr 2008 08:01:51 +0200 Subject: Remove the "pwd" struct from rpc_pipe_client The only user of this was decrypt_trustdom_secret, and this only needs the NT hash anyway. (This used to be commit 3d8c2a47e677a4c4aacf4abf148b1bd8163c3351) --- source3/include/client.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 5cfc9a6f92..9cbfa51bb1 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -73,7 +73,6 @@ struct rpc_pipe_client { char *domain; char *user_name; - struct pwd_info pwd; uint16 max_xmit_frag; uint16 max_recv_frag; -- cgit From 9e9d40d0977add05ac65d35251c1a5986c721e48 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Apr 2008 10:39:37 +0200 Subject: Refactoring: Make cli_pipe_auth_data a pointer off rpc_pipe_client (This used to be commit f665afaaa3eff9ef54112e08ed034a6e1bb30edc) --- source3/include/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 9cbfa51bb1..d866c09cce 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -77,7 +77,7 @@ struct rpc_pipe_client { uint16 max_xmit_frag; uint16 max_recv_frag; - struct cli_pipe_auth_data auth; + struct cli_pipe_auth_data *auth; /* The following is only non-null on a netlogon pipe. */ struct dcinfo *dc; -- cgit From 862d7e32b90f7020d46e025de918f6338f40441b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Apr 2008 22:27:29 +0200 Subject: Move user/domain from rpc_pipe_client to cli_pipe_auth_data (This used to be commit 42de50d2cd43e760d776694f7b5f003ba51d7f84) --- source3/include/client.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index d866c09cce..3459ae20d0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -49,6 +49,10 @@ struct print_job_info { struct cli_pipe_auth_data { enum pipe_auth_type auth_type; /* switch for the union below. Defined in ntdomain.h */ enum pipe_auth_level auth_level; /* defined in ntdomain.h */ + + char *domain; + char *user_name; + union { struct schannel_auth_struct *schannel_auth; NTLMSSP_STATE *ntlmssp_state; @@ -71,9 +75,6 @@ struct rpc_pipe_client { char *desthost; char *srv_name_slash; - char *domain; - char *user_name; - uint16 max_xmit_frag; uint16 max_recv_frag; -- cgit From 324e92ea670d7bd6b1630b04fb5fb51324abda7b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 22 Apr 2008 14:31:35 +0200 Subject: Make use of rpccli_xxx_bind_data (This used to be commit f9bc336affd2ce21a3c62880ecea2622f35653d1) --- source3/include/client.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 3459ae20d0..5ab457a2ab 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -58,7 +58,6 @@ struct cli_pipe_auth_data { NTLMSSP_STATE *ntlmssp_state; struct kerberos_auth_struct *kerberos_auth; } a_u; - void (*cli_auth_data_free_func)(struct cli_pipe_auth_data *); }; struct rpc_pipe_client { -- cgit From 63e0884df518b497d8dfee6ebdf916b73b8d9645 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 24 Apr 2008 20:42:32 +0200 Subject: Introduce a redirection for ncacn_np and ncacn_ip_tcp in rpc_pipe_client Should be no functional change, just a change in the data structure (This used to be commit 3433f430b0c1f7d350a40eac783385a2d30d905c) --- source3/include/client.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 5ab457a2ab..7d76b8e6f5 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -63,10 +63,18 @@ struct cli_pipe_auth_data { struct rpc_pipe_client { struct rpc_pipe_client *prev, *next; - struct cli_state *cli; + enum dcerpc_transport_t transport_type; - const char *pipe_name; - uint16 fnum; + union { + struct { + struct cli_state *cli; + const char *pipe_name; + uint16 fnum; + } np; + struct { + int sock; + } tcp; + } trans ; const struct ndr_syntax_id *abstract_syntax; const struct ndr_syntax_id *transfer_syntax; -- cgit From ec70996fc71768eabdc92076a60a9fa04ae717ab Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 12 May 2008 17:07:37 +0200 Subject: Rename rpc_pipe_client.tcp.sock to rpc_pipe_client.sock.fd (This used to be commit 2ff908a902ec857856518eaddb5246dd5067063d) --- source3/include/client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 7d76b8e6f5..c5882e34b6 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -72,8 +72,8 @@ struct rpc_pipe_client { uint16 fnum; } np; struct { - int sock; - } tcp; + int fd; + } sock; } trans ; const struct ndr_syntax_id *abstract_syntax; -- cgit From 65dfc40a4adc41fc45e48d96631238817cef8394 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jul 2008 10:21:14 +0200 Subject: Store copies of the syntax ids in rpc_pipe_client (This used to be commit 848a3497e385090b4b21837c8d0e0313f5c062e5) --- source3/include/client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index c5882e34b6..9276948dac 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -76,8 +76,8 @@ struct rpc_pipe_client { } sock; } trans ; - const struct ndr_syntax_id *abstract_syntax; - const struct ndr_syntax_id *transfer_syntax; + struct ndr_syntax_id abstract_syntax; + struct ndr_syntax_id transfer_syntax; char *desthost; char *srv_name_slash; -- cgit From 617bf10c66f45b6ed83d7f5441586606261e0560 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Aug 2008 17:55:57 -0700 Subject: Fix bug #5675 with a varient of Tim Waugh's patch, as proposed by James Peach. Jeremy. (This used to be commit 5c27ad75836136c39774c9456d63f46fa62e281f) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 9276948dac..51ced9907f 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -193,6 +193,7 @@ struct cli_state { bool use_kerberos; bool fallback_after_kerberos; bool use_spnego; + bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */ bool use_oplocks; /* should we use oplocks? */ bool use_level_II_oplocks; /* should we use level II oplocks? */ -- cgit From 2650207d4adbfd68974fc2b342dd2af079a2552c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 24 Aug 2008 14:17:43 +0200 Subject: Remove cli->event_ctx, pass it explicitly Storing the event_context as permanent state in struct cli_state creates more complex code than necessary IMO. (This used to be commit debb37f703075008e5ea7d34d214cfa4d0f8f916) --- source3/include/client.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 51ced9907f..be12288f28 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -204,7 +204,15 @@ struct cli_state { bool force_dos_errors; bool case_sensitive; /* False by default. */ - struct event_context *event_ctx; + /** + * fd_event is around while we have async requests outstanding or are + * building a chained request. + * + * (fd_event!=NULL) && (outstanding_request!=NULL) + * + * should always be true, as well as the reverse: If both cli_request + * pointers are NULL, no fd_event is around. + */ struct fd_event *fd_event; char *evt_inbuf; -- cgit From 77d1b29e25512982a1f912adac46bb954ee3d19f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Aug 2008 14:40:15 +0200 Subject: Move "struct cli_request" from client.h to async_smb.h Also add some comments (This used to be commit 2ecc311f785317caf5b60051147dcd085c80d64f) --- source3/include/client.h | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index be12288f28..6a6e1a2faa 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -216,33 +216,12 @@ struct cli_state { struct fd_event *fd_event; char *evt_inbuf; + /** + * A linked list of requests that are waiting for a reply + */ struct cli_request *outstanding_requests; }; -struct cli_request { - struct cli_request *prev, *next; - struct async_req *async; - - struct cli_state *cli; - - struct smb_trans_enc_state *enc_state; - - uint16_t mid; - - char *outbuf; - size_t sent; - char *inbuf; - - union { - struct { - off_t ofs; - size_t size; - ssize_t received; - uint8_t *rcvbuf; - } read; - } data; -}; - typedef struct file_info { struct cli_state *cli; SMB_BIG_UINT size; -- cgit From b054f14111337c826548d7728dc2b0a66ab5beae Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Aug 2008 15:59:36 +0200 Subject: Activate code to enable chained requests Add the CHAIN1 torture test (This used to be commit 82992d74a99b056bbfe90e1b79190e0b7c0bf2bd) --- source3/include/client.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 6a6e1a2faa..9b564fc48e 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -208,7 +208,8 @@ struct cli_state { * fd_event is around while we have async requests outstanding or are * building a chained request. * - * (fd_event!=NULL) && (outstanding_request!=NULL) + * (fd_event!=NULL) && + * ((outstanding_request!=NULL)||(chain_accumulator!=NULL)) * * should always be true, as well as the reverse: If both cli_request * pointers are NULL, no fd_event is around. @@ -220,6 +221,11 @@ struct cli_state { * A linked list of requests that are waiting for a reply */ struct cli_request *outstanding_requests; + + /** + * The place to build up the list of chained requests. + */ + struct cli_request *chain_accumulator; }; typedef struct file_info { -- cgit From 0e9f348f1daf84ae4fdc4f429a6abc376b6282be Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 12 Sep 2008 21:56:14 +0200 Subject: Add a more explaining comment (This used to be commit edd70836daef340f21df3cb102144935f36e5c4c) --- source3/include/client.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/client.h') diff --git a/source3/include/client.h b/source3/include/client.h index 9b564fc48e..70b0421c6d 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -223,7 +223,9 @@ struct cli_state { struct cli_request *outstanding_requests; /** - * The place to build up the list of chained requests. + * The place to build up the list of chained requests. In CIFS, a + * single cli_request corresponds to a MID and can serve more than one + * chained async_req. */ struct cli_request *chain_accumulator; }; -- cgit