summaryrefslogtreecommitdiffstats
path: root/source/passdb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix up the trusted domains secrets code so as to have a slight chance ofAndrew Bartlett2002-03-021-12/+10
| | | | working.
* merge from 2.2Gerald Carter2002-03-011-2/+7
|
* The beginning of trusted and trusting domain support fromAndrew Bartlett2002-03-011-3/+89
| | | | | | | | Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl> This adds the 'net' tools to manipulate the trusted domains. Andrew Bartlett
* made the domain secret key in secrets.tdb domain specific. This allowsAndrew Tridgell2002-02-221-2/+14
| | | | | you to join a 2nd domain then leave the old domain rather than the other way around
* Add the pdb_plugin module from Jelmer Vernooij <jelmer@nl.linux.org>.Andrew Bartlett2002-02-222-3/+76
| | | | | | | | | | | | | This allow the user to select 'passdb backend = plugin : /path/to/plugin.so : pluging args' And load any arbitary plugin. Apparently Jelmer has a mysql plugin in the works - hence this patch. We probably need to rework the interface a bit before 3.0 (add versioning of some kind) but this is a good start. Andrew Bartlett
* update from 2.2Simo Sorce2002-02-011-2/+3
|
* Back out herb's changes (to allow smbpasswd -x to work on accounts outsideAndrew Bartlett2002-01-301-10/+9
| | | | | | | | /etc/passwd) and replace them with a version that works. Unfortunetly HEAD and 2.2 have different passdb interfaces and different local_password_change functions... Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-3010-18/+13
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* merge change from @_2 to allow smbpasswd -x to delete user even if noHerb Lewis2002-01-301-7/+10
| | | | | | | | entry in /etc/passwd. There are still differences in the local_password_change function. I'm not sure which was the latest so I didn't change any thing else. Someone needs to take a look and sync these up.
* - Provide sid->name lookup support for non-unix accounts.Andrew Bartlett2002-01-261-13/+39
| | | | | | | | | - Rework the name -> sid lookup function to always try local lookup first (for local domain names) before trying winbind. This seems to eliminate my winbind feedback loop problems. (I don't use winbind for nsswitch, where there are almost certainly further issues). Andrew Bartlett
* local_lookup_name() doens't acutally use its 'domain' argument, so drop it andAndrew Bartlett2002-01-261-5/+3
| | | | make its use clearer.
* fix typoAndrew Bartlett2002-01-261-1/+1
|
* Add some information tidbits to an error DEBUG().Andrew Bartlett2002-01-261-1/+1
|
* Passdb changes:Andrew Bartlett2002-01-253-11/+30
| | | | | | | | | | Modules now name themselves, which should allow for sane behaviour when we get an 'extern' passdb module (which in turn loads a .so). Fix up tdbsam for non-unix-accounts. Not sure if this fixes idra's bug, but its a start... Andrew Bartlett
* getpwnam -> getpwnam_alloc.Andrew Bartlett2002-01-233-4/+11
| | | | idra has promised not to revert these this time :-)
* getpwnam_alloc -> getpwnamSimo Sorce2002-01-211-9/+8
| | | | | | same reason as per pdb_tdb.c there isn't (and will never be probably) another call to any getpw* fn, let's use getpwnam_alloc only when needed.
* hmm, get it right this time.Simo Sorce2002-01-211-1/+1
|
* fix also the comment.Simo Sorce2002-01-211-2/+5
|
* replace getpwnam_alloc with plain getpwnam.Simo Sorce2002-01-211-2/+1
| | | | | We are not going to reuse any getpw* call, so the extra alloc,copy and free only uses extra memory and extra cpu time for nothing.
* getpwnam -> getpwnam_allocAndrew Bartlett2002-01-211-2/+3
|
* Inititialise the gid to what standard_sub_advanced wants for 'no value'.Andrew Bartlett2002-01-201-1/+1
| | | | Andrew Bartlett
* fixes from 2.2Simo Sorce2002-01-201-93/+127
|
* This is another *BIG* change...Andrew Bartlett2002-01-206-439/+992
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Kill off another ugly wart from the side of the passdb subsystem.Andrew Bartlett2002-01-201-33/+0
| | | | | | | | | | | | | This time its the pdb_getsampwuid() function - which was only being used by the SAMR rpc subsystem to gain a 'user session key'. This 'user session key' is actually generated at login time, and the other changes here simply move that data around. This also means that (when I check some details) we will be able to use the user session key, even when we are not actually the DC, becouse its one of the components of the info3 struct returned on logon. Andrew Bartlett
* Fix up an embarrsing bug I introduced when I moved the id21/id23 -> SAM_ACCOUNTAndrew Bartlett2002-01-201-20/+40
| | | | | | | | | conversion across to the pdb_set...() interface. Now we only set strings that are non-null. This allows Win2k to join the domain again, particularly when using tdbsam. Andrew Bartlett
* fixes (asprintf) from 2.2Simo Sorce2002-01-191-6/+6
|
* A nice *big* change to the fundemental way we do things.Andrew Bartlett2002-01-174-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* For some reason I wasn't thinking about failure cases this morning...Andrew Bartlett2002-01-151-0/+72
| | | | | | | Anyway, this makes it slightly sane, but we may decide to smb_panic() here instead. Andrew Bartlett
* Add constness to parametersMartin Pool2002-01-151-1/+1
|
* Commit the auth associated changes I missed from the last commit.Andrew Bartlett2002-01-152-0/+16
| | | | | | | | 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
* Change the passdb interface to use allocated strings.Andrew Bartlett2002-01-153-114/+161
| | | | | | | | | | | | | | | | | | | | | | These strings are allocated using talloc(), either using its own memory context stored on the SAM_ACCOUNT or one supplied by the caller. The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call to pdb_free_sam() will either clean up (remove hashes from memory) and destroy the TALLOC_CTX or just clean up depending on who supplied it. The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I have modified the 3 places that actually checked these returns. The only nasty thing about this patch is the small measure needed to maintin interface compatability - strings set to NULL are actually set to "". This is becouse there are too many places in Samba that do strlen() on these strings without checking if they are NULL pointers. A supp patch will follow to set all strings to "" in pdb_default_sam(). Andrew Bartlett
* Move all the pdb_get...() and pdb_set...() functions to a new file.Andrew Bartlett2002-01-122-798/+825
| | | | | | | This brings passdb.c down to a much more manageable ~1100 lines and makes it a little easier to comprehend whats going on here. Andrew Bartlett
* Fixed up atomic update code.Jeremy Allison2002-01-091-1/+1
| | | | Jeremy.
* fixing compile errorGerald Carter2002-01-021-4/+4
|
* We should be SHLD not LINK when creating shared libraries.Jeremy Allison2002-01-021-2/+2
| | | | | Tidyup in passdb.c Jeremy.
* We go to a lot of effort to avoid strcpy() in Samba, but its not much use ifAndrew Bartlett2002-01-021-12/+12
| | | | | | | | | | | | | | | people start doing using strlen(src) in strncpy() :-) This occured when the talloc based passdb was reverted in favor of a pstring based one. In the talloc version this was fine, becouse the buffer was strlen(src) bytes long. This no longer applies... This doesn't seem to have broken anything, but I'm chasing up an oddity with NT password changing from the last merge. Test & MERGE for 2.2.3 Andrew Bartlett
* Actually enforce the passdb API.Andrew Bartlett2002-01-024-189/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | Thou shalt not reference SAM_ACCOUNT members directly - always use pdb_get/pdb_set. This is achived by making the whole of SAM_ACCOUNT have a .private member, where the real members live. This caught a pile of examples, and these have beeen fixed. The pdb_get..() functions are 'const' (have been for some time) and this required a few small changes to constify other functions. I've also added some debugs to the pdb get and set, they can be removed if requested. I've rewritten the copy_id2x_to_sam_pass() functions to use the new passdb interface, but I need the flags info to do it properly. The pdb_free_sam() funciton now blanks out the LM and NT hashes, and as such I have removed many extra 'samr_clear_sam_passwd(smbpass)' calls as a result. Finally, any and all testing is always appriciated - but the basics seem to work. Andrew Bartlett
* ops, froget to set the values.Simo Sorce2001-12-311-1/+7
| | | | | | jerry, can you look at theis where we use standard_sub_advanced() fns? I think this structure should be backported to 2.2 because we do not know if the SAM_ACCOUNT strings have enough space to contain the "substituted" string. (Yes, just now we know they are pstrings, but we may change them into alloced one, I'm a strong suported of alloced strings as 1024 bytes are not always enough and are often too much)
* port mods from 2.2Simo Sorce2001-12-311-3/+36
|
* more irix -64 portability fixesAndrew Tridgell2001-12-311-5/+6
|
* Make --with-tdbsam compile again, given the new 'am I setting a default' flags.Andrew Bartlett2001-12-311-4/+4
| | | | Andrew Bartlett
* removed extern samlogon_userGerald Carter2001-12-311-6/+0
|
* remove samlogon_userGerald Carter2001-12-311-10/+1
|
* some merges from 2.2. Still need to merge in changes from pdb_tdb.cGerald Carter2001-12-314-143/+239
| | | | | but it will take more time as I don't want to loose any fixes that are only in HEAD.
* util_sid.c - respect a const variabile (addedd strdup)Simo Sorce2001-12-302-23/+48
| | | | | | cli_reg.c - indentation pdb_ldap.c - some checks on init fns parameters pdb_tdb.c - some checks on init fns parameters + make sure we close the db on failure
* Finally remove these files, which moved (by cvs backend magic) to source/authAndrew Bartlett2001-12-302-1668/+0
| | | | at the start of the month.
* pdb_getsampwnuid() merge from 2.2Gerald Carter2001-12-305-156/+29
|
* removed unused filesGerald Carter2001-12-284-2320/+0
|
* moving SAM_ACCOUNT to include a bit field for initializedGerald Carter2001-12-275-73/+45
| | | | | | | | | | | | | | | | | | | | members (such as uid and gid). This way we will be able to keep ourselves from writing out default smb.conf settings when the admin doesn't want to, That part is not done yet. Tested compiles with ldap/tdb/smbpasswd. Tested connection with smbpasswd backend. oh...and smbpasswd doesn'y automatically expire accounts after 21 days from the last password change either now. Just ifdef'd out that code in build_sam_account(). Will merge updates into 2.2 as they are necessary. jerry
* Rafal (mimir) patch for trusts r.Jean-François Micouleau2001-12-141-6/+20
|