summaryrefslogtreecommitdiff
path: root/source4/lib/registry/ldb.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-10s4:registry/ldb.c - if "name" isn't set we should return WERR_INVALID_PARAMMatthias Dieter Wallnöfer1-1/+5
2010-03-10s4:lib/registry/ldb.c - fix up registry backend to be more robustMatthias Dieter Wallnöfer1-9/+5
This should let the new WINREG tests written by gd at least pass against us.
2010-03-06s4:lib/registry/ldb.c - fix trailing whitespacesMatthias Dieter Wallnöfer1-6/+6
2010-03-06s4:registry library - fix up "reg_ldb_set_value"Matthias Dieter Wallnöfer1-9/+23
The previous logic was wrong since it tried to add empty data in some cases which always ended in an error. This problem should be fixed with the new logic.
2010-03-06s4:registry library - make "reg_ldb_pack/unpack_value" more robustMatthias Dieter Wallnöfer1-28/+35
This to prevent segmentation faults, wrong server inputs ecc.
2010-03-06s4:libregistry - change counters to be "unsigned"Matthias Dieter Wallnöfer1-6/+7
Also the s4 registry library has to have "unsigned" counters like the Windows one.
2010-02-22Spelling fixes for source4/lib/registry.Brad Hards1-1/+1
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-07s4-registry: fixed byte order assumptionsAndrew Tridgell1-1/+2
the registry tests were broken on big-endian systems
2009-10-23s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()Andrew Tridgell1-1/+1
This allows us to reuse a ldb context if it is open twice, instead of going through the expensive process of a full ldb open. We can reuse it if all of the parameters are the same. The change relies on callers using talloc_unlink() or free of a parent to close a ldb context.
2009-03-01s4: Use same function signature for convert_* as s3.Jelmer Vernooij1-4/+4
2009-03-01Add allow_badcharcnv argument to all conversion function, forJelmer Vernooij1-2/+2
consistency with Samba 3.
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-1/+1
list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
2008-10-24Remove more uses of global_loadparm.Jelmer Vernooij1-8/+4
2008-10-24Remove iconv_convenience argument from convert_string{,talloc}() butJelmer Vernooij1-2/+2
make them wrappers around convert_string{,talloc}_convenience().
2008-10-21Fix double free.Jelmer Vernooij1-1/+0
2008-10-21Fix the build.Jelmer Vernooij1-2/+2
2008-10-21Revert "Registry server LDB backend: Don't make copies of the same type"Jelmer Vernooij1-2/+2
The original data pointer may go away so we do want to make copies in this case. This reverts commit 625359b2e266105022309df8985720108ecd6f67.
2008-10-21Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrvJelmer Vernooij1-9/+10
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
2008-10-21Registry server LDB backend: Don't make copies of the same typeMatthias Dieter Wallnöfer1-2/+2
2008-10-21Registry server LDB backend REG_BINARY type: Save it directly in LDBMatthias Dieter Wallnöfer1-3/+5
With this patch the REG_BINARY type is saved directly in a LDB registry database rather than converted in a hex-string.
2008-10-21Registry server LDB backend REG_SZ type: Always use UTF8 encodingMatthias Dieter Wallnöfer1-2/+2
We should save data OS independent in the LDB files.
2008-10-21Registry server LDB backend REG_SZ type: Fix up the empty string problemMatthias Dieter Wallnöfer1-5/+15
This fixes up the empty string problem in a better way without the need of changing the character conversion code.
2008-10-21Registry server: Fixes up the patch with "type" != NULL (used in "EnumValue" ↵Matthias Dieter Wallnöfer1-2/+3
and "QueryValue") This prevents the server to segfault if the input data type is NULL.
2008-10-21Registry server "reg_ldb_unpack_value": Tests demonstrate that also "type" ↵Matthias Dieter Wallnöfer1-2/+2
doesn't has to be NULL
2008-10-21Revert "Registry server "reg_ldb_unpack_value": Let "data" pointer be NULL"Matthias Dieter Wallnöfer1-27/+23
This reverts commit 82f50ea69f3aece4ac654ffdfa627babd8aadc25. Cause: Windows (2000) doesn't accept the "data" pointer set to NULL
2008-10-21Registry server "reg_ldb_unpack_value": Let "data" pointer be NULLMatthias Dieter Wallnöfer1-23/+27
Prevent segfaults in some client applications (e.g. regdiff)
2008-10-21Cleanups of server filesMatthias Dieter Wallnöfer1-1/+5
Cosmetic corrections
2008-10-21Registry server: More work to be compatibleMatthias Dieter Wallnöfer1-14/+25
Some fixup's and assure, that we send only initialized values.
2008-10-21ldb_get_value_by_id: Fix the return of the default valueMatthias Dieter Wallnöfer1-14/+15
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-21reg_ldb_unpack_value: Change "CH_UTF8" in "CH_UNIX"Matthias Dieter Wallnöfer1-1/+1
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-21ldb_del_value: Free key data also when removing the default attributeMatthias Dieter Wallnöfer1-4/+4
2008-10-21Fix for allowing the REG_BINARY type and introducing the default attributeMatthias Dieter Wallnöfer1-45/+128
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-09-23Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.Simo Sorce1-10/+14
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-04-17Specify event_context to ldb_wrap_connect explicitly.Jelmer Vernooij1-1/+2
(This used to be commit b4e1ae07a284c044704322446c94351c2decff91)
2008-03-03Merge branch 'v4-0-test' into id10ts-registryJelmer Vernooij1-5/+9
(This used to be commit f98b59021a5ea39c7970ebc5520d17775e500b8c)
2008-02-26registry: Implement recursive deletes for ldb-backed registry.Andrew Kroeger1-27/+116
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-21Remove more global_loadparm instance.sJelmer Vernooij1-5/+9
(This used to be commit a1280252ce924df69d911e597b7f65d8038abef9)
2008-02-09registry: Fix warning.Jelmer Vernooij1-1/+1
(This used to be commit dad809030478a85ac13a73bce9c07314792f01c2)
2008-01-18registry: Use correct return values.Jelmer Vernooij1-7/+28
(This used to be commit 98ebdbe52fd615ea62a3caa17acfe8bb31b8f85d)
2008-01-18When Windows attempts to create a new key, it looks for an available key nameAndrew Kroeger1-7/+13
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-18registry: Improve error codes and update tests.Jelmer Vernooij1-3/+6
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-18When Windows initially creates a new value, the value name is "New Value #1".Andrew Kroeger1-2/+22
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-18registry: Properly check return values from ldb_*() functions.Andrew Kroeger1-3/+3
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-18registry: Check for more specific LDB return codes, handle changing existing ↵Jelmer Vernooij1-6/+11
values better. (This used to be commit c8b22ef30c7fc0ccc15e9fc9a38fdc639fc4b976)
2008-01-07r26692: registry: Treat key and value names case-insensitively.Jelmer Vernooij1-0/+10
(This used to be commit 9fc5f098e01145db5b01efb0bf22cdddf0213d20)
2008-01-07r26689: registry: Return max_subkeynamelen, max_valnamelen and ↵Jelmer Vernooij1-3/+49
max_valbufsize in getkeyinfo(). (This used to be commit b06896d2378e536f5044dbe500a5232a89d6d0b5)
2007-12-21r26518: Fix provision of registry using Python.Jelmer Vernooij1-1/+1
(This used to be commit 12eb38e553993b2726a803af4ae9c05229d6ebe4)
2007-12-21r26451: Janitorial: fix warnings in lib/registry/Kai Blin1-1/+1
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-21r26443: Remove global_loadparm instances.Jelmer Vernooij1-0/+1
(This used to be commit 8242c696235d1bfb402b5c276a57f36d93610545)
2007-12-21r26429: Avoid use of global_smb_iconv_convenience.Jelmer Vernooij1-2/+2
(This used to be commit d37136b7abfbba75ef2e5ab855eb3382b9648b8c)