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

62 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
Volker Lendecke
0d4fc19ac7 s3: Fix a crash in group_mapping.ldb->tdb conversion
When we find a group_mapping.ldb entry without a comment, the upgrade code
would have crashed with a NULL dereference

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Nov 28 12:24:08 CET 2011 on sn-devel-104
2011-11-28 12:24:08 +01:00
Simo Sorce
995d156726 s3-group-mapping: Remove fstrings from GROUP_MAP.
Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Oct 12 19:28:12 CEST 2011 on sn-devel-104
2011-10-12 19:28:12 +02:00
Günther Deschner
a0cbe469bc s3-groupdb: split out groupdb/mapping_tdb.h.
Guenther
2011-10-12 13:51:46 +02:00
Michael Adam
82428adee6 s3:groupdb: convert mapping_tdb.c to use dbwrap wrapper functions only 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
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
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Jeremy Allison
f7b3909103 A couple more off-by-one calculations with strlcpy.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May  6 18:39:17 CEST 2011 on sn-devel-104
2011-05-06 18:39:17 +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
4dbd743e46 s3-util_sid: use shared dom_sid_compare_auth and dom_sid_equal_X functions.
Guenther
2010-09-20 14:04:37 -07:00
Andrew Bartlett
4bf783d4d6 s3-auth Change type of num_sids to uint32_t
size_t is overkill here, and in struct security_token in the num_sids
is uint32_t.

This includes a change to the prototype of add_sid_to_array()
and add_sid_to_array_unique(), which has had a number of
consequnetial changes as I try to sort out all the callers using
a pointer to the number of sids.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10: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
Volker Lendecke
8693ae741c s3: Fix a typo 2010-04-14 21:50:00 +02:00
Volker Lendecke
0e9844c70a s3: Fix some C++ warnings 2010-03-02 14:29:43 +01:00
Volker Lendecke
2330b625cc s3: Fix an uninitialized variable warning 2010-03-02 14:29:43 +01:00
Simo Sorce
be026a6fd8 s3:groupmap revert to tdb storage
Group mapping needs to be cluster aware, and this means using the tdb backend.
Remove ldb group mapping as this is not cluster aware.
2010-03-01 16:09:58 -05:00
Volker Lendecke
a51e6ce43c Pass a talloc_ctx to pdb_enum_aliasmem 2009-06-08 21:14:10 +02:00
Stefan Metzmacher
0ee4d20adb s3:mapping_tdb: fix the del_aliasmem() function
We should not cancel the transaction, when we want to delete a key.

metze
2008-09-29 16:36:10 +02: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
Günther Deschner
968c91b883 Fix build warning.
Thanks to Thorkil Olesen.

Guenther
(This used to be commit 3130aa63fd)
2008-07-03 11:10:21 +02:00
Stefan Metzmacher
aaf61d9ae4 groupdb: make mapping_tdb compatible to mapping_ldb
mapping_ldb replaces the record if it already exists.
I'm not sure if that a good thing, but for now
both backends should provide the same behavior.

metze
(This used to be commit b313acdd31)
2008-04-12 10:01:42 +02:00
Michael Adam
2478949821 mapping_tdb: fix enumeration of mappings.
db->traverse_read returns the number of traversed object on success.

Michael
(This used to be commit 2be2188a97)
2008-04-04 17:05:00 +02:00
Michael Adam
1b3f36b2b5 mapping.tdb: fix creation of entries with GROUP_PREFIX
Macro is no expanded inside literal string.

Michael
(This used to be commit 872a3d3d38)
2008-04-04 16:47:51 +02:00
Volker Lendecke
16198dc51e Convert dbwrap_trans_delete to NTSTATUS
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit dead193f46)
2008-04-01 14:04:22 +02:00
Volker Lendecke
fcdfff1cc8 Convert dbwrap_trans_store to NTSTATUS
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 5f4de856af)
2008-04-01 14:04:22 +02:00
Stefan Metzmacher
e144a8b15f mapping_tdb: use the correct sid for the key creation
metze
(This used to be commit 0d221a3f0a)
2008-04-01 14:04:21 +02:00
Stefan Metzmacher
a114125f89 mapping_tdb: use db_open_trans()
metze
(This used to be commit 16d18df0d0)
2008-04-01 14:04:21 +02:00
Volker Lendecke
04ab839170 Protect group_mapping.tdb ops with transactions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit d702ed73c1)
2008-04-01 14:04:21 +02:00
Volker Lendecke
bfb001526f Fix a segfault
(This used to be commit 40d1d64c6a)
2008-03-28 14:12:34 +01:00
Michael Adam
f1c844c168 util_tdb: remove trivial and unused tdb_wipe().
It has been replaced by tdb_wipe_all().

Michael
(This used to be commit cdde2e4eac)
2008-03-26 11:15:03 +01:00
Michael Adam
aaa5971315 util_tdb: add a wrapper tdb_wipe() for traverse with tdb_traverse_delete_fn().
Replace all callers of traverse with this tdb_traverse_delete_fn() and
don't export tdb_traverse_delete_fn() anymore.

Michael
(This used to be commit d4be4e30cd)
2008-03-25 15:55:34 +01:00
Volker Lendecke
27c07c9861 Convert mapping_tdb.c to dbwrap
I know, this is not used anymore, but until ldb knows about ctdb which is
blocked by the lack of transactions in ctdb, a tiny patch reactivating
mapping_tdb.c might be needed for cluster setups.
(This used to be commit 8e0fa453a3)
2008-03-11 17:21:28 +01:00
Volker Lendecke
0e5d6c0d27 Clean up add_mapping_entry slightly
(This used to be commit 38bb69cb31)
2008-03-11 17:09:20 +01:00
Volker Lendecke
41bea30dd8 Cleanup after pstring removal
(This used to be commit 66d2a9c874)
2008-03-11 17:09:19 +01:00
Jeremy Allison
ddabc2b00c Fix "status used uninitialized" warnings.
Jeremy.
(This used to be commit e57856fff2)
2008-01-15 15:09:13 -08:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef)
2008-01-09 01:47:10 +01:00
Michael Adam
f168fac54c Don't leak data.dptr on error path.
Michael
(This used to be commit d14de0692c)
2008-01-09 01:47:10 +01:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
2007-12-15 22:47:30 +01:00
Volker Lendecke
14ef4cdec1 Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.
(This used to be commit c7c885078b)
2007-12-15 22:09:37 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Volker Lendecke
43473c8ded Fix a segfault
sid_to_string still expects a fstring
(This used to be commit 1f352cdd19)
2007-12-15 09:13:56 -08:00