summaryrefslogtreecommitdiffstats
path: root/source/auth
Commit message (Collapse)AuthorAgeFilesLines
...
* Nobody uses this function, and there really doesn't seem much point toAndrew Bartlett2002-05-221-20/+0
| | | | | | it, so we may as well reduce the complexity. Andrew Bartlett
* Cleanups!Andrew Bartlett2002-05-223-44/+30
| | | | | | | | | | Make some code static, add some const to the PAM code, and make the plaintext password code actually function - particulary without the requirement to modify the 'struct passwd' (which it assumed was made up of fstrings) This kills some particularly ugly code in lib/util_pw.c Andrew Bartlett
* typo day :-(Simo Sorce2002-05-211-1/+1
|
* typo, sorrySimo Sorce2002-05-2111-11/+11
|
* debug classizedSimo Sorce2002-05-2112-0/+36
|
* Ensure auth requests from the same machine are completely serialized.Jeremy Allison2002-04-221-5/+40
| | | | | NT4.x DC's require this. Jeremy.
* Partly based on the work by mimir (Rafal SzczesniakAndrew Bartlett2002-04-141-1/+1
| | | | | | | | | | | | | | <mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly enumerate its trusted domains - by exaimining the keys in the secrets.tdb file. This patch has been tested with both NT4 and rpcclient/wbinfo, and adds some extra functionality to talloc and rpc_parse to allow it to deal with already unicode strings. Finally, this cleans up some const warnings that were in net_rpc.c by pushing another dash of const into the rpc client code. Andrew Bartlett
* Spelling.Tim Potter2002-04-071-1/+1
|
* Moved debug messages for grabbing/releasing mutex.Jeremy Allison2002-03-271-2/+0
| | | | Jeremy.
* Don't hold the mutex for more than 20 seconds.Jeremy Allison2002-03-261-2/+4
| | | | Jeremy.
* 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
|
* Renamed get_nt_error_msg() to nt_errstr().Tim Potter2002-03-172-5/+5
|
* 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
* Allow Samba to trust NT4 Domains.Andrew Bartlett2002-03-022-16/+122
| | | | | | | | | | | | | | | | 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
* SECURITY FIXES:Andrew Bartlett2002-03-011-6/+4
| | | | | | | | | Remove a stray 'unbecome_root()' in the ntdomain an auth failure case. Only allow trust accounts to request a challange in srv_netlogon_nt.c. Currently any user can be the 'machine' for the domain logon. MERGE for 2.2. Andrew Bartlett
* Various comment fixes from Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>Andrew Bartlett2002-03-011-1/+1
|
* Ensure that winbindd and smbd both use identical logic to find dc's.Jeremy Allison2002-02-281-11/+12
| | | | | Fix bug where zeroip addresses were being checked. Jeremy.
* "user doesn't exist" isn't worthy of a level 1 debug. Make it level 3.Andrew Bartlett2002-02-271-1/+1
|
* serialise all domain auth requestsAndrew Tridgell2002-02-181-1/+10
| | | | | | | | | this is needed because W2K will send a TCP reset to any open connections that have not done a negprot when a second connection is made. This meant that under heavy netlogon load a Samba domain member would fail authentications. Jeremy, you may wish to port this to 2.2.x
* Fix use of uninitialsed variable in PAM codeAndrew Bartlett2002-02-051-2/+2
|
* Drastic impromvents to pam_winbind.Andrew Bartlett2002-02-051-21/+2
| | | | | | | | | | | | | | | | | This adds code to do generic PAM -> NTSTATUS and NTSTATUS -> PAM error conversions, and uses them to make the error handling in pam_winbind sane. In particular, pam_winbind now uses PAM error codes, not silly '-1, -2 ...' stuff, and logs the NTSTATUS error that winbind now sends over the pipe. Added code to wbinfo to display these - makes a big difference in debugging winbindd. The main change here is the code to allow pam_winbind password changing to correctly stack - This code ripped from pam_unix, and the copyright attached. (Same as for all pam modules, including pam_winbind) Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-3012-24/+12
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Fix up a security issue with the way we handle domain groups retuned on theAndrew Bartlett2002-01-261-16/+2
| | | | | | | | | | | info3. These are RIDs, and it only makes sense to combine them with the domain SID returned with them. This is important for trusted domains, where that sid might be other than the one we currently reterive from the secrets.tdb. Also remove the become_root()/unbecome_root() wrapper from around both remaining TDB users: Both are now initialised at smbd startup. Andrew Bartlett
* Bring auth_winbind into line with the protocol changesAndrew Bartlett2002-01-251-0/+3
| | | | Andrew Bartlett
* Remove check for passwordserver = "*" as we now initialise it.Tim Potter2002-01-251-1/+6
| | | | | Added TODO about perhaps doing a SAMLOGON udp/138 request before a cli_full_connection in connect_to_domain_password_server()
* Spelling fixes.Tim Potter2002-01-201-6/+6
|
* This is another *BIG* change...Andrew Bartlett2002-01-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba now features a pluggable passdb interface, along the same lines as the one in use in the auth subsystem. In this case, only one backend may be active at a time by the 'normal' interface, and only one backend per passdb_context is permitted outside that. This pluggable interface is designed to allow any number of passdb backends to be compiled in, with the selection at runtime. The 'passdb backend' paramater has been created (and documented!) to support this. As such, configure has been modfied to allow (for example) --with-ldap and the old smbpasswd to be selected at the same time. This patch also introduces two new backends: smbpasswd_nua and tdbsam_nua. These two backends accept 'non unix accounts', where the user does *not* exist in /etc/passwd. These accounts' don't have UIDs in the unix sense, but to avoid conflicts in the algroitmic mapping of RIDs, they use the values specified in the 'non unix account range' paramter - in the same way as the winbind ranges are specifed. While I was at it, I cleaned up some of the code in pdb_tdb (code copied directly from smbpasswd and not really considered properly). Most of this was to do with % macro expansion on stored data. It isn't easy to get the macros into the tdb, and the first password change will 'expand' them. tdbsam needs to use a similar system to pdb_ldap in this regard. This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I don't have the test facilities for these. I plan to incoroprate at least pdb_ldap into this scheme after consultation with Jerry. Each (converted) passdb module now no longer has any 'static' variables, and only exports 1 init function outside its .c file. The non-unix-account support in this patch has been proven! It is now possible to join a win2k machine to a Samba PDC without an account in /etc/passwd! Other changes: Minor interface adjustments: pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*. pdb_update_sam_account() no longer takes the 'override' argument that was being ignored so often (every other passdb backend). Extra checks have been added in some places. Minor code changes: smbpasswd no longer attempts to initialise the passdb at startup, this is now done on first use. pdbedit has lost some of its 'machine account' logic, as this behaviour is now controlled by the passdb subsystem directly. The samr subsystem no longer calls 'local password change', but does the pdb interactions directly. This allow the ACB_ flags specifed to be transferred direct to the backend, without interference. Doco: I've updated the doco to reflect some of the changes, and removed some paramters no longer applicable to HEAD.
* Add a touch of 'const' to some auth components, and move the simple plaintextAndrew Bartlett2002-01-202-32/+41
| | | | | | | 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-173-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-152-3/+5
| | | | | | | | 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
* Fix a segfault in auth/auth_domain.c error cases.Andrew Bartlett2002-01-141-2/+1
| | | | | | | | This occured when the attempt to contact the PDC failed. The connection code has already shut down the connection, and 'free'ed the cli or has never initialised it in the first place. Andrew Bartlett
* Many thanks to Alexander Bokovoy <a.bokovoy@sam-solutions.net>.Andrew Bartlett2002-01-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work was sponsored by Optifacio Software Services, Inc. Andrew Bartlett (various e-mails announcements merged into some form of commit message below:) This patch which adds basics of universal groups support into Samba 3. Currently, only Winbind with RPC calls supports this, ADS support requires additional (possibly huge) work on KRB5 PAC. However, basic infrastructure is here. This patch adds: 1. Storing of universal groups for particular user logged into Samba software (smbd/ two winbind-pam methods) into netlogon_unigrp.tdb as array of uint32 supplemental group rids keyed as DOMAIN_SID/USER_RID in tdb. 2. Fetching of unversal groups for given user rid and domain sid from netlogon_unigrp.tdb. Since this is used in both smbd and winbindd, main code is in source/lib/netlogon_uingrp.c. Dependencies are added to AUTH_OBJ as UNIGRP_OBJ and WINBINDD_OBJ as UNIGRP_OBJ. This patch has had a few versions, the final version in particular: Many thanks to Andrew Bartlett for critics and comments, and partly rewritten code. New: - updated fetching code to changed byte order macros - moved functions to proper namespace - optimized memory usage by reusing caller's memory context - enhanced code to more follow Samba coding rules Todo: - proper universal group expiration after timeout
* fixed a crash bug in domain auth caused by an uninitialised nt_statusAndrew Tridgell2002-01-111-1/+1
|
* The DC is meant to be sent the *unmapped* username...Andrew Bartlett2002-01-111-1/+1
| | | | Andrew Bartlett
* Back out the crazy notion that the NTLMSSP flags actually mean anything...Andrew Bartlett2002-01-112-28/+28
| | | | | | | | 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-1/+1
| | | | | | | | | | 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)
* I've decided to move the auth code around a bit more...Andrew Bartlett2002-01-0511-532/+535
| | | | | | | | | | | | | | | | | | | | | | | | 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-16/+16
| | | | | Merge SAFE_FREE fix in tdb from 2.2, and IRIX fix. Jeremy.
* Another touch of 'const'Andrew Bartlett2002-01-021-1/+1
|
* Allow usernames in the form of 'NT_STATUS_....' to map to that as the errorAndrew Bartlett2002-01-011-0/+6
| | | | | | | | when using the 'name_to_ntstatus' auth module. This could be useful in testing. Andrew Bartlett
* Now that winbind doesn't rely on this, we may as well remove it...Andrew Bartlett2002-01-011-108/+0
| | | | Andrew Bartlett
* A farily large commit:Andrew Bartlett2002-01-019-184/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* - portablitity fixes for cc -64 on irixAndrew Tridgell2001-12-311-3/+3
| | | | - fixed gid* bug in rpc_server
* Add a pile of doxygen style comments to various parts of Samba. Many of theseAndrew Bartlett2001-12-304-56/+119
| | | | | | | | | 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
* 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-192-14/+35
| | | | | | 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.
* If domain SID can't be fetched, we shouldn't return NT_STATUS_NO_MEMORY. It ↵Jim McDonough2001-12-141-1/+1
| | | | causes a confusing client error. Changed to NT_STATUS_CANT_ACCESS_DOMAIN_INFO.