summaryrefslogtreecommitdiffstats
path: root/source/auth/auth.c
Commit message (Collapse)AuthorAgeFilesLines
* r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()Stefan Metzmacher2007-10-101-2/+1
| | | | | | | and DLIST_DEMOTE() now take the type of the tmp pointer not the tmp pointer itself anymore. metze
* r15283: Oh yeah. The build farm doesn't do much with head. OK, here is the ↵Paul Green2007-10-101-0/+2
| | | | patch to SAMBA_3_0 to declare prototypes for the initialization functions. These are the same changes I just made to head. --paulg
* r13576: This is the beginnings of moving the SAM_ACCOUNT data structureGerald Carter2007-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | to make full use of the new talloc() interface. Discussed with Volker and Jeremy. * remove the internal mem_ctx and simply use the talloc() structure as the context. * replace the internal free_fn() with a talloc_destructor() function * remove the unnecessary private nested structure * rename SAM_ACCOUNT to 'struct samu' to indicate the current an upcoming changes. Groups will most likely be replaced with a 'struct samg' in the future. Note that there are now passbd API changes. And for the most part, the wrapper functions remain the same. While this code has been tested on tdb and ldap based Samba PDC's as well as Samba member servers, there are probably still some bugs. The code also needs more testing under valgrind to ensure it's not leaking memory. But it's a start......
* r13316: Let the carnage begin....Gerald Carter2007-10-101-10/+10
| | | | Sync with trunk as off r13315
* r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4Jeremy Allison2007-10-101-2/+2
| | | | | x86_64 box. Jeremy.
* r10656: BIG merge from trunk. Features not copied overGerald Carter2007-10-101-1/+1
| | | | | | | * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck)
* r7450: fix my bone head mistake with ntlm authentcation and 'map to guest = ↵Gerald Carter2007-10-101-9/+4
| | | | bad uid'; make sure the authentication suceeds
* r7395: * new feature 'map to guest = bad uid' (based on patch fromGerald Carter2007-10-101-5/+15
| | | | | | | | | aruna.prabakar@hp.com). This re-enables the Samba 2.2 behavior where a user that was successfully authenticated by a remote DC would be mapped to the guest account if there was not existing UNIX account for that user and we could not create one.
* r7024: reverting mistaken commitGerald Carter2007-10-101-13/+5
|
* r7020: fixing printer ace values and getting rid of false compiler warning ↵Gerald Carter2007-10-101-5/+13
| | | | about unitialized variable
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-2/+2
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r1492: Rework our random number generation system.Andrew Bartlett2007-10-101-1/+1
| | | | | | | | | | On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork(). For other systems, we now only re-seed after a fork, and on startup. No need to do it per-operation. This removes the 'need_reseed' parameter from generate_random_buffer(). Andrew Bartlett
* Patch by emil@disksites.com <Emil Rasamat> to ensure we always alwaysAndrew Bartlett2003-11-231-2/+13
| | | | | | free() each auth method. (We had relied on the use of talloc() only, despite providing the free() callback) Andrew Bartlett
* Changes all over the shop, but all towards:Andrew Bartlett2003-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - NTLM2 support in the server - KEY_EXCH support in the server - variable length session keys. In detail: - NTLM2 is an extension of NTLMv1, that is compatible with existing domain controllers (unlike NTLMv2, which requires a DC upgrade). * This is known as 'NTLMv2 session security' * (This is not yet implemented on the RPC pipes however, so there may well still be issues for PDC setups, particuarly around password changes. We do not fully understand the sign/seal implications of NTLM2 on RPC pipes.) This requires modifications to our authentication subsystem, as we must handle the 'challege' input into the challenge-response algorithm being changed. This also needs to be turned off for 'security=server', which does not support this. - KEY_EXCH is another 'security' mechanism, whereby the session key actually used by the server is sent by the client, rather than being the shared-secret directly or indirectly. - As both these methods change the session key, the auth subsystem needed to be changed, to 'override' session keys provided by the backend. - There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure. This should help the SPNEGO implementation. - The 'names blob' in NTLMSSP is always in unicode - never in ascii. Don't make an ascii version ever. - The other big change is to allow variable length session keys. We have always assumed that session keys are 16 bytes long - and padded to this length if shorter. However, Kerberos session keys are 8 bytes long, when the krb5 login uses DES. * This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. * - Add better DEBUG() messages to ntlm_auth, warning administrators of misconfigurations that prevent access to the privileged pipe. This should help reduce some of the 'it just doesn't work' issues. - Fix data_blob_talloc() to behave the same way data_blob() does when passed a NULL data pointer. (just allocate) REMEMBER to make clean after this commit - I have changed plenty of data structures...
* More tuning from cachegrind. Change most trim_string() calls to trim_char(0,Jeremy Allison2003-09-051-2/+2
| | | | | as that's what they do. Fix string_replace() to fast-path ascii. Jeremy.
* get rid of more compiler warningsHerb Lewis2003-08-151-2/+2
|
* Fix memleakVolker Lendecke2003-07-181-1/+1
|
* PAM should operate on the Unix username, not the NT username (which might notAndrew Bartlett2003-07-051-6/+6
| | | | | | have the domain\ qualification). Andrew Bartlett
* This patch takes the work the jerry did for beta2, and generalises it:Andrew Bartlett2003-07-031-10/+11
| | | | | | | | | | | | | | - The 'not implmented' checks are now done by all auth modules - the ntdomain/trustdomain/winbind modules are more presise as to what domain names they can and cannot handle - The become_root() calls are now around the winbind pipe opening only, not the entire auth call - The unix username is kept seperate from the NT username, removing the need for 'clean off the domain\' in parse_net.c - All sid->uid translations are now validated with getpwuid() to put a very basic stop to logins with 'half deleted' accounts. Andrew Bartlett
* fix typos in log messages and comments.Gerald Carter2003-07-011-2/+2
|
* Here's the code to make winbindd work on a Samba DCGerald Carter2003-06-291-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to handle domain trusts. Jeremy and I talked about this and it's going in as working code. It keeps winbind clean and solves the trust problem with minimal changes. To summarize, there are 2 basic cases where the deadlock would occur. (1) lookuping up secondary groups for a user, and (2) get[gr|pw]nam() calls that fall through the NSS layer because they don't exist anywhere. o To handle case #1, we bypass winbindd in sys_getgrouplist() unless the username includes the 'winbind separator'. o Case #2 is handled by adding checks in winbindd to return failure if we are a DC and the domain matches our own. This code has been tested using basic share connections, domain logons, and with pam_winbind (both with and without 'winbind use default domain'). The 'trustdomain' auth module should work as well if an admin wants to manually create UNIX users for acounts in the trusted domains. Other misc fixes: * we need to fix check_ntlm_password() to be able to determine if an auth module is authoritative over a user (NT_STATUS_WRONG_PASSWORD, etc...). I worked around my specific situation, but this needs to be fixed. the winbindd auth module was causing delays. * fix named server mutex deadlock between trust domain auth module and winbindd looking up a uid * make sure SAM_ACCOUNT gets stored in the server_info struct for the _net_sam_logon() reply. Configuration details: The recommended method for supporting trusts is to use winbind. The gets us around some of the server mutex issues as well. * set 'files winbind' for passwd: and group: in /etc/nsswitch.conf * create domain trusts like normal * join winbind on the pdc to the Samba domain using 'net rpc join' * add normal parameters to smb.conf for winbind * set 'auth method = guest sam winbind' * start smbd, nmbd, & winbindd Problems that remain: * join a Windows 2k/XP box to a Samba domain. * create a 2-way trust between the Samba domain and an NT domain * logon to the windows client as a user from theh trusted domain * try to browse server in the trusted domain (or other workstations). an NT client seems to work ok, but 2k and XP either prompt for passwords or fail with errors. apparanently this never got tested since no one has ever been able to logon as a trusted user to a Samba domain from a Windows client.
* add check for NT_STATUS_NOT_IMPLEMENTED in auth check so thatGerald Carter2003-06-281-1/+13
| | | | | | | map to guest = bad user works again when "trustdomain" is listed as last auth method. Also clean up some more DC location calls.
* fix typo (bug #170)Gerald Carter2003-06-231-1/+1
|
* Get 'add user script' working again for Samba 3.0.Andrew Bartlett2003-05-251-6/+0
| | | | | | | | | I'm still not convinced that sharing the option name with the administrative code is the best idea, but anyway... Tested by vl, bug #41. Andrew Bartlett
* add metze's patch for smb_register functionsSimo Sorce2003-05-161-1/+1
|
* Patch from Luke Howard <lukeh@PADL.COM> that fixes some weird handling ofJelmer Vernooij2003-05-151-9/+17
| | | | modules in auth/
* Make the version numbers ints (patch from metze)Jelmer Vernooij2003-04-301-1/+1
|
* Use NTSTATUS as return value for smb_register_*() functions and init_module()Jelmer Vernooij2003-04-281-12/+19
| | | | function. Patch by metze with some minor modifications.
* Merge auth changes from HEAD:Andrew Bartlett2003-04-241-40/+51
| | | | | | | | - better error codes than NT_STATUS_UNSUCCESSFUL for domain logon errors - make auth_winbind load the ntdomain module if winbind isn't there. - use new trusted domains cache to determine if the domain is valid. Andrew Bartlett
* Add support for the new modules system to auth/ (merge from HEAD)Jelmer Vernooij2003-04-161-37/+63
|
* Merge from HEAD - doxygenAndrew Bartlett2003-03-171-2/+2
|
* Merge from HEAD:Andrew Bartlett2003-01-281-1/+9
| | | | | | | | | | | | | | - NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor. - also consequential changes to the NTLMSSP and SPNEGO parsing functions - and the client code that uses the same functions - Add ntlm_auth, a NTLMSSP authentication interface for use by applications like Squid and Apache. - also consquential changes to use common code for base64 encode/decode. - Winbind changes to support ntlm_auth (I don't want this program to need to read smb.conf, instead getting all it's details over the pipe). - nmbd changes for fstrcat() instead of fstrcpy(). Andrew Bartlett
* Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett2003-01-031-2/+2
| | | | | | warnings. (Adds a lot of const). Andrew Bartlett
* Forward port the change to talloc_init() to make all talloc contextsJeremy Allison2002-12-201-4/+4
| | | | | named. Ensure we can query them. Jeremy.
* Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.Jeremy Allison2002-12-111-55/+44
| | | | Jeremy.
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-1/+1
| | | | | | dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy.
* sync 3.0 branch with headJelmer Vernooij2002-08-171-7/+7
|
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-40/+42
|
* Renamed get_nt_error_msg() to nt_errstr().Tim Potter2002-03-171-3/+3
|
* Allow Samba to trust NT4 Domains.Andrew Bartlett2002-03-021-0/+1
| | | | | | | | | | | | | | | | This commit builds on the auth subsystem to give Samba support for trusting NT4 domains. It is off by default, but is enabled by adding 'trustdomain' to the 'auth methods' smb.conf paramater. Tested against NT4 only - there are still some issues with the join code for Win2k servers (spnego stuff). The main work TODO involves enumerating the trusted domains (including the RPC calls to match), and getting winbind to run on the PDC correctly. Similarly, work remains on getting NT4 to trust Samba domains. Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Spelling fixes.Tim Potter2002-01-201-6/+6
|
* I've decided to move the auth code around a bit more...Andrew Bartlett2002-01-051-107/+258
| | | | | | | | | | | | | | | | | | | | | | | | 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
* A farily large commit:Andrew Bartlett2002-01-011-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move rpc_client/cli_trust.c to smbd/change_trust_pw.c - It hasn't been used by anything else since smbpasswd lost its -j - Add a TALLOC_CTX to the auth subsytem. These are only valid for the length of the calls to the individual modules, if you want a longer context hide it in your private data. Similarly, all returns (like the server_info) should still be malloced. - Move the 'ntdomain' module (security=domain in oldspeak) over to use the new libsmb domain logon code. Also rework much of the code to use some better helper functions for the connection - getting us much better error returns (the new code is NTSTATUS). The only remaining thing to do is to figure out if tpot's 0xdead 0xbeef for the LUID feilds is sufficient, or if we should do random LUIDs as per the old code. Similarly, I'll move winbind over to this when I get a chance. This leaves the SPOOLSS code and some cli_pipe code as the only stuff still in rpc_client, at least as far as smbd is concerned. While I've given this a basic rundown, any testing is as always appriciated. Andrew Bartlett
* Add a pile of doxygen style comments to various parts of Samba. Many of theseAndrew Bartlett2001-12-301-29/+56
| | | | | | | | | probably will never actually be genearted, but I like the style in any case. Also fix a segfault in 'net rpc' when the login failed and a small memory leak on failure in the auth_info.c code. Andrew Bartlett
* added trusted realm support to ADS authenticationAndrew Tridgell2001-12-191-13/+15
| | | | | | 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.
* fixed the panics on basicsmb-sharelist on sun1Andrew Tridgell2001-11-271-1/+3
|
* fix sense of lp_allow_trusted_domains()Andrew Tridgell2001-11-271-1/+1
| | | | fix a memory leak
* A number of things to clean up the auth subsytem a bit...Andrew Bartlett2001-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | We now default encrypt passwords = yes We now check plaintext passwords (however aquired) with the 'sam' backend rather than unix, if encrypt passwords = yes. (this kills off the 'local' backed. The sam backend may be renamed in its place) The new 'samstrict' wrapper backend checks that the user's domain is one of our netbios aliases - this ensures that we don't get fallback crazies with security = domain. Similarly, the code in the 'ntdomain' and 'smbserver' backends now checks that the user was not local before contacting the DC. The default ordering has changed, we now check the local stuff first - but becouse of the changes above, we will really only ever contact one auth source. Andrew Bartlett
* challange -> challengeTim Potter2001-11-261-4/+4
|