summaryrefslogtreecommitdiffstats
path: root/source/libsmb
Commit message (Collapse)AuthorAgeFilesLines
...
* simple mods to add msrpc pipe redirection. default behaviour: fall backLuke Leighton2000-01-031-0/+54
| | | | to using internal msrpc code in smbd.
* added suppport for unexpected udp/138 packetsAndrew Tridgell2000-01-033-247/+225
| | | | | | | | | | | | | | I also fixed up the lookup_pdc_name() code so that it now works, even with a NT server that insists on replying to udp/138. The method I used to match packets was to use the mailslot string as a datagram ID. The true dgm_id doesn't work as NT doesn't set it correctly. uggh. PS: Jeremy, I had to change your code quite a bit, are you sure this worked with a Samba PDC?? The code looked broken, it got the offsets wrong in the SMB portion of the packet and filled in the IP incorrectly.
* the bulk of the unexpected packet handling code is in hereAndrew Tridgell2000-01-031-0/+160
|
* added the unexpected packet database (unexpected.tdb)Andrew Tridgell2000-01-032-208/+223
| | | | | | | | | | | | this means "nmblookup -S" now always works, even with broken servers the database stores all unexpected replies and these can be accessed by any client. while doing this I cleaned up a couple of functions, and put in place a better trn_id generator. in most places the code got quite a bit simpler due to the addition of simple helper functions. I haven't yet put the code in to take advantage of this for pdc replies - that will be next. Jeremys pdc finding code will then work :)
* 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files ↵Andrew Tridgell1999-12-131-127/+0
| | | | that were in the head branch but weren't in SAMBA_2_0
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-139-2426/+1411
|
* final part of "first" phase converting over to msrpc daemon architecture.Luke Leighton1999-12-121-4/+2
| | | | | | | | | | | | done a minimal amout of clean-up in the Makefile, removing unnecessary modules from the link stage. this is not complete, yet, and will involve some changes, for example to smbd, to remove dependencies on the password database API that shouldn't be there. for example, smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa API. this first implementation has minor problems with not reinstantiating the same services as the caller. the "homes" service is a good example.
* delineation between smb and msrpc more marked. smbd now constructsLuke Leighton1999-12-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pdus, and then feeds them over either a "local" function call or a "remote" function call to an msrpc service. the "remote" msrpc daemon, on the other side of a unix socket, then calls the same "local" function that smbd would, if the msrpc service were being run from inside smbd. this allows a transition from local msrpc services (inside the same smbd process) to remote (over a unix socket). removed reference to pipes_struct in msrpc services. all msrpc processing functions take rpcsrv_struct which is a structure containing state info for the msrpc functions to decode and create pdus. created become_vuser() which does everything not related to connection_struct that become_user() does. removed, as best i could, connection_struct dependencies from the nt spoolss printing code. todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific info on a per-connection basis, and if the connection dies then so does the info, and that's a fairly serious problem. had to put pretty much everything that is in user_struct into parse_creds.c to feed unix user info over to the msrpc daemons. why? because it's expensive to do unix password/group database lookups, and it's definitely expensive to do nt user profile lookups, not to mention pretty difficult and if you did either of these it would introduce a complication / unnecessary interdependency. so, send uid/gid/num_groups/gid_t* + SID+num_rids+domain_group_rids* + unix username + nt username + nt domain + user session key etc. this is the MINIMUM info identified so far that's actually implemented. missing bits include the called and calling netbios names etc. (basically, anything that can be loaded into standard_sub() and standard_sub_basic()...)
* OK. This code works on a RedHat 6.0 system. However smbpasswdGerald Carter1999-12-091-2/+4
| | | | | | | | | | | | | | | | | time out of sending the session setup on Solaris 2.6. No idea. I'll work on it some tomorrow. This is to fix the "Unable to setup password vectors" thingy. Also changed an inet_aton() to inet_addr() as the former is not very portable :-) Luke, I set the redir flag to false because the connection to the smb-agent was failing and smbpasswd bombed. Double check me on this one. -jc
* ABOUT TIME!!!!!!!!Luke Leighton1999-12-081-56/+20
| | | | | | | | | | | | | | | 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.
* reenabled retry_time (commented out accidentally in name_status)Luke Leighton1999-12-051-1/+1
|
* argh! how horrible! spent ages working out why packets weren't beingLuke Leighton1999-12-042-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | received properly when a UDP "retry" occurs. it's because reads and writes must be interleaved / matched. scenario: nmblookup connects to agent, sends request. agent receives request, broadcasts it on 137. agent RECEIVES 137 broadcast, sends it to nmblookup agent receives RESPONSE to 137 broadcast, sends it to nmblookup. if reads are not equally interspersed with writes, then second send will fail. if you think this is odd behaviour and that the agent should be filtering its own UDP traffic, think again. agent will be, potentially, redirecting nmbd traffic (including WINS server) not just client programs.
* argh. trying to get the nmb agent code to filter out "self" packets.Luke Leighton1999-12-041-9/+3
|
* jeremy is going to hate me for this.Luke Leighton1999-12-043-39/+205
| | | | | | | | | | | created an "nmb-agent" utility that, yes: it connects to the 137 socket and accepts unix socket connections which it redirects onto port 137. it uses the name_trn_id field to filter requests to the correct location. name_query() and name_status() are the first victims to use this feature (by specifying a file descriptor of -1).
* argh! you wouldn't believe what i had to do: use the mid (multiplex id)Luke Leighton1999-12-041-1/+1
| | | | | | to redirect multiple socket-based connnections onto a single client state. argh!
* argh! smb-agent redirection client reusage is a nightmare!Luke Leighton1999-12-032-3/+16
| | | | | | moved smb-agent over to a single-process model instead of fork() in order to reuse client connections. except, of course, you can't do a select() on the same socket connections! argh!
* starting "connection reuse" system in smb-agent. added version numberLuke Leighton1999-12-031-0/+20
| | | | which isn't actually used right now :-)
* 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-032-0/+119
| | | | | | | | 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?
* cleaning up: removing those horrible references to server listLuke Leighton1999-12-021-2/+1
| | | | | functions (cli_net_use_addlist()). needed originally because there was no get_dc_any_name() function.
* added get_any_dc_name() function.Luke Leighton1999-12-021-32/+122
|
* default SID map now reads in "trusted domains" from smb.conf.Luke Leighton1999-12-021-3/+5
|
* clearing up connection-related stuff. password credentials were messingLuke Leighton1999-12-021-9/+1
| | | | | | | up. added a complicated prompt which i don't like, but it tells you domain\user@hostname$
* more cli_session_setup() calls. what the heck are these doing???Luke Leighton1999-12-011-1/+1
| | | | | | | they should all be replaced with cli_establish_connection(). created cli_use_wait_keyboard() which waits on multiple cli_states and swallows session keepalives.
* 1) when no domain used in ntlogin test command, should use default oneLuke Leighton1999-12-012-20/+79
| | | | | | | | | | | | | | 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-013-105/+71
|
* this is going to sound _really_ weird, ok, but i had to implementLuke Leighton1999-11-291-3/+3
| | | | equivalents of NetUseAdd and NetUseDel!
* attempting to resolve the issue that multiple servers often specified inLuke Leighton1999-11-291-1/+2
| | | | parameters to connect to \PIPE\NETLOGON.
* first attempt at getting \PIPE\NETLOGON working. it's pretty horrible.Luke Leighton1999-11-291-96/+12
|
* updated \PIPE\wkssvc commands to use new abstracted connection system.Luke Leighton1999-11-271-8/+26
| | | | | modified resolve_srv_name() to return dest host of *SMBSERVER if server name is \\ip.add.ress.format
* modified cli_connect_serverlist to take server list of formatLuke Leighton1999-11-271-5/+6
| | | | \\server_name \\other_server etc.
* whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.Luke Leighton1999-11-261-0/+24
| | | | | | found out that getopt() _must_ have optind set to 0 before reuse. still haven't decided what to do with the net* api yet...
* previous commit added an abstraction function that didn't even haveLuke Leighton1999-11-252-8/+5
| | | | | struct cli_state, uint16 fnum into the code: rpc_hnd_api_req(). modified cli_lsarpc.c to use this. the rest is const issues.
* ok. *whew*. this is the first completed part of the restructure.Luke Leighton1999-11-242-31/+48
| | | | | | | | | | | | 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!
* implement server-side generation of NTLMv2 session key. YESSS :-)Luke Leighton1999-11-212-14/+31
|
* you know what? this sort of thing makes me laugh. hmm, what functionsLuke Leighton1999-11-213-4/+40
| | | | | | | | | | | | | | | | | | | | 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);
* The First Necessary UNICODE String Support.Luke Leighton1999-11-191-19/+67
| | | | | | | | | the random workstation trust account password is TOTAL garbage. i mean, complete garbage. it's nowhere CLOSE to being a UNICODE string. therefore we can't just take every second character. created nt_owf_genW() which creates NT#(password) instead of NT#(Unicode(pw)). followed through to the password setting in srv_samr.c
* added regqueryval command (experimental) to get reg_io_q_info() andLuke Leighton1999-11-181-1/+1
| | | | | | | | reg_io_r_info() working properly. previously they weren't well understood (well, they were the first of the registry functions i did, back in december 97, ok??? :-) set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
* experimental spoolss rpcclient commandsLuke Leighton1999-11-051-0/+6
|
* samuserset <username> -p password. YESSSSS :)Luke Leighton1999-11-041-0/+11
| | | | you have to use "ntlmv1" at the moment (i.e set client ntlmv2 = no).
* adding experimental set user password command to rpcclient, it returnsLuke Leighton1999-11-041-0/+66
| | | | error wrong password against nt. ????
* 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.
* split modify_trust_account_password into a separate module.Luke Leighton1999-10-211-0/+211
|
* 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
|
* adding CAP_EXTENDED_SECURITY support in a hurry last week. forgot toLuke Leighton1999-10-141-0/+29
| | | | deal with linking issues in other binaries
* - added rudimentary CAP_UNICODE support because i thought it was part ofLuke Leighton1999-10-072-70/+417
| | | | | | | | | | | | | | | | | 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*.