summaryrefslogtreecommitdiffstats
path: root/source/passdb/pdb_nisplus.c
Commit message (Collapse)AuthorAgeFilesLines
* Put in the new modules system. It's now used by passdb and rpc. I willJelmer Vernooij2003-03-191-8/+2
| | | | put a doc about it in dev-doc later today.
* Fix memory leak (patch by Steve Langasek)Jelmer Vernooij2002-10-251-0/+14
|
* This moves the group mapping API into the passdb backend.Volker Lendecke2002-10-211-3/+2
| | | | | | | | | | | | Currently this calls back to mapping.c, but we have the framework to get the information into LDAP and the passdb.tdb (should we? I think so..). This has received moderate testing with net rpc vampire and usrmgr. I found the add_groupmem segfault in add_aliasmem as well, but that will be another checkin. Volker
* Nice *big* patch from metze.Andrew Bartlett2002-10-121-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 all the passdb internal interface to NTSTATUSSimo Sorce2002-09-261-53/+58
| | | | | | | | | only the interface has been fully moved to NTSTATUS not all the plugins make full use of it, but have been all converted. My testings passed completely, however a bit of more testing is welcome Simo.
* Add changes suggested by abartlet:Jelmer Vernooij2002-08-211-1124/+1205
| | | | | | - don't use lp_passwd_file() to retrieve NIS domain name, but use location instead - some cleanups
* pdb_nisplus converted to the new passdb system API'sJelmer Vernooij2002-08-201-559/+585
|
* Add const to a pile of const to *DOM_SID paramaters.Andrew Bartlett2002-08-071-1/+1
| | | | Andrew Bartlett
* Name get and set dir drive functions consistently.Tim Potter2002-07-211-7/+7
|
* compile warngin fixes merged from 2.2Gerald Carter2002-06-171-1/+1
|
* Latest patch from metze <metze@metzemix.de> to move most of samba acrossAndrew Bartlett2002-06-131-5/+7
| | | | | | | | | | | to using SIDs instead of RIDs. The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument. The idea here is to prevent mistakes where the SID is implict, but isn't the same one that we have in the struct. Andrew Bartlett
* change: pdb_getsampwrid() ->pdb_getsampwsid()Simo Sorce2002-05-261-1/+9
| | | | | | passdb interface change, now the passdb modules will be asked for SID not for rid, the modules have been updated with a passthrough function that calls the old getsampwrid() functions. srv_samr_nt.c functions that made use of the pdb_getsampwrid funcion has been updated to use the SID one.
* second step to gain free uid<->rid mappingSimo Sorce2002-03-191-0/+19
| | | | we still need to free gid<->rid mapping and few other stuff
* Compile fixes for the pdb nisplus module.Tim Potter2002-03-071-17/+27
|
* Removed version number from file header.Tim Potter2002-01-301-1/+2
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* getpwnam -> getpwnam_alloc.Andrew Bartlett2002-01-231-1/+4
| | | | idra has promised not to revert these this time :-)
* This is another *BIG* change...Andrew Bartlett2002-01-201-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Actually enforce the passdb API.Andrew Bartlett2002-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* removed extern samlogon_userGerald Carter2001-12-311-6/+0
|
* some merges from 2.2. Still need to merge in changes from pdb_tdb.cGerald Carter2001-12-311-17/+41
| | | | | but it will take more time as I don't want to loose any fixes that are only in HEAD.
* pdb_getsampwnuid() merge from 2.2Gerald Carter2001-12-301-40/+0
|
* moving SAM_ACCOUNT to include a bit field for initializedGerald Carter2001-12-271-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* again an intrusive patch:Jean-François Micouleau2001-12-061-6/+0
| | | | | | | | | | | | | | | - removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the definition of standard_sub_basic() to cope with that. - removed the smb.conf: 'domain admin group' and 'domain guest group' parameters ! We're not playing anymore with the user's group RIDs ! - in get_domain_user_groups(), if the user's gid is a group, put it first in the group RID list. I just have to write an HOWTO now ;-) J.F.
* added a boolean to the group mapping functions to specify if we need orJean-François Micouleau2001-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | not the privileges. Usually we don't need them, so the memory is free early. lib/util_sid.c: added some helper functions to check an SID. passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass an RID all the way. If the group doesn't exist on the domain SID, don't return a faked one as it can collide with a builtin one. Some rpc structures have been badly designed, they return only rids and force the client to do subsequent lsa_lookup_sid() on the domain sid and the builtin sid ! rpc_server/srv_util.c: wrote a new version of get_domain_user_groups(). Only the samr code uses it atm. It uses the group mapping code instead of a bloody hard coded crap. The netlogon code will use it too, but I have to do some test first. J.F.
* added mapping of primary gid to rid thru the group mapping code.Jean-François Micouleau2001-12-021-3/+18
| | | | | | | and cleanup and comments in passdb/passdb.c J.F.
* Added debug in truncate, fixed warning with gcc3.Jeremy Allison2001-11-071-2/+1
| | | | Jeremy.
* Various post AuthRewrite cleanups, fixups and tidyups.Andrew Bartlett2001-11-011-2/+2
| | | | | | | | | | | | | | | | | Zero out some of the plaintext passwords for paranoia Fix up some of the other passdb backends with the change to *uid_t rather than uid_t. Make some of the code in srv_netlog_nt.c clearer, is passing an array around, so pass its lenght in is definition, not as a seperate paramater. Use sizeof() rather than magic numbers, it makes things easier to read. Cope with a PAM authenticated user who is not in /etc/passwd - currently by saying NO_SUCH_USER, but this can change in future. Andrew Bartlett
* This commit is number 4 of 4.Andrew Bartlett2001-10-291-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular this commit focuses on: Actually adding the 'const' to the passdb interface, and the flow-on changes. Also kill off the 'disp_info' stuff, as its no longer used. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes introduces a large dose of 'const' to the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username --- This finishes this line of commits off, your tree should now compile again :-) Andrew Bartlett
* Added a comment about not changing the magic timestamp values withoutTim Potter2001-10-031-0/+3
| | | | knowing what you are doing!
* Ensure accessing NT member servers works with a Samba PDC. Don'tJeremy Allison2001-10-031-4/+4
| | | | | | change these timestamp settings without good reason. Remove CLEAR_IF_FIRST flag is tdb is read-only. Jeremy.
* Fixed the bug with member servers in a Samba PDC hosted domain not allowingJeremy Allison2001-10-021-6/+6
| | | | | | other access. Problem was max time was being set to 0xffffffff, instead of 0x7fffffff. Jeremy.
* merge from 2.2Gerald Carter2001-09-261-2/+2
|
* Fixup passdb stuff to add new nisplus and ldap backends.Jeremy Allison2001-09-251-0/+1401
Jeremy.