1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

88 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
828b033345 Registry server LDB backend REG_SZ type: Always use UTF8 encoding
We should save data OS independent in the LDB files.
2008-10-21 14:40:42 +02:00
Matthias Dieter Wallnöfer
47868196b8 Registry server LDB backend REG_SZ type: Fix up the empty string problem
This fixes up the empty string problem in a better way without the need of changing the character conversion code.
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
f10227958b Registry server: Fixes up the patch with "type" != NULL (used in "EnumValue" and "QueryValue")
This prevents the server to segfault if the input data type is NULL.
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
083785c091 Registry server "reg_ldb_unpack_value": Tests demonstrate that also "type" doesn't has to be NULL 2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
c26cb44e03 Revert "Registry server "reg_ldb_unpack_value": Let "data" pointer be NULL"
This reverts commit 82f50ea69f3aece4ac654ffdfa627babd8aadc25.
Cause: Windows (2000) doesn't accept the "data" pointer set to NULL
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
b23c3c24c2 Registry server "reg_ldb_unpack_value": Let "data" pointer be NULL
Prevent segfaults in some client applications (e.g. regdiff)
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
ac4808c11f Cleanups of server files
Cosmetic corrections
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
e23e997644 Registry server: More work to be compatible
Some fixup's and assure, that we send only initialized values.
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
f58f74949d ldb_get_value_by_id: Fix the return of the default value
The return of the values of a certain key has been broken since I've introduced the default value.
Now the behaviour is correct: If no default value exists, start with index zero to fetch the other values. Otherwise let zero be the default value and enumerate the others starting with one.
2008-10-21 14:40:41 +02:00
Matthias Dieter Wallnöfer
036b650ee4 reg_ldb_unpack_value: Change "CH_UTF8" in "CH_UNIX"
It's better to use "CH_UNIX" for unpacking, because the system charset doesn't have to be UTF8 and we should be compatible with "reg_ldb_pack_value".
2008-10-21 14:40:40 +02:00
Matthias Dieter Wallnöfer
1938cb1e83 ldb_del_value: Free key data also when removing the default attribute 2008-10-21 14:40:40 +02:00
Matthias Dieter Wallnöfer
ad778c00e7 Fix for allowing the REG_BINARY type and introducing the default attribute
The REG_BINARY type is converted and stored in the LDB database as a leaf object with string-data.
The default attribute is saved directly in the hive object as the "data"-string.
2008-10-21 14:40:40 +02:00
Simo Sorce
508527890a Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.
The previous ldb_search() interface made it way too easy to leak results,
and being able to use a printf-like expression turns to be really useful.
2008-09-23 18:17:46 -04:00
Jelmer Vernooij
21fc767378 Specify event_context to ldb_wrap_connect explicitly.
(This used to be commit b4e1ae07a284c044704322446c94351c2decff91)
2008-04-17 12:23:44 +02:00
Jelmer Vernooij
c7dc53b851 Merge branch 'v4-0-test' into id10ts-registry
(This used to be commit f98b59021a5ea39c7970ebc5520d17775e500b8c)
2008-03-03 00:23:09 +01:00
Andrew Kroeger
7dac0598ec registry: Implement recursive deletes for ldb-backed registry.
When deleting a registry key that contains subkeys or values, Windows performs a
recursive deletion that removes any subkeys or values.  This update makes
deletes for an ldb-backed registry consistent with Windows.

