summaryrefslogtreecommitdiffstats
path: root/source/smbd/sesssetup.c
Commit message (Collapse)AuthorAgeFilesLines
* Try to avoid dereferencing a null pointer.Andrew Bartlett2003-03-161-9/+13
| | | | Andrew Bartlett
* fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before ↵Gerald Carter2003-03-141-17/+18
| | | | dereferencing
* adding some initiaial code to sert %a to Win2K3 (using Native LanMan string ↵Gerald Carter2003-03-121-0/+2
| | | | from .NET RC2)
* Don't segfault on make_server_info_guest() failure - instead return theAndrew Bartlett2003-03-101-4/+2
| | | | | | | | | error code. make_server_info_guest() requires an entry in the SAM at the moment, but this will change before release. Andrew Bartlett
* additional fix for CR 601Gerald Carter2003-02-271-1/+16
| | | | | | | * distinguish WinXP from Win2k * add a 1/3 of a second delay in OpenPrinter in order to trigger a LAN/WAN optimization in 2k clients.
* Patch from Luke Howard to add mutual kerberos authentication, and SMB sessionAndrew Bartlett2003-02-241-13/+39
| | | | | | keys for kerberos authentication. Andrew Bartlett
* Fixed compiler warning.Tim Potter2003-02-211-1/+0
|
* Like for NTLM logins, lookup the 'winbind' user first, then the 'local' user.Andrew Bartlett2003-02-201-18/+14
| | | | | | This needs to change, to be a SID->UID lookup from the PAC. Andrew Bartlett
* Some cleanups:Andrew Bartlett2003-02-101-16/+11
| | | | | | | | | | | | | | | - Don't use pstrcpy into an allocated string - use safe_strcpy() directly instead. - Keep a copy of the 'server_info' attached to the vuid. In future use this for things like the session key, homedir and full name instead of current copies. - Try to avoid memory leak/segfault on Realloc failure - clear up #endif comments Andrew Bartlett
* check pointer before dereferencing itGerald Carter2003-02-071-1/+1
|
* As per a comment by herb a little while back, this should be >=, not == to keepAndrew Bartlett2003-01-281-1/+1
| | | | identical behaviour with previous versions
* The previous patch (NTLMSSP common code factoring) was missing a minor detail -Andrew Bartlett2003-01-281-28/+35
| | | | | | | | | testing :-). This gets the 'signiture' after the extended security blob, rather than over the top of it. Also move that code to the top of the file, with some of the other util functions. Andrew Bartlett
* Factor out common code in the NTLMSSP/SPNEGO code.Andrew Bartlett2003-01-281-120/+58
| | | | | | | | | | | | The idea here is to seperate, as much as possible, the SPNEGO layer from the NTLMSSP layer. This not only helps us with protocol correctness, but also should allow further mechinisms to be added with relitive ease. I indend to make the kerberos code use this shortly. I've never seen the 'zero length blob' form of the anonymous login, so I've removed that case. Andrew Bartlett
* Remove unused variable in reply_spnego_ntlmssp_okTim Potter2003-01-171-1/+0
|
* Updates to the NTLMSSP code again - moving the base64 decode fuctionality outAndrew Bartlett2003-01-161-5/+4
| | | | | | | | | | | | | of the SWAT code, and adding a base64 encoder. The main purpose of this patch is to add NTLMSSP support to 'ntlm_auth', for use with Squid. Unfortunetly the squid side doesn't quite support what we need yet. Changes to winbind to get us the info we need, and a couple of consequential changes/cleanups in the rest of the code. Andrew Bartlett
* Refactor the NTLMSSP code again - this time we use function pointers toAndrew Bartlett2003-01-151-14/+26
| | | | | | | eliminate the dependency on the auth subsystem. The next step is to add the required code to 'ntlm_auth', for export to Squid etc. Andrew Bartlett
* Updates to our NTLMSSP code:Andrew Bartlett2003-01-131-194/+88
| | | | | | | | | | | | | | | | | | This tries to extract our server-side code out of sessetup.c, and into a more general lib. I hope this is only a temporay resting place - I indend to refactor it again into an auth-subsystem independent lib, using callbacks. Move some of our our NTLMSSP #defines into a new file, and add two that I found in the COMsource docs - we seem to have a double-up, but I've verified from traces that the NTLMSSP_TARGET_TYPE_{DOMAIN,SERVER} is real. This code also copes with ASCII clients - not that we will ever see any here, but I hope to use this for HTTP, were we can get them. Win2k authenticates fine under forced ASCII, btw. Tested with Win2k, NTLMv2 and Samba's smbclient. Andrew Bartlett
* No point having this for both parts of the 'if' statement.Andrew Bartlett2003-01-111-4/+2
| | | | Andrew Bartlett
* pstring/fstring missmatches found by Andrew Bartlett.Jeremy Allison2003-01-021-5/+5
| | | | Jeremy.
* a better for for using %U in smb.confAndrew Tridgell2002-11-191-0/+11
| | | | | this follows the method used for remote_machine and also fixes the problem of anonymous connections clobbering the string
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-3/+2
| | | | | | dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy.
* Metze claims that without this his win2k server gets horribly confused lookingAndrew Bartlett2002-09-251-2/+2
| | | | | | | | | for all sorts of AD things in lp_realm(). We need to get some non-Win2k NTLMSSP and chase this up a bit, but this will do for now. (Hmm, this might affect NTLMv2 as well) Andrew Bartlett
* Kill of Get_Pwnam_Modify and smb_getpwnam(). The latter assumes some thingsAndrew Bartlett2002-09-251-2/+2
| | | | | | | | that just don't apply any more - now that we always keep username and domain seperate. Also, the policy it was trying to permit is now implemented by the auth code. Andrew Bartlett
* "@" is valid in NetBIOS domain names.Jeremy Allison2002-09-201-1/+1
| | | | Jeremy.
* This is the 'easy' parts of the trusted domains patch n+3 patch fromAndrew Bartlett2002-09-061-13/+11
| | | | | | | | | | | | Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl> It includes a conversion of make_user_info*() to NTSTATUS and some minor changes to other files. It also picks up on a nasty segfault that can occour in some security=domain cases. Andrew Bartlett
* Revert accidental commit - I'll need to do a fair bit more testing before IAndrew Bartlett2002-09-061-3/+0
| | | | commit changes to NTLMSSP flags.
* Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de>Andrew Bartlett2002-09-061-0/+3
| | | | | | | | | | | | | to extend the ADS_STATUS system to include NTSTATUS, and to provide a better general infrustructure for his sam_ads work. I've also added some extra failure mode DEBUG()s to parts of the code. NOTE: The ADS_ERR_OK() macro is rather sensitive to braketing issues - without the final set of brakets, the test is essentially inverted - causing some intersting 'error = success' messages... Andrew Bartlett
* Add a bit of 'const' and move a lot of our 'repeditive' DEBUG() statements toAndrew Bartlett2002-08-311-2/+0
| | | | | | | | 'DEBUGADD', so we don't repeat headers. (Makes them much easier to read). (Based on patch by kai) Andrew Bartlett
* Based orginally by work by Kai, this patch moves our NT_TOKEN generation intoAndrew Bartlett2002-08-201-2/+2
| | | | | | | | | | | | | | | our authenticaion code - removing some of the duplication from the current code. This also gets us *much* closer to supporting a real SAM backend, becouse the SAM can give us the right info then. This also changes our service.c code, so that we do a VUID (rather than uid) cache on the connection struct, and do full NT ACL/NT_TOKEN checks (or cached equivilant) on every packet, for the same r or rw mode the whole share was open for. Andrew Bartlett
* 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