summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_tdb.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-28Turn the pdb_rid_algorithm into a capabilities call that returns flagsVolker Lendecke1-3/+3
2009-04-01Allow pdbedit to change a user rid/sid. Based on a fix from Alexander ↵Jeremy Allison1-3/+57
Zagrebin <alexz@visp.ru>. Jeremy.
2009-04-01s3: fix the fix for bug #6195 - dont let smbd child processes panicMichael Adam1-2/+16
This patch makes sure the original and temporary TDBs are closed _before_ the rename. Originally, the open TDB was renamed, and so the name passdb.tdb.tmp stayed around in the db context. Hence upon client connect, the smbd children died because reinit_after_fork() calling tdb_reopen_all() would try to reopen passdb.tdb.tmp which existed no longer... Michael
2009-03-27Fix the problem of 3.0.x passdb databases being versionJeremy Allison1-5/+43
3 but using a different hash calculation than 3.2.x passwd databases (also version 3). Introduces a minor version number. Jeremy.
2009-03-27Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb ↵Jeremy Allison1-1/+2
correctly. For the clustering case. Clustered setups should have only ever used the unsigned version of TDB_DATA in the first place so they can't be in this mess :-). Just do the normal upgrade in the clustered case. Jeremy.
2009-03-18Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb ↵Jeremy Allison1-14/+201
correctly. This is a really nasty one to fix as in order to successfully update the passdb.tdb we must do the equivalent of a tdbbackup to move to the new hash values before we do the upgrade. Jeremy.
2009-03-17Missing break in conversion function prevents tdb password database update.Alexander Zagrebin1-0/+1
2009-03-07Shape up pdb_search a bit by making it a talloc ctx with a destructorVolker Lendecke1-7/+4
2009-02-17Fix bug #6117 - Samba 3.3.0: pdbedit -a core dumps.Jeremy Allison1-1/+12
Jeremy.
2008-12-29s3:pdb_tdb: store the next rid counter in passdb.tdb instead of ↵Stefan Metzmacher1-75/+47
winbind_idmap.tdb This upgrades the TDBSAM_VERSION to 4 and SAMU_BUFFER_V4. metze
2008-12-29s3:passdb: make marshalling struct samu from and to a buffer more genericStefan Metzmacher1-651/+15
This marshalling isn't specific to tdbsam and it's ugly to have the related functions in two different files. metze
2008-08-13fixed lots of places that paniced on a failed transaction_commit,Andrew Tridgell1-4/+5
thinking it was a failure of a transaction cancel (This used to be commit 22dbe158ed62ae47bbcb41bba3db345294f75437)
2008-08-13first cut at adding full transactions for ctdb to samba3Andrew Tridgell1-1/+1
(This used to be commit f91a3e0f7b7737c1d0667cd961ea950e2b93e592)
2008-04-15pdb_tdb: fix the upgrade code, db_traverse returns the number of records!Stefan Metzmacher1-1/+3
metze (This used to be commit baaf571d540ace5119c528fd35bceab335bd6741)
2008-04-01pdb_tdb: use != 0 instead off == -1 for dbwrap functionsStefan Metzmacher1-1/+1
metze (This used to be commit d4826a01369c00b5e83cd62c2412a4eb826e216d)
2008-03-27pdb_tdb: use db_open_trans()Stefan Metzmacher1-1/+1
metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit 9925cc01a2a4739d6cde5991eb0d0b79ae13353b)
2008-03-27pdb_tdb: use db_sam->transaction_start(db_sam) != 0 consistentStefan Metzmacher1-1/+1
metze Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit 3bf9ab640e9a79157fcfee0b5d0cde5badc92755)
2008-03-17Convert pdb_tdb to use dbwrapVolker Lendecke1-318/+316
(This used to be commit 948ab77863b12b1b0bd1c970004b84b9bb1bb2fa)
2008-01-12Fix CID 469. new_acct can't be NULL here.Jeremy Allison1-2/+1
Jeremy. (This used to be commit c79e9414c4baed6e61fc6a3f766395b873bcc4ea)
2007-12-29Make pdb_tdb honour a private dir overridden in smb.conf.Michael Adam1-1/+1
One lp_private_dir() has to be used instead of get_dyn_PRIVATE_DIR() to determine the location of the passdb.tdb. I noticed this when running make test as a "normal user" from a build, where I had done "make install" as root before, and so the passdb.tdb could not be accessed during the startup phase "CREATE TEST ENVIRONMENT IN ./st ..." in selftest.sh. Michael (This used to be commit 1f96389afa7250af7393489fb538b8aed93d815c)
2007-12-29passdb.tdb is located in the private directoryVolker Lendecke1-1/+2
Jerry, as part of d6cdbfd87 the default location of passdb.tdb has changed from the private directory to the state directory. I think because passdb.tdb holds the password hashes, it is reasonable to keep this next to the smbpasswd file. Please review and potentially push. Thanks, Volker (This used to be commit c9c7607c402c0a9df9796c767b689d207d67d8e4)
2007-12-26Remove the sampwent interfaceVolker Lendecke1-146/+0
(This used to be commit 9e80b969fb40766de2c9b1a05d16bf4d4c6e46f7)
2007-12-26Add tdbsam_search_usersVolker Lendecke1-0/+134
(This used to be commit 02f0b0bd393bd942fc934f251bd6afed8e5424b0)
2007-12-10Remove the char[1024] strings from dynconfig. ReplaceJeremy Allison1-1/+1
them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05)
2007-11-20More pstring elimination.Jeremy Allison1-42/+67
Jeremy. (This used to be commit 15074de938539e7a9c527d9a6d81792adc2ac3d0)
2007-11-05static pstring removalVolker Lendecke1-2/+2
(This used to be commit 5490e2d77233f594a42cb32eda8215014db544e3)
2007-11-01Patch 2 of 3 from Debian Samba packagers:Gerald (Jerry) Carter1-2/+2
The point is doing the following associations: - non discardable state data (all TDB files that may need to be backed up) go to statedir - shared data (codepage stuff) go to codepagedir The patch *does not change* the default location for these directories. So, there is no behaviour change when applying it. The main change is for samba developers who have to think when dealing with files that previously pertained to libdir whether they: - go in statedir - go in codepagedir - stay in libdir (This used to be commit d6cdbfd875bb2653e831d314726c3240beb0a96b)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-25/+25
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r23801: The FSF has moved around a lot. This fixes their Mass Ave address.Andrew Tridgell1-2/+1
(This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach1-1/+1
failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-11/+12
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21982: make use of tdb_*_bystring() and string_term_tdb_data()Stefan Metzmacher1-29/+12
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit 9ebaa4c573ea5784a8c9cd9d29561b760d62bb18)
2007-10-10r18703: Fix the annoying effect that happens when nscd is running:Günther Deschner1-0/+4
We usually do not get the results from user/group script modifications immediately. A lot of users do add nscd restart/refresh commands into their scripts to workaround that while we could flush the nscd caches directly using libnscd. Guenther (This used to be commit 7db6ce295afbedfada7b207ad56566d2195a0d21)
2007-10-10r17150: MMC User & group plugins fixes:Gerald Carter1-5/+15
* Make sure to lower case all usernames before calling the create, delete, or rename hooks. * Preserve case for usernames in passdb * Flush the getpwnam cache after renaming a user * Add become/unbecome root block in _samr_delete_dom_user() when trying to verify the account's existence. (This used to be commit bbe11b7a950e7d85001f042bbd1ea3bf33ecda7b)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-16/+27
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16663: Fix coverity #301, memleak in error path.Jeremy Allison1-1/+1
Jeremy. (This used to be commit dfdb4ce89155dc1528b455252751616cc2c6708c)
2007-10-10r16624: Fix bug #3877, reported by jason@ncac.gwu.eduJeremy Allison1-2/+1
Jeremy. (This used to be commit 1f52b8b40619679242da663f5e5e7836d547f0a2)
2007-10-10r16582: Fix Klocwork #1997 and all generic class of problemsJeremy Allison1-0/+6
where we don't correctly check the return from memdup. Jeremy. (This used to be commit ce14daf51c7ee2f9c68c77f7f4674e6f0e35c9ca)
2007-10-10r16014: Correctly set the group RID in init_sam_from_buffer.Volker Lendecke1-0/+2
BIG THANKS to Tom Bork for reporting that Bug! Volker (This used to be commit 40339fdcced67d62e449ba6f19329d89c808e139)
2007-10-10r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring ↵Volker Lendecke1-3/+3
does not have the timeout argument in Samba4. Add a new routine tdb_lock_bystring_with_timeout. Volker (This used to be commit b9c6e3f55602fa505859a4b2cd137b74105d685f)
2007-10-10r14634: Many bug fixes thanks to train rides and overnight stays in airportsGerald Carter1-13/+7
* Finally fix parsing idmap uid/gid ranges not to break with spaces surrounding the '-' * Allow local groups to renamed by adding info level 2 to _samr_set_aliasinfo() * Fix parsing bug in _samr_del_dom_alias() reply * Prevent root from being deleted via Samba * Prevent builting groups from being renamed or deleted * Fix bug in pdb_tdb that broke renaming user accounts * Make sure winbindd is running when trying to create the Administrators and Users BUILTIN groups automatically from smbd (and not just check the winbind nexted groups parameter value). * Have the top level rid allocator verify that the RID it is about to grant is not already assigned in our own SAM (retries up to 250 times). This fixes passdb with existing SIDs assigned to users from the RID algorithm but not monotonically allocating the RIDs from passdb. (This used to be commit db1162241f79c2af8afb7d8c26e8ed1c4a4b476f)
2007-10-10r14577: BUG Fixes:Gerald Carter1-8/+6
* Add back in the import/export support to pdbedit * Fix segv in pam_smbpass * Cleanup some error paths in pdb_tdb and pdb_interface (This used to be commit df53d64910fbb96eb810102e986b3c337d54c463)
2007-10-10r13765: Fix bug reported by jra. Don't check for a group SID when storingGerald Carter1-0/+2
a user since we no longer pay any attention to the value. (This used to be commit 085c6859ee5b97efe9ec06e95877d500822d3c82)
2007-10-10r13747: Fix the reference count for tdbsam_open() - on anJeremy Allison1-5/+9
upgrade it calls tdbsam_convert() which calls tdbsam_open() deep inside the init_sam_from_buffer_vX call. If the ref count hasn't been set yet then we will close the tdbsam reference in tdbsam_getsampwsid(). smbpasswd -a was core-dumping again :-). Jeremy (This used to be commit 993069eb87c190ba8ee92224340c8f9ffb3ade74)
2007-10-10r13729: Fix smbpasswd -xVolker Lendecke1-13/+6
(This used to be commit 2afcbbfb6f2efcc2e10106b10a87365556013787)
2007-10-10r13728: No, we have not talked about this on irc less than 24h ago... ;-)Volker Lendecke1-2/+2
(This used to be commit 59f95ea752d932b00d4a4ff37311b830d65c8a03)
2007-10-10r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.Günther Deschner1-4/+238
* Fix a couple of related parsing issues. * in the info3 reply in a samlogon, return the ACB-flags (instead of returning zero) Guenther (This used to be commit 5b89e8bc24f0fdc8b52d5c9e849aba723df34ea7)
2007-10-10r13679: Commiting the rm_primary_group.patch posted on samba-technicalGerald Carter1-4/+6
* ignore the primary group SID attribute from struct samu* * generate the primary group SID strictlky from the Unix primary group when dealing with passdb users * Fix memory leak in original patch caused by failing to free a talloc * * add wrapper around samu_set_unix() to prevent exposing the create BOOL to callers. Wrappers are samu_set_unix() and samu-allic_rid_unix() (This used to be commit bcf269e2ec6630b78d909010fabd3b69dd6dda84)
2007-10-10r13622: Allow to rename machine accounts in a Samba Domain. This still uses theGünther Deschner1-3/+4
"rename user script" to do the rename of the posix machine account (this might be changed later). Fixes #2331. Guenther (This used to be commit b2eac2e6eb6ddd1bcb4ed5172e7cd64144c18d16)