Under ldb, the deletion is done using an explicit transaction.  If an error
occurs during the deletion the entire transaction is cancelled, leaving the
registry as it was before the deletions started.
(This used to be commit ca796c8fb10598674a5eef31d15863e79bcf3db8)
2008-02-26 19:27:14 -06:00
Jelmer Vernooij
10169a2030 Remove more global_loadparm instance.s
(This used to be commit a1280252ce924df69d911e597b7f65d8038abef9)
2008-02-21 17:54:24 +01:00
Jelmer Vernooij
7a402da97e registry: Fix warning.
(This used to be commit dad809030478a85ac13a73bce9c07314792f01c2)
2008-02-09 17:18:51 +01:00
Jelmer Vernooij
55ad09a01b registry: Use correct return values.
(This used to be commit 98ebdbe52fd615ea62a3caa17acfe8bb31b8f85d)
2008-01-18 03:42:00 +01:00
Andrew Kroeger
e490415e2e When Windows attempts to create a new key, it looks for an available key name
starting with "New Key #1" and iterating up to "New Key #99" before giving up.
ldb_open_key() calls reg_path_to_ldb() to build the appropriate dn from the key
name.  reg_path_to_ldb() was not catching the error returned by
ldb_dn_add_base_fmt() due to the unescaped '#' character, causing the returned
dn to be that of the parent key, not the potential new key.  Additionally,
Windows expects a return value of WERR_BADFILE when a key does not exist, but
WERR_NOT_FOUND was being returned instead.  Correcting the building of the dn
and the providing the expected return value allows new key creation to succeed.

When attempting to delete a key, Windows passes the complete path to the key,
not just the name of the child key to be deleted.  Using reg_path_to_ldb() to
build the correct dn allows key deletion to succeed.
(This used to be commit d57792d67b865ef43e7f21640b158862627f4b45)
2008-01-18 03:41:59 +01:00
Jelmer Vernooij
85d60d2d09 registry: Improve error codes and update tests.
Rather than map the error returned by the registry to the correct error,
return the correct error in the first place.

Also deal with the fact that the right error code is now returned in a
couple of places.
(This used to be commit 1e31fcb8a097810a97e2d4bb1f243f1b34cc2415)
2008-01-18 03:41:59 +01:00
Andrew Kroeger
4d8a60f617 When Windows initially creates a new value, the value name is "New Value #1".
The '#' character was causing problems, as it was not being escaped for the dn,
but the failure returned by ldb_dn_add_child_fmt() was not being caught.  This
was causing the new value to be added on the parent key, not the current key.
When attempting to delete the new value (now on the parent key) the same
escaping error was returned by ldb_dn_add_child_fmt(), causing the delete to
delete the key and not the value.

