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

99 Commits

Author SHA1 Message Date
Michael Adam
8d19ac7474 s3:registry: wrap reg_deletevalue() in a transaction
This is at the wrong layer, but if fixes a race potentially causing
data corruption by concurrent access.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
97bf05871a s3:registry: untangle assignment from check in reg_deletevalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
8ddc2aa0e1 s3:registry: fix race in reg_setvalue that could lead to data corruption
(there was no lock around fetching the values and storing them)

The layering is wrong in that it uses regdb transactions in reg_api

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
705ea5b8c2 s3:registry: untangle assignment from check and add a debugmessage in reg_setvalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
04aa303fb1 s3:registry: don't leak the old contents when updating the value cache
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
6c016734aa s3:registry:reg_api: fix reg_queryvalue to not fail when values are modified while it runs
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:23:05 +02:00
Michael Adam
689f42af29 s3:registry: enhance debugging of deletekey_recursive
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Aug 15 19:34:44 CEST 2011 on sn-devel-104
2011-08-15 19:34:44 +02:00
Gregor Beck
356ed8644c s3:registry avoid updating keys which are going to be deleted in
reg_deletekey_recursive

this changes the complexity from O(n^2) to O(n) and reduces the time of
a 'net conf drop' with 10000 shares from 6min to 1.5s

Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-08 15:27:07 +02:00
Gregor Beck
7e3d7505dd s3:registry avoid leaking an old regsubkey_ctr on regsubkey_ctr_init
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-14 21:48:12 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
da662b82b8 s3-lib Replace StrnCaseCmp() with strncasecmp_m()
strncasecmp_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
Günther Deschner
fa8471a616 s3-registry: remove some unused headers.
Guenther
2011-03-18 13:22:07 +01:00
Volker Lendecke
4b354e67fc s3-amend: Don't overwrite existing values
This saves a ton of tdb transactions on smbd startup

Andreas, Günther, please check!

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Feb 15 19:11:25 CET 2011 on sn-devel-104
2011-02-15 19:11:25 +01:00
Michael Adam
b1f800a0d1 s3:registry: in deletekey_recursive, fix return code upon error.
correctly keep the werr from inside the transaction when the opearation
inside the transaction fails.

What is the correct behaviour if the cancel operation fails?
2011-01-30 14:09:04 +01:00
Michael Adam
7a25d13742 s3:registry: remove unneeded TALLOC_CTX argument from reg_deletekey_recursive 2010-09-22 06:30:01 +02:00
Michael Adam
b11cc30508 s3:registry: move the reg_api prototypes to their own header. 2010-09-21 08:52:06 +02:00
Michael Adam
e4eda5f9bc s3:registry:reg_api: update (C) 2010-09-21 08:52:05 +02:00
Michael Adam
8eb487caba s3:registry: move (commented out) hilvl util functions to reg_api_util.c 2010-09-20 19:58:01 +02:00
Michael Adam
0f7e503d21 s3:registry: move higher level function reg_open_path to new module reg_api_util
The reg_api.c code should just export functions that direclty relate to winreg
api calls.
2010-09-20 19:58:01 +02:00
Günther Deschner
91e8f8ded2 s3-registry: move regf based reg_api calls into own file.
Guenther
2010-09-20 02:27:41 +02:00
Günther Deschner
323f729df0 s3-registry: add reg_querymultiplevalues to reg_api matching table.
Guenther
2010-09-20 02:27:41 +02:00
Andrew Bartlett
4bfc8d3b1a s3-auth Change struct nt_user_token -> struct security_token
This common structure is defined in security.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10:00
Günther Deschner
786198e523 s3-registry: remove unused reg_util_marshalling code.
Guenther
2010-07-02 10:50:21 +02:00
Günther Deschner
b381fba089 s3-registry: avoid using registry_value union.
Just pull and push data as is.

Guenther
2010-07-02 10:50:21 +02:00
Günther Deschner
74721bf706 s3-registry: fix malloc/talloc mismatch upon free in reg_enumvalue().
Guenther
2010-07-01 01:22:11 +02:00
Günther Deschner
21869f5ed0 s3-registry: add reg_querymultiplevalues() to reg_api.
Guenther
2010-06-30 21:46:08 +02:00
Andreas Schneider
15bacaf3c5 s3-registry: Convert registry key delimiter from slash to backslash.
This is needed to support keynames containing a '/' like TCP/IP. Which
is used in serveral standard paths.

