1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

174 Commits

Author SHA1 Message Date
Volker Lendecke
45e61fcf61 s3: Add a "lock_order" argument to db_open
This will be used to enforce a lock hierarchy between the databases. We have
seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb.
These should be fixed by refusing a dbwrap_fetch_locked that does not follow a
defined lock hierarchy.
2012-01-18 14:48:04 +01:00
Michael Adam
6760011761 s3:dbwrap: change dbwrap_store_uint32() to NTSTATUS return type
for consistency and better error propagation

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Oct 11 15:51:00 CEST 2011 on sn-devel-104
2011-10-11 15:51:00 +02:00
Michael Adam
c9bc1e4924 s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return type
for consistency and better error propagation
2011-10-11 14:17:58 +02:00
Michael Adam
658f72128f s3:dbwrap: change dbwrap_fetch_uint32() to NTSTATUS return type (instead of bool)
for consistency and better error propagation
2011-10-11 14:17:58 +02:00
Michael Adam
603c3e1bcb s3:dbwrap: convert dbwrap_fetch_int32() to NTSTATUS return code
Return the int32 value retrieved from the db by reference.
Before this, return value "-1" was used as a error indication,
but it could also be a valid value from the database.
2011-10-11 14:17:58 +02:00
Michael Adam
a91f06a722 s3:passdb: convert pdb_tdb to use dbwrap wrapper functions.
Avoid direct use of the db_record and db_context structs
2011-10-11 14:17:57 +02:00
Michael Adam
0e28448a78 s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS 2011-10-11 14:17:56 +02:00
Günther Deschner
efab0086ba s3-passdb: split out passdb/pdb_tdb.h.
Guenther
2011-10-10 18:40:33 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Günther Deschner
2f36ef7225 s3-passdb: add passdb.h where needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
7a05ca2c9c s3-build: use dbwrap.h only where needed.
Guenther
2010-08-26 00:25:55 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Michael Adam
d498532389 s3:passdb: use transaction_wrapped write in tdbsam_new_rid()
Now all tdb writes in passdb use transactions.

Michael
2009-07-29 16:26:30 +02:00
Michael Adam
ded0ce8345 s3:dbwrap: change dbwrap_change_uint32_atomic() to return NTSTATUS not uint32_t.
Michael
2009-07-29 16:26:21 +02:00
Volker Lendecke
711544d494 Turn the pdb_rid_algorithm into a capabilities call that returns flags 2009-06-28 22:13:50 +02:00
Jeremy Allison
c57b32c5ab Allow pdbedit to change a user rid/sid. Based on a fix from Alexander Zagrebin <alexz@visp.ru>.
Jeremy.
2009-04-01 20:21:02 -07:00
Michael Adam
6edaf6188c s3: fix the fix for bug #6195 - dont let smbd child processes panic
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-04-01 12:26:36 +02:00
Jeremy Allison
0b890ae19a Fix the problem of 3.0.x passdb databases being version
3 but using a different hash calculation than 3.2.x passwd
databases (also version 3). Introduces a minor version
number.
Jeremy.
2009-03-27 21:29:37 -07:00
Jeremy Allison
d942d248d6 Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb 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-27 12:13:13 -07:00
Jeremy Allison
f942cb616e Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb 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-18 15:44:13 -07:00
Alexander Zagrebin
b4ae0e8d84 Missing break in conversion function prevents tdb password database update. 2009-03-17 15:38:33 -07:00
Volker Lendecke
46bcb10b5a Shape up pdb_search a bit by making it a talloc ctx with a destructor 2009-03-07 17:51:21 +01:00
Jeremy Allison
fab0baeed1 Fix bug #6117 - Samba 3.3.0: pdbedit -a core dumps.
Jeremy.
2009-02-17 13:43:58 -08:00
Stefan Metzmacher
7516ba860c s3:pdb_tdb: store the next rid counter in passdb.tdb instead of winbind_idmap.tdb
This upgrades the TDBSAM_VERSION to 4 and SAMU_BUFFER_V4.

metze
2008-12-29 21:10:49 +01:00
Stefan Metzmacher
0544734309 s3:passdb: make marshalling struct samu from and to a buffer more generic
This marshalling isn't specific to tdbsam and it's
ugly to have the related functions in two different files.

metze
2008-12-29 21:10:49 +01:00
Andrew Tridgell
fe3dd9b3e6 fixed lots of places that paniced on a failed transaction_commit,
thinking it was a failure of a transaction cancel
(This used to be commit 22dbe158ed)
2008-08-13 11:54:10 +02:00
Andrew Tridgell
0f41961e4f first cut at adding full transactions for ctdb to samba3
(This used to be commit f91a3e0f7b)
2008-08-13 11:54:08 +02:00
Stefan Metzmacher
625f2d6c23 pdb_tdb: fix the upgrade code, db_traverse returns the number of records!
metze
(This used to be commit baaf571d54)
2008-04-15 00:25:11 +02:00
Stefan Metzmacher
8957f6b0cf pdb_tdb: use != 0 instead off == -1 for dbwrap functions
metze
(This used to be commit d4826a0136)
2008-04-01 14:04:20 +02:00
Stefan Metzmacher
dbd2e3860d pdb_tdb: use db_open_trans()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 9925cc01a2)
2008-03-27 18:14:57 +01:00
Stefan Metzmacher
7d413b8bee pdb_tdb: use db_sam->transaction_start(db_sam) != 0 consistent
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 3bf9ab640e)
2008-03-27 18:14:57 +01:00
Volker Lendecke
88ee949777 Convert pdb_tdb to use dbwrap
(This used to be commit 948ab77863)
2008-03-17 11:51:50 +01:00
Jeremy Allison
aa8818bcc3 Fix CID 469. new_acct can't be NULL here.
Jeremy.
(This used to be commit c79e9414c4)
2008-01-12 00:09:35 -08:00
Michael Adam
df450fc090 Make pdb_tdb honour a private dir overridden in smb.conf.
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 1f96389afa)
2007-12-29 21:38:39 -08:00
Volker Lendecke
40bf6730aa passdb.tdb is located in the private directory
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 c9c7607c40)
2007-12-29 01:01:47 -08:00
Volker Lendecke
e70c97ef85 Remove the sampwent interface
(This used to be commit 9e80b969fb)
2007-12-26 18:57:15 +01:00
Volker Lendecke
533c7c81fe Add tdbsam_search_users
(This used to be commit 02f0b0bd39)
2007-12-26 18:57:14 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
66298d8080 More pstring elimination.
Jeremy.
(This used to be commit 15074de938)
2007-11-20 17:18:16 -08:00
Volker Lendecke
33d8317571 static pstring removal
(This used to be commit 5490e2d772)
2007-11-05 03:16:58 +01:00
Gerald (Jerry) Carter
88ee61625a Patch 2 of 3 from Debian Samba packagers:
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 d6cdbfd875)
2007-11-01 15:53:44 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
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 f35a266b3c)
2007-10-18 17:40:25 -07:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
James Peach
b1ce226af8 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2)
2007-10-10 12:23:23 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00