When attempting to rename a value, Windows first tries to ensure the new name
does not already exist.  When a value does not exist, Windows expects a return
value of WERR_BADFILE, but WERR_NOT_FOUND was being returned instead.
Providing the WERR_BADFILE that Windows expects allows values to be renamed.
(This used to be commit 94fb39cfd967455ce5a554720c1c7e6183f91056)
2008-01-18 03:41:59 +01:00
Andrew Kroeger
158a2eed33 registry: Properly check return values from ldb_*() functions.
There were a few cases left that attempted to detect errors from ldb_*()
function calls using "(ret < 0)".  As all LDB_* error codes are greater than
zero, there was no chance any errors would be detected.  Changed all such tests
to use "(ret != LDB_SUCCESS)".
(This used to be commit 0ed6f1b1628da5b922f02a5f9a6c60071b6277f2)
2008-01-18 03:41:59 +01:00
Jelmer Vernooij
73626c266c registry: Check for more specific LDB return codes, handle changing existing values better.
(This used to be commit c8b22ef30c7fc0ccc15e9fc9a38fdc639fc4b976)
2008-01-18 03:41:59 +01:00
Jelmer Vernooij
83a7d865e4 r26692: registry: Treat key and value names case-insensitively.
(This used to be commit 9fc5f098e01145db5b01efb0bf22cdddf0213d20)
2008-01-07 17:48:02 -06:00
Jelmer Vernooij
47f6bbf8cf r26689: registry: Return max_subkeynamelen, max_valnamelen and max_valbufsize in getkeyinfo().
(This used to be commit b06896d2378e536f5044dbe500a5232a89d6d0b5)
2008-01-07 08:18:07 -06:00
Jelmer Vernooij
12a513b47b r26518: Fix provision of registry using Python.
(This used to be commit 12eb38e553993b2726a803af4ae9c05229d6ebe4)
2007-12-21 05:51:25 +01:00
Kai Blin
45015eda24 r26451: Janitorial: fix warnings in lib/registry/
This does not fix the discarded qualifier warnings in tests, as the test data
is currently passed as const. Jelmer wants to provide a test function that
passes non-const test data, thus allowing for a cleaner way to fix those
warnings.
(This used to be commit 46dfa63d4f7381c5c6ce3f4b8b0bd9aa9e16950c)
2007-12-21 05:50:16 +01:00
Jelmer Vernooij
96a200511e r26443: Remove global_loadparm instances.
(This used to be commit 8242c696235d1bfb402b5c276a57f36d93610545)
2007-12-21 05:50:11 +01:00
Jelmer Vernooij
d891c0c74a r26429: Avoid use of global_smb_iconv_convenience.
(This used to be commit d37136b7abfbba75ef2e5ab855eb3382b9648b8c)
2007-12-21 05:49:56 +01:00
Jelmer Vernooij
39ee38d9c1 r26316: Use contexts for conversion functions.
(This used to be commit f6420d933b5b011d428974f3a2a57edf19e6f482)
2007-12-21 05:48:30 +01:00
Jelmer Vernooij
cb7c72a0ef r26263: Don't assume CH_UNIX is CH_UTF8.
(This used to be commit 69157be9b180e4d82a66257afb5f774ef16cea89)
2007-12-21 05:47:37 +01:00
Jelmer Vernooij
ca0b72a1fd r26003: Split up DB_WRAP, as first step in an attempt to sanitize dependencies.
(This used to be commit 56dfcb4f2f8e74c9d8b2fe3a0df043781188a555)
2007-12-21 05:45:40 +01:00
Günther Deschner
cc8f4eb3cd r25544: Cleanup some more indents in lib/registry.
Guenther
(This used to be commit 0d9826dc54057db2cfebcb806e5442c4dcf60daa)
2007-10-10 15:07:51 -05:00
Jelmer Vernooij
2f3551ca7c r25446: Merge some changes I made on the way home from SFO:
2007-09-29 More higher-level passing around of lp_ctx.
2007-09-29 Fix warning.
2007-09-29 Pass loadparm contexts on a higher level.
2007-09-29 Avoid using global loadparm context.
(This used to be commit 3468952e771ab31f90b6c374ade01c5550810f42)
2007-10-10 15:07:34 -05:00
Jelmer Vernooij
033c2c07a3 r24898: Fix LOCAL-REGISTRY, do not silently ignore testcase setup failures.
(This used to be commit 527ea7fccf4ace9cd9cbacf49820ecd208b8d570)
2007-10-10 15:03:33 -05:00
Jelmer Vernooij
6ca1390269 r24684: Be a bit less verbose
(This used to be commit 7a7af62dc4485d832436ed39dfba41b417ec2b10)
2007-10-10 15:02:42 -05:00
Jelmer Vernooij
b409d4120f r24667: Finally merge the registry improvements that Wilco Baan Hofman and I have
been working on for at least half a year now. Contains the following
improvements:

 * proper layering (finally!) for the registry library. Distinction is
   now made between 'real' backends (local, remote, wine, etc) and
   the low-level hive backends (regf, creg, ldb, ...) that are only used
   by the local registry backend
 * tests for all important hive and registry operations
 * re-enable RPC-WINREG tests (still needs more work though, as
							   some return values aren't checked yet)
 * write support for REGF files
 * dir backend now supports setting/reading values, creating keys
 * support for storing security descriptors
 * remove CREG backend as it was incomplete, didn't match the data model
   and wasn't used at all anyway
 * support for parsing ADM files as used by the policy editor (see lib/policy)
 * support for parsing PREG files (format used by .POL files)
 * new streaming interface for registry diffs (improves speed and memory usage
	for regdiff/regpatch significantly)

   ... and fixes a large number of bugs in the registry code
(This used to be commit 7a1eec6358bc863dfc671c542b7185d3e39d7b5a)
2007-10-10 15:02:34 -05:00