summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clientgen.c
Commit message (Collapse)AuthorAgeFilesLines
* smb-agent improvements. added -D (daemon) option. smb agent isLuke Leighton1999-12-031-2/+4
| | | | | restricted to connections from the current user (socket is created with current user uid).
* cool! a unix socket smb redirector. code based on smbfilter andLuke Leighton1999-12-031-0/+111
| | | | | | | | 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.
* new get_any_dc_name() function allows lookups of trusted domains fromLuke Leighton1999-12-021-15/+14
| | | | | | | | | | | | | | | lp_trusted_domains() parameter, so trusted domain logins should work, right, if you put user = TRUSTED_DOMAIN\NTuser in "domain name map", right? right - as _long_ as you're not using NTLMv2, because the damn NT username gets mapped to the damn unix name too early, and NTLMv2 challenge-responses are based on the client's user name, client's domain name, client's host name etc damn etc. so it becomes necessary to stop using char* username because this allows for massive amounts of confusion as to which username is being referred to. the underlying unix username on the local unix system that is associated with the smbd process that represents the NT username? or the NT username itself?
* added get_any_dc_name() function.Luke Leighton1999-12-021-32/+122
|
* 1) when no domain used in ntlogin test command, should use default oneLuke Leighton1999-12-011-14/+22
| | | | | | | | | | | | | | from previous lsaquery command. over-ridden from DOMAIN\username 2) initialisation of cli_state is a little more specific: sets use_ntlmv2 to Auto. this can always be over-ridden. 3) fixed reusage of ntlmssp_cli_flgs which was being a pain 4) added pwd_compare() function then fixed bug in cli_use where NULL domain name was making connections multiply unfruitfully 5) type-casting of mallocs and Reallocs that cause ansi-c compilers to bitch
* sys_select added one more argument (read, write selectors).Luke Leighton1999-12-011-52/+20
|
* modified cli_connect_serverlist to take server list of formatLuke Leighton1999-11-271-5/+6
| | | | \\server_name \\other_server etc.
* ok. *whew*. this is the first completed part of the restructure.Luke Leighton1999-11-241-30/+47
| | | | | | | | | | | | 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.
* first stages of removing struct cli_state* and uint16 fnum from allLuke Leighton1999-11-241-3/+4
| | | | | | | | | msrpc client code. the intent is to hide / abstract / associate connection info behind policy handles. this makes the msrpc functions look more and more like their nt equivalents. who-hou!
* you know what? this sort of thing makes me laugh. hmm, what functionsLuke Leighton1999-11-211-2/+7
| | | | | | | | | | | | | | | | | | | | 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);
* experimental spoolss rpcclient commandsLuke Leighton1999-11-051-0/+6
|
* the new CAP_EXTENDED_SECURITY code needed to support NTLMv2. also removedLuke Leighton1999-10-251-1/+1
| | | | | switching on CAP_STATUS32 from non-CAP_EXTENDED_SECURITY code (enabled for test purposes only)
* one of those wonderful moments when running against a different MSRPCLuke Leighton1999-10-251-5/+13
| | | | | | implementation (NT5) when you discover that your code is trash. samr_enum_dom_users(), samr_enum_dom_aliases() and samr_enum_dom_groups() all take a HANDLE for multiple-call enumeration purposes.
* need status codes from cli_net_req_chal() and cli_net_auth2().Luke Leighton1999-10-191-1/+2
| | | | | | this format is what i would like _all_ these functions to be (returning status codes, not BOOL) but that's a horrendous amount of work at the moment :)
* const issuesLuke Leighton1999-10-141-1/+1
|
* - added rudimentary CAP_UNICODE support because i thought it was part ofLuke Leighton1999-10-071-70/+396
| | | | | | | | | | | | | | | | | a problem i was having. - added rudimentary CAP_STATUS32 support for same reason. - added hard-coded, copy-the-same-data-from-over-the-wire version of CAP_EXTENDED_SECURITY, which is a security-blob to encapsulate GSSAPI which encodes SPNEGO which is used to negotiate Kerberos or NTLMSSP. i have implemented NTLMSSP which negotiates NTLMv1 or NTLMv2 and 40-bit or 128-bit etc. i have implemented NTLMv1 / 40-bit. *whew*.
* reading in smb server domain name from SMBnegprot responseLuke Leighton1999-09-161-5/+26
|
* #defines for port 445 to SMB_PORT2Luke Leighton1999-09-151-2/+2
|
* debug info display (netbios layer).Luke Leighton1999-08-181-4/+12
|
* bug-fix in connection to port 445. cool! it works!Luke Leighton1999-08-031-0/+1
|
* attempting a connection to port 445 first, followed by a connection to 139Luke Leighton1999-08-031-6/+23
| | | | if this fails.
* close socket issues:Luke Leighton1999-08-031-11/+33
| | | | | - ssl close from cli_reestablish_connection() not called. - ntlmv2 fall-back to ntlmv1 failed.
* anon passwd connection: passlen=1; ntpasslen=0.Luke Leighton1999-07-111-3/+4
|
* When making anonymous connections, must pass pointers to real ntTim Potter1999-07-091-5/+5
| | | | password and password length variables not constants.
* fixed problem with NULL ntpasswd parameters causing crash inLuke Leighton1999-07-081-9/+43
| | | | | static cli_calc_session_pwds(). this code used to be inside cli_session_setup() itself and worked on non-NULL local variables.
* smbclient modified to use cli_establish_connection(). smbclient thereforeLuke Leighton1999-06-291-0/+11
| | | | | | now uses improved authentication. smbclient now "broken" for "scripts" based on DEBUG() output. cli_establish_connection() requires modification to support old scripts.
* improving authentication code (tidyup).Luke Leighton1999-06-291-77/+182
|
* use nmb_safe_namestr.Luke Leighton1999-06-241-3/+8
|
* safe string error reporting functions (found a potential buffer overflowLuke Leighton1999-06-241-46/+51
| | | | of a pstrcpy into an fstring).
* ERRmoredata is informational and should not be treated as a hard errorMatthew Chapman1999-03-231-7/+6
| | | | anywhere.
* Benjamin Kuit's MYSQL SAM Database implementation.Luke Leighton1999-03-011-0/+2
| | | | Copyright (C) Benjamin Kuit <bj@mcs.uts.edu.au> 1999.
* the UNICODE issue...Luke Leighton1999-02-111-1/+1
|
* Must set password length to 24 after we encrypt a password.Matthew Chapman1999-02-011-0/+2
|
* returned cli_session_setup to previous behaviour. added a couple ofLuke Leighton1999-01-281-7/+22
| | | | | | | validation checks and also added capability to send plaintext passwords. send "ntpasslen" of zero to do this. sending same plaintext password for pass and ntpass arguments will result in previous behaviour of encrypting password if server supports it.
* - got client code cleartext passwords working again in cli_session_setup.Luke Leighton1999-01-271-20/+26
| | | | | | | | | | | | | | | | | | | needed this for some tests. - removed code that said "if lm password is not encrypted then encrypt both lm and nt passwords". actually it said "if lm password length is not 24 bytes and we're in security=user mode..." it didn't bother to check whether the nt password was NULL or not, and doing the encryption inside cli_session_setup is the wrong place. - checked all instances where cli_session_setup is called with cleartext passwords that are expected to then be encrypted (see above) with the test "if pwlen != 24...". there was only one: all the others either provide encrypted passwords, do null sessions or use cli_establish_connection. * recommendation: use cli_establish_connection() in smbwrapper/smbw.c
* Putting back the -p flag in smbclient.Richard Sharpe1999-01-251-1/+17
| | | | | However, it seems that the -s flag in smbclient is also ignored :-(
* In security=user mode we must allow cli_connect_serverlist to connect to ourMatthew Chapman1999-01-181-1/+1
| | | | own smbd process, rather than complaining about a password server loop.
* eclass != ERRDOS && num != ERRmoredataMatthew Chapman1999-01-151-1/+1
| | | | | | | is not the same as !(eclass == ERRDOS && num == ERRmoredata) This was causing smbclient to segfault on receiving certain errors.
* server_cryptkey() now calling cli_connectserverlist(). stupid microsoftLuke Leighton1998-12-141-2/+11
| | | | | idiotic *SMBSERVER connectionism added to cli_connect_serverlist(). also added check for protocol < LANMAN2.
* ERRmoredata is an acceptable error code, it is not an error.Luke Leighton1998-12-021-2/+6
|
* another attempt at a fix on connect_serverlist()...Luke Leighton1998-11-301-8/+8
|
* andrej spotted problem with connect_serverlist (starts off assumingLuke Leighton1998-11-301-1/+1
| | | | a connection succeeds...).
* Replaced ZERO_STRUCT() with ZERO_STRUCTP() in cli_connect_serverlist().Tim Potter1998-11-261-1/+1
| | | | Fix by Matt Chapman <m.chapman@student.unsw.edu.au>
* - group database API. oops and oh dear, the threat has been carried out:Luke Leighton1998-11-171-49/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
* automatically uppercase server and share names (win95 won't handleAndrew Tridgell1998-11-141-0/+1
| | | | lowercase share names!)
* Removed acconfig.h configure configure.in include/config.h.in: Made ↵Jeremy Allison1998-11-141-3/+3
| | | | | | | | | smbwrapper not made by default. nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include file problem...sigh. Jeremy.
* .cvsignore: Removed old entries.Herb Lewis1998-11-121-1/+17
| | | | | | | | | | | | 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.
* largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1998-11-121-3/+3
| | | | | | | | | | | | | should allow us to call a function in swat rather than piping to smbpasswd. while doing this I also fixed quite a few "const char *" versus "char *" issues that cropped up while using const to track down bugs in the code. This led to changes in several generic functions. The smbpasswd changes should be correct but they have not been extensively tested. At least if I have introduced bugs then we should be able to fix them more easily than before.
* Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions.Jeremy Allison1998-11-091-13/+13
| | | | | | | | | | | | | 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.
* converted smbclient to use clientgen.c rather than clientutil.cAndrew Tridgell1998-11-091-35/+199
| | | | | | | | | | | | | | | | | | | | | | | I did this when I saw yet another bug report complaining about smbclient intermittently missing files. Rather than applying more patches to smbclient it was better to move to the more robust clientgen.c code. The conversion wasn't perfect, I probably lost some features of smbclient while doing it, but at least smbclient should be consistent now. It if fails it should _always_ fail rather than giving people the false impression of a reliable utility. the tar stuff seems to work, but hasn't had much testing as I never use it myself. I'm sure someone will find bugs in my conversion of smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It now uses clientgen.c exclusively. smbclient is still quite messy, but at least it doesn't build its own SMB packets. I haven't touched smbmount as I never use it. Mike, do you want to convert smbmount to use clientgen.c?