summaryrefslogtreecommitdiffstats
path: root/source/auth/auth_util.c
Commit message (Collapse)AuthorAgeFilesLines
* some more idmapping :)Simo Sorce2003-04-051-5/+7
|
* Fix compile.Andrew Bartlett2003-03-231-2/+2
|
* NTLM Authentication:Andrew Bartlett2003-03-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a 'privileged' mode to Winbindd. This is achieved by means of a directory under lockdir, that the admin can change the group access for. - This mode is now required to access with 'CRAP' authentication feature. - This *will* break the current SQUID helper, so I've fixed up our ntlm_auth replacement: - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a challenge. - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5 servers. - Tested - works for Win2k clients, but not Win9X at present. NTLMSSP updates are needed. - Now uses fgets(), not x_fgets() to cope with Squid environment (I think somthing to do with non-blocking stdin). - Add much more robust connection code to wb_common.c - it will not connect to a server of a different protocol version, and it will automatically try and reconnect to the 'privileged' pipe if possible. - This could help with 'privileged' idmap operations etc in future. - Add a generic HEX encode routine to util_str.c, - fix a small line of dodgy C in StrnCpy_fn() - Correctly pull our 'session key' out of the info3 from th the DC. This is used in both the auth code, and in for export over the winbind pipe to ntlm_auth. - Given the user's challenge/response and access to the privileged pipe, allow external access to the 'session key'. To be used for MSCHAPv2 integration. Andrew Bartlett
* Now that mimir has done the grunt work, I'll fix up the commentAndrew Bartlett2003-03-151-4/+1
|
* Fresh meat in trusted domains code:Rafal Szczesniak2003-03-141-20/+6
| | | | | | | | | | | | | | | - packing/unpacking utility functions for trusted domain password struct; can be used to prepare buffer to store in secrets.tdb or (soon) passdb backend - similiar functions for DOM_SID - respectively modified secrets_(fetch|store) routines - new auth mapping code utilising introduced is_trusted_domain function - added tdb (un)packing of single bytes Rafal
* First check if the user is in the passdb, then check Get_Pwnam().Andrew Bartlett2003-02-221-0/+30
| | | | | | | | | | We check passdb becouse the user might have things like a logon script set, but we have to check the passdb becouse the user might not be in smbpasswd at all. This is in preperation for the removal of unixsam as an assuption. Andrew Bartlett
* For a number of months now, support for being a domain member without alsoAndrew Bartlett2003-02-201-25/+14
| | | | | | | | running winbind has been broken. This fixes that, by removing assumptions about being able to call sid_to_uid() at will. This whole area needs revising when we get groups into the PDB. Andrew Bartlett
* If we didn't make the server_info correctly, then don't segfault trying toAndrew Bartlett2003-02-171-1/+3
| | | | | | set the 'guest' bit. Andrew Bartlett
* Some cleanups:Andrew Bartlett2003-02-101-2/+10
| | | | | | | | | | | | | | | - 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
* Missing indirect in final free.Jeremy Allison2003-01-131-2/+2
| | | | Jeremy.
* Fix to debian bug #171071 - we had the wrong dereference on the pointer to beAndrew Bartlett2003-01-131-4/+4
| | | | | | | | | Realloc()ed, causing it to fail. Big thanks to Sandor Sonfeld <sonf@linuxmail.org> for the debug, stack and valgrind traces! Andrew Bartlett
* Use size_t for the counter vars, to match the type they are assigned fromAndrew Bartlett2003-01-111-3/+3
| | | | | | (signed/unsigned mixup). Andrew Bartlett
* We already have one function to move unistr2 -> multibyte-static, so weAndrew Bartlett2003-01-021-5/+5
| | | | | | | | | don't need a second just for pdb. Also, remove magic 'is lp_guest_account' test - the magic RID should be up to the passdb backend to set. Andrew Bartlett
* Small auth updates:Andrew Bartlett2002-11-151-0/+3
| | | | | | | | | | | - add static remove unnneded prototype - move become_root() to just around pdb calls, so as to make it easier to remove when we kill off this silly idea - Change auth_sam to do 'account before password' rather than 'password before account'. This means that we match Win2k in giving 'account disabled' instead of 'wrong password' if the wrong password to a disabled account is used. Andrew Bartlett
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-1/+0
| | | | | | dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy.
* Nice *big* patch from metze.Andrew Bartlett2002-10-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual design change is relitivly small however: It all goes back to jerry's 'BOOL store', added to many of the elements in a SAM_ACCOUNT. This ensured that smb.conf defaults did not get 'fixed' into ldap. This was a great win for admins, and this patch follows in the same way. This patch extends the concept - we don't store values back into LDAP unless they have been changed. So if we read a value, but don't update it, or we read a value, find it's not there and use a default, we will not update ldap with that value. This reduced clutter in our LDAP DB, and makes it easier to change defaults later on. Metze's particular problem was that when we 'write back' an unchanged value, we would clear any muliple values in that feild. Now he can still have his mulitivalued 'uid' feild, without Samba changing it for *every* other operation. This also applies to many other attributes, and helps to eliminate a nasty race condition. (Time between get and set) This patch is big, and needs more testing, but metze has tested usrmgr, and I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly flawed ;-). The same system will be introduced into the SAM code shortly, but this fixes bugs that people were coming across in production uses of Samba 3.0/HEAD, hence it's inclusion here. Andrew Bartlett
* Move to common user token debugging, and ensure we always print both theAndrew Bartlett2002-09-251-6/+24
| | | | | | | NT_TOKEN and the unix credentials - as we incresingly use the NT stuff we want to make it easy to check they don't get out of wack. Andrew Bartlett
* Don't display debugs of the nt user token twice.Tim Potter2002-09-151-4/+0
|
* Merge of 'other_sids' patch from appliance.Tim Potter2002-09-151-4/+19
|
* This is the 'easy' parts of the trusted domains patch n+3 patch fromAndrew Bartlett2002-09-061-53/+69
| | | | | | | | | | | | 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
* off by one in writing to malloced array. this fixes smbd crash I saw atHerb Lewis2002-08-301-2/+2
| | | | the CIFS conference - finally got purify working
* Try to support non-root-mode systems without getgrouplist().Andrew Bartlett2002-08-261-7/+9
| | | | Andrew Bartlett
* Cope with non-unix accounts - we just won't get the groups for those users.Andrew Bartlett2002-08-211-2/+4
| | | | Andrew Bartlett
* Based orginally by work by Kai, this patch moves our NT_TOKEN generation intoAndrew Bartlett2002-08-201-93/+401
| | | | | | | | | | | | | | | 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
* Make 'remote_machine' private to lib/substitute.c, and fix all the user to useAndrew Bartlett2002-08-111-3/+2
| | | | | | the new accessor functions. Andrew Bartlett
* Try to get security=domain at least slightly working.Andrew Bartlett2002-06-241-7/+11
| | | | | | | | | | | | | The previous code both had basic logic flaws in it, and some subtle issues regarding the Win2k info3 response. I've tested this against Samba (it looks like that was missed last time due to the 'called name' corruption - which broke my testsuite) and accomidated what I've seen from a info3 printout jmcd gave me. I'll get this tested fully as soon as I get my VMware going again. Andrew Bartlett
* This patch does 2 things:Andrew Bartlett2002-06-151-4/+177
| | | | | | | | | | | | | | | It extends the 'server mutex' to conver security=server, becouse the connection race condition exists here too, and while people *should* use security=domain, some sites don't.... (This probably should be done in 2.2 as well). Also, start to actually extract and use the information that the remote server returns in the info3 struct. The server mutex code is now in a new file. Andrew Bartlett
* Spelling.Tim Potter2002-06-121-1/+1
|
* Clean up a few unused functions, add a bit of static etc.Andrew Bartlett2002-05-251-28/+0
| | | | | | | | | | | | | | Importantly: The removal of the silly 'delete user script' behaviour when secuity=domain. I have left the name the same - as it still does the (previously documented, but not in smb.conf(5)) sane behaviour of deleting users on request. When we decide what to do with the 'add user' functionality, we might rename it. Andrew Bartlett
* typo, sorrySimo Sorce2002-05-211-1/+1
|
* debug classizedSimo Sorce2002-05-211-0/+3
|
* Spelling fixes.Tim Potter2002-03-241-1/+1
|
* Extra parinoa and DEBUG()s for the make_user_info_map() code.Andrew Bartlett2002-03-231-4/+18
|
* Ensure we never use "" as a domain name (Win9X apparently does this for 'net ↵Andrew Bartlett2002-03-131-1/+6
| | | | | | | | use' duirng login). Picked up from a post to a TNG list by Volker. Andrew Bartlett
* Various comment fixes from Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>Andrew Bartlett2002-03-011-1/+1
|
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Add a touch of 'const' to some auth components, and move the simple plaintextAndrew Bartlett2002-01-201-10/+10
| | | | | | | password check into its own helper funciton. (This will allow it to be called from other places). Andrew Bartlett
* Don't do tridge's crazy 'am I a trusted domain' lookup for guests.Andrew Bartlett2002-01-181-9/+12
| | | | Andrew Bartlett
* A nice *big* change to the fundemental way we do things.Andrew Bartlett2002-01-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Commit the auth associated changes I missed from the last commit.Andrew Bartlett2002-01-151-1/+1
| | | | | | | | Also set the default value of all the allocated strings to "" to avoid changing the interface (becouse pdb_get...() would point to a null string, rather than a null pointer and parts of samba rely on that). Andrew Bartlett
* Back out the crazy notion that the NTLMSSP flags actually mean anything...Andrew Bartlett2002-01-111-21/+21
| | | | | | | | 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
* I've decided to move the auth code around a bit more...Andrew Bartlett2002-01-051-13/+50
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Another touch of 'const'Andrew Bartlett2002-01-021-1/+1
|
* Now that winbind doesn't rely on this, we may as well remove it...Andrew Bartlett2002-01-011-108/+0
| | | | Andrew Bartlett
* - portablitity fixes for cc -64 on irixAndrew Tridgell2001-12-311-3/+3
| | | | - fixed gid* bug in rpc_server
* Removed extra lp_adduser() call.Jeremy Allison2001-12-291-17/+0
| | | | | Fixed up error returns in get_correct_cversion(). Jeremy.
* added trusted realm support to ADS authenticationAndrew Tridgell2001-12-191-1/+20
| | | | | | 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.
* make sure we pass the lm and nt data in the right order. They were swapped, ↵Jim McDonough2001-12-171-2/+2
| | | | and somehow this worked when both were provided, but not when only one was.
* added info level 3 to samrgetgroupinfo. I don't know what the value is.Jean-François Micouleau2001-12-101-1/+1
| | | | | | | | | | | | | It's just to keep usermanager happy ;-) clean up a bit samr_query_aliasinfo to return the group description added: samr_del_aliasmem, samr_del_groupmem and samr_del_domuser with the correct scripts, you can now entirely manage the users from usermanager ! Closer to full PDC every day ;-) J.F.
* fixed leak in free_user_info()Andrew Tridgell2001-11-271-0/+1
|