Signed-off-by: Michael Adam <obnox@samba.org>
2010-06-25 17:35:41 +02:00
Günther Deschner
f9f8007361 s3-build: only use ndr_security.h where needed.
Guenther
2010-05-31 11:32:37 +02:00
Michael Adam
0fe1ff99a1 s3:registry: move reg_objects.h to registry/ and use it only where needed
Every place outside of registry/ where this is used, should probably
be changed to use pure reg_api.c code.
2010-05-25 10:35:31 +02:00
Michael Adam
0d20053f10 s3:registry: use regval_ctr/blob accessor functions in reg_api.c 2010-05-25 10:35:28 +02:00
Michael Adam
e829b42978 s3:registry: extract registry_pull/push_value prototypes into own header
reg_util_marshalling.h and use them only where needed.
2010-05-25 10:35:27 +02:00
Michael Adam
773255ba50 s3:registry: rename reg_util.{c,h} to reg_util_internal.{c,h} 2010-05-25 10:35:27 +02:00
Michael Adam
b94267aa3f s3:registry: extraxt the reg_dispatcher prototypes into their own header.
And use them only where needed.
2010-05-25 10:35:26 +02:00
Michael Adam
d335f292ce s3:registry: extract the reg_backend_db prototypes into their own header.
And use them only where needed.
2010-05-25 10:35:25 +02:00
Michael Adam
9ccf66379a s3:registry: adapt callers of regval_ctr_addvalue to uint8 * instead of char * 2010-05-25 10:35:25 +02:00
Michael Adam
4ae77b2ef9 s3:registry: extract the reg_util prototypes into their own header.
And use them only where needed.
2010-05-25 10:35:25 +02:00
Michael Adam
14a025062e s3:registry: extract the reg_cachehook prototypes into their own header.
And use them only where necessary.
2010-05-25 10:35:24 +02:00
Günther Deschner
7f6bb48bdf s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".
Guenther
2010-05-18 12:30:12 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Günther Deschner
fe31b67d5e s3-registry: only include registry headers when really needed.
Guenther
2010-05-18 01:15:38 +02:00
Volker Lendecke
5552b44960 s3: Fix some nonempty blank lines 2010-02-07 12:29:25 +01:00
Michael Adam
e935d8616b s3:registry: replace typedef REGISTRY_OPS by struct registry_ops
Michael
2009-04-27 11:21:04 +02:00
Michael Adam
cec8428747 s3:registry: replace typedef REGISTRY_KEY by struct registry_key_handle
Michael
2009-04-27 11:21:04 +02:00
Michael Adam
221151a2a2 s3:registry: replace typedef REGVAL_CTR by struct regval_ctr.
This paves the way for hiding the typedef and the implementation
from the surface.

Michael
2009-04-27 11:21:02 +02:00
Günther Deschner
38264bb3b8 s3-secdesc: move all winreg access bits to IDL.
Guenther
2009-04-21 12:42:51 +02:00
Michael Adam
8c023fea86 s3:registry: Prevent creation of keys containing the '/' character.
This creates a broken registry that can only be fixed with
tdbtool, since the '/' sign is used as a key separator after
normalization at a lower level.

This makes e.g. "net conf setparm abc/def comment xyz" fail with
WERR_INVALID_PARAM, which is much more desirable than a broken
registry.tdb.

Michael
2009-04-17 11:46:14 +02:00
Michael Adam
2f4b821320 s3:registry: tighten the subkey loop in reg_deletekey_recursive()
and loop from the end to the beginning so that we don't need
to rehash the subkeys...

This gets "net conf drop" with 2000 shares down to 14 seconds
on my box.

Michael
2009-02-26 13:22:56 +01:00
Michael Adam
270ab5544b s3:registry: use delete_reg_subkey() in reg_deletekey()
This further speeds up net conf drop.

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
741e902888 s3:registry: streamline reg_deletekey() somewhat.
use W_ERROR_... macros and separate assignments from checks

Michael
2009-02-26 13:22:55 +01:00
Michael Adam
4b444e4ac4 s3:registry: use create_reg_subkey() in reg_createkey().
Instead of calling store_reg_keys()

On my box, importing 2000 shares into an empty smbconf key
now takes some 32 seconds.

Michael
2009-02-26 13:22:55 +01:00