summaryrefslogtreecommitdiffstats
path: root/source/smbd/sesssetup.c
Commit message (Collapse)AuthorAgeFilesLines
* Change which session key we negotiate. This uses the NT-based session key thatAndrew Bartlett2002-08-171-1/+1
| | | | | | | | we previously expected, rather than the LM based key. A Win2k SPNEGO enabled join goes a *lot* further with this option on. Andrew Bartlett
* Re-add the last empty item to the NTLMSSP info list, but this time do itJim McDonough2002-08-161-3/+4
| | | | | | with an empty string, not a NULL pointer... Also, check for security=ads before giving a kerberos spnego response.
* Fix segfault in the new NTLMSSP code. jmcd: can you look at this - whatAndrew Bartlett2002-08-161-3/+2
| | | | | | exactly were you trying to do here? Andrew Bartlett
* Fix NTLMSSP challenge command and auth response. We can now service joinsJim McDonough2002-08-151-31/+37
| | | | | from win2k AND still use SPNEGO (provided you don't build with kerberos...I still have to fix that, as we are not properly falling back).
* Make 'remote_machine' private to lib/substitute.c, and fix all the user to useAndrew Bartlett2002-08-111-2/+1
| | | | | | the new accessor functions. Andrew Bartlett
* Fix the %m security bug again - and try to make it harder to reintroduce inAndrew Bartlett2002-08-101-2/+3
| | | | | | | | | | | future. This moves us from fstrcpy() and global variables to 'get' and 'set' functions. In particular, the 'set' function sainity-checks the input, in the same way as we always have. Andrew Bartlett
* This fixes a number of ADS problems, particularly with netbioslessAndrew Tridgell2002-08-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setups. - split up the ads structure into logical pieces. This makes it much easier to keep things like the authentication realm and the server realm separate (they can be different). - allow ads callers to specify that no sasl bind should be performed (used by "net ads info" for example) - fix an error with handing ADS_ERROR_SYSTEM() when errno is 0 - completely rewrote the code for finding the LDAP server. Now try DNS methods first, and try all DNS servers returned from the SRV DNS query, sorted by closeness to our interfaces (using the same sort code as we use in replies from WINS servers). This allows us to cope with ADS DCs that are down, and ensures we don't pick one that is on the other side of the country unless absolutely necessary. - recognise dnsRecords as binary when displaying them - cope with the realm not being configured in smb.conf (work it out from the LDAP server) - look at the trustDirection when looking up trusted domains and don't include trusts that trust our domains but we don't trust theirs. - use LDAP to query the alternate (netbios) name for a realm, and make sure that both and long and short forms of the name are accepted by winbindd. Use the short form by default for listing users/groups. - rescan the list of trusted domains every 5 minutes in case new trust relationships are added while winbindd is running - include transient trust relationships (ie. C trusts B, B trusts A, so C trusts A) in winbindd. - don't do a gratuituous node status lookup when finding an ADS DC (we don't need it and it could fail) - remove unused sid_to_distinguished_name function - make sure we find the allternate name of our primary domain when operating with a netbiosless ADS DC (using LDAP to do the lookup) - fixed the rpc trusted domain enumeration to support up to approx 2000 trusted domains (the old limit was 3) - use the IP for the remote_machine (%m) macro when the client doesn't supply us with a name via a netbios session request (eg. port 445) - if the client uses SPNEGO then use the machine name from the SPNEGO auth packet for remote_machine (%m) macro - add new 'net ads workgroup' command to find the netbios workgroup name for a realm
* make sure we null terminate plaintext passwordsAndrew Tridgell2002-08-011-1/+1
|
* Rework parinioa to ensure we never get passwords longer than MAX_PASS_LEN, norAndrew Bartlett2002-07-311-18/+11
| | | | | | | | longer than the buffer they claim to be in. Many thanks to tridge for explaining the macros. Andrew Bartlett
* fixed the length checking for plaintext passwords (thanks to andrewbAndrew Tridgell2002-07-311-2/+11
| | | | for spotting this)
* this fixes plaintext passwords with win2000Andrew Tridgell2002-07-301-3/+4
| | | | | | | | | | there were 2 bugs: 1) we were sending a null challenge when we should have sent an empty challenge 2) the password can be in unicode if unicode is negotiated. This means our client code was wrong too :(
* Removed some unused variables - tidy up some formating, add struct toJeremy Allison2002-05-311-3/+2
| | | | | client state to implement smb signing - this is a test at present. Jeremy.
* Add support for NTLMv2 (tested!) with NTLMSSP.Andrew Bartlett2002-05-261-17/+49
| | | | | | | | | | | | | | | | The problem was the NTLMv2 uses extra data in order to make reply/lookup more difficult. That extra data includes the hostname, and the domain. This matches Win2k (sort of) by sending this information. Win2k connects with LMCompatibilityLevel=5 without a problem. We can change the negotiation bits if we want, this should allow us to make NTLMv2 the default for other clients as well. Some of the extra #defines were found in the squid source. Andrew Bartlett
* fixed the fallback to a BDC for ADS connectionsAndrew Tridgell2002-04-181-1/+1
|
* make sure we don't walk past the end of the current SMB buffer whenAndrew Tridgell2002-04-161-9/+5
| | | | | pulling a string this might explain a serious filename corruption bug that Quantum QA spotted
* it looks like it is possible for a w2k client to send a spnego auth without ↵Andrew Tridgell2002-04-141-1/+6
| | | | sending the negotiate - try to cope
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* A nice *big* change to the fundemental way we do things.Andrew Bartlett2002-01-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps them around for a long time - often past the next call... This adds a getpwnam_alloc and a getpwuid_alloc to the collection. These function as expected, returning a malloced structure that can be free()ed with passwd_free(&passwd). This patch also cuts down on the number of calls to getpwnam - mostly by taking advantage of the fact that the passdb interface is already case-insensiteve. With this patch most of the recursive cases have been removed (that I know of) and the problems are reduced further by not using the sys_ interface in the new code. This means that pointers to the cache won't be affected. (This is a tempoary HACK, I intend to kill the password cache entirly). The only change I'm a little worried about is the change to rpc_server/srv_samr_nt.c for private groups. In this case we are getting groups from the new group mapping DB. Do we still need to check for private groups? I've toned down the check to a case sensitve match with the new code, but we might be able to kill it entirly. I've also added a make_modifyable_passwd() function, that copies a passwd struct into the form that the old sys_getpw* code provided. As far as I can tell this is only actually used in the pass_check.c crazies, where I moved the final 'special case' for shadow passwords (out of _Get_Pwnam()). The matching case for getpwent() is dealt with already, in lib/util_getent.c Also included in here is a small change to register the [homes] share at vuid creation rather than just in one varient of the session setup. (This picks up the SPNEGO cases). The home directory is now stored on the vuid, and I am hoping this might provide a saner way to do %H substitions. TODO: Kill off remaining Get_Pwnam_Modify calls (they are not needed), change the remaining sys_getpwnam() callers to use getpwnam_alloc() and move Get_Pwnam to return an allocated struct. Andrew Bartlett
* Back out the crazy notion that the NTLMSSP flags actually mean anything...Andrew Bartlett2002-01-111-1/+12
| | | | | | | | Replace this with some flags that *we* define. We can do a mapping later if we actually get some more reliable info about what passwords are actually valid. Andrew Bartlett
* Better explanation message for dmalloc.Martin Pool2002-01-091-5/+5
| | | | | | | | | | Also more insertion of parenthesis to handle struct members called 'free'. You can now get useful dmalloc output, as long as it is compatible with your C library. On RH7.1 it looks like you have to rebuild dmalloc to allow free(0) by default, because something in libcrypt does that. (sigh)
* Get this code back to where it belongs...Andrew Bartlett2002-01-061-7/+7
| | | | | | | | Apparently (and I will doublecheck) its legal to do an annoymous session setup when we negoitiated SPNEGO, but we can't do an authenticated one becouse we didn't give a challange. Andrew Bartlett
* Some more SPNEGO fixes.Andrew Bartlett2002-01-061-1/+1
|
* Fix up the SPNEGO segfault.Andrew Bartlett2002-01-051-2/+2
|
* I've decided to move the auth code around a bit more...Andrew Bartlett2002-01-051-45/+56
| | | | | | | | | | | | | | | | | | | | | | | | The auth_authsupplied_info typedef is now just a plain struct - auth_context, but it has been modified to contain the function pointers to the rest of the auth subsystem's components. (Who needs non-static functions anyway?) In working all this mess out, I fixed a number of memory leaks and moved the entire auth subsystem over to talloc(). Note that the TALLOC_CTX attached to the auth_context can be rather long-lived, it is provided for things that are intended to live as long. (The global_negprot_auth_context lasts the whole life of the smbd). I've also adjusted a few things in auth_domain.c, mainly passing the domain as a paramater to a few functions instead of looking up lp_workgroup(). I'm hopign to make this entire thing a bit more trusted domains (as PDC) freindly in the near future. Other than that, I moved a bit of the code around, hence the rather messy diff. Andrew Bartlett
* debug statement fixups.Jeremy Allison2002-01-021-5/+0
| | | | | Merge SAFE_FREE fix in tdb from 2.2, and IRIX fix. Jeremy.
* - portablitity fixes for cc -64 on irixAndrew Tridgell2001-12-311-1/+1
| | | | - fixed gid* bug in rpc_server
* check for a winbindd username when doing a kerberos authAndrew Tridgell2001-12-201-0/+11
|
* don't use server_info after its been freedAndrew Tridgell2001-12-201-2/+4
|
* support "map to guest" with spnegoAndrew Tridgell2001-12-201-21/+43
|
* added trusted realm support to ADS authenticationAndrew Tridgell2001-12-191-5/+10
| | | | | | the method used for checking if a domain is a trusted domain is very crude, we should really call a backend fn of some sort. For now I'm using winbindd to do the dirty work.
* Ensure that 'use spnego' restricts, rather than just advises our clients.Andrew Bartlett2001-12-081-1/+6
| | | | | | | | | This means that if a hole is found in the spnego code, we can tell people to just set 'use spengo' in their config file while we sort it out. Other than that, preventing 'unusual' behaviour is always a good thing. Andrew Bartlett
* Ensure we fill in the %U for NTLMSSP connectionsAndrew Bartlett2001-12-051-1/+3
|
* added a REALLY gross hack into kerberos_kinit_password so thatAndrew Tridgell2001-12-051-1/+1
| | | | | | winbindd can do a kinit this will be removed once we have code that gets a tgt and puts it in a place where cyrus-sasl can see it
* Make better use of the ads_init() function to get the kerberos relam etc.Andrew Bartlett2001-11-291-7/+12
| | | | | | | | | This allows us to use automagically obtained values in future, and the value from krb5.conf now. Also fix mem leaks etc. Andrew Bartlett
* fixed some krb5 ifdefsAndrew Tridgell2001-11-281-2/+2
|
* fixed another memory leakAndrew Tridgell2001-11-271-1/+1
|
* more memory leak fixesAndrew Tridgell2001-11-271-1/+6
|
* we can safely give NO_SUCH_USER if the ticket decodes but the localAndrew Tridgell2001-11-261-1/+1
| | | | account doesn't exist
* challange -> challengeTim Potter2001-11-261-2/+2
|
* added "net join" commandAndrew Tridgell2001-11-241-38/+5
| | | | this completes the first stage of the smbd ADS support
* This is another rather major change to the samba authenticaionAndrew Bartlett2001-11-241-38/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subystem. The particular aim is to modularized the interface - so that we can have arbitrary password back-ends. This code adds one such back-end, a 'winbind' module to authenticate against the winbind_auth_crap functionality. While fully-functional this code is mainly useful as a demonstration, because we don't get back the info3 as we would for direct ntdomain authentication. This commit introduced the new 'auth methods' parameter, in the spirit of the 'auth order' discussed on the lists. It is renamed because not all the methods may be consulted, even if previous methods fail - they may not have a suitable challenge for example. Also, we have a 'local' authentication method, for old-style 'unix if plaintext, sam if encrypted' authentication and a 'guest' module to handle guest logins in a single place. While this current design is not ideal, I feel that it does provide a better infrastructure than the current design, and can be built upon. The following parameters have changed: - use rhosts = This has been replaced by the 'rhosts' authentication method, and can be specified like 'auth methods = guest rhosts' - hosts equiv = This needs both this parameter and an 'auth methods' entry to be effective. (auth methods = guest hostsequiv ....) - plaintext to smbpasswd = This is replaced by specifying 'sam' rather than 'local' in the auth methods. The security = parameter is unchanged, and now provides defaults for the 'auth methods' parameter. The available auth methods are: guest rhosts hostsequiv sam (passdb direct hash access) unix (PAM, crypt() etc) local (the combination of the above, based on encryption) smbserver (old security=server) ntdomain (old security=domain) winbind (use winbind to cache DC connections) Assistance in testing, or the production of new and interesting authentication modules is always appreciated. Andrew Bartlett
* add a hook to save the krb5 PACAndrew Tridgell2001-11-201-0/+8
|
* Spelling fixes.Tim Potter2001-11-121-6/+6
|
* Code duplication is bad. So add an add_signiture() function and just refernceAndrew Bartlett2001-11-121-23/+17
| | | | that.
* Kill off 'restrict anonymous' becouse it is useless in its current form.Andrew Bartlett2001-11-111-47/+0
| | | | | | | To be replaced with a real restriction in consultation with jra. (Hence why I've not touched loadparm.c). Andrew Bartlett
* This change updates lp_guestaccount() to be a *global* paramater, rather thanAndrew Bartlett2001-11-091-2/+2
| | | | | | | | | | | | | | | | per-share. I beleive that almost all the things that this could have done on a per-share basis can be done with other tools, like 'force user'. Almost all the user's of this paramater used it as a global anyway... While this is one step at a time, I hope it will allow me to considerably simplfy the make_connection() code, particularly for the user-level security case. This already removes an absolute truckload of extra attempted password lookups on the guest account. Andrew Bartlett
* fix the tree so it compiles againAndrew Tridgell2001-11-091-1/+1
| | | | grumble, mumble, ...
* Change to guest logon code.Andrew Bartlett2001-11-081-58/+62
| | | | | | | | | | | | | | | | | | | | | | | | | This changes the way we process guest logons - we now treat them as normal logons, but set the 'guest' flag. In particular this is needed becouse Win2k will do an NTLMSSP login with username "", therefore missing our previous guest connection code - this is getting a pain to do as a special case all over the shop. Tridge: We don't seem to be setting a guest bit for NTLMSSP, in either the anonymous or authenticated case, can you take a look at this? Also some cleanups in the check_password() code that should make some of the debugs clearer. Various other minor cleanups: - change the session code to just take a vuser, rather than having to do a vuid lookup on vuser.vuid - Change some of the global_client_caps linking - Better debug in authorise_login(): show the vuid. Andrew Bartlett
* anonymous logins are guest logins, so mark them as such. (Otherwise they canAndrew Bartlett2001-11-031-1/+1
| | | | browse non-guest shares).
* Move the test for non-SPNEGO session setups when using SPNEGO, becouse its aAndrew Bartlett2001-11-031-5/+5
| | | | perfectly vailid behaviour for guest logins.