Matthias Dieter Wallnöfer
5f850af84a
s4:registry - adaptions for "add also a memory context argument for "reg_key_del_abs"
2010-03-22 22:31:03 +01:00
Matthias Dieter Wallnöfer
5b6ad54f43
s4:registry - "util" - add also a memory context argument for "reg_key_del_abs"
2010-03-22 22:31:03 +01:00
Matthias Dieter Wallnöfer
9d8592978e
s4:registry - "util" - make "reg_key_add_abs" consistent with "reg_key_del_abs"
2010-03-22 22:31:02 +01:00
Matthias Dieter Wallnöfer
05d8882a96
s4:registry - "util" - fix up memory allocated data
2010-03-22 22:31:02 +01:00
Matthias Dieter Wallnöfer
96bb09bcf6
s4:registry - "dir.c" - fix up dynamic memory allocation operations
...
- Added free operations where needed
- Use always the "mem_ctx" for temporary data
- Proof with W_ERROR_HAVE_NO_MEMORY if stuff was allocated
2010-03-22 22:31:01 +01:00
Matthias Dieter Wallnöfer
43170dafbc
s4:registry - adaptions for "add memory contexts for delete value/key functions"
2010-03-22 22:31:00 +01:00
Matthias Dieter Wallnöfer
64f51380aa
s4:registry - registry.h - add memory contexts for delete value/key functions
2010-03-22 22:31:00 +01:00
Matthias Dieter Wallnöfer
dd111804f6
s4:registry - "RPC backend" - use "talloc_steal" and not "talloc_reference"
...
No need to create additional references but we need to assign the strings to the
right context.
2010-03-22 14:00:02 +01:00
Matthias Dieter Wallnöfer
43bb87f5fa
s4:registry - "patchfile" - check if strings could be allocated
2010-03-22 13:39:40 +01:00
Matthias Dieter Wallnöfer
686825e025
s4:registry - "patchfile" - initialise the data blobs
2010-03-22 13:33:04 +01:00
Matthias Dieter Wallnöfer
c5b9b25c71
s4:registry - "patchfile" - add more "talloc_free"s to save memory
2010-03-22 13:23:20 +01:00
Matthias Dieter Wallnöfer
885a167929
s4:registry - "util.c" - "reg_string_to_val" - consider always the return values
...
In some cases we didn't consider them.
2010-03-22 12:26:41 +01:00
Matthias Dieter Wallnöfer
6f7f16dc80
s4:registry - "patchfile_preg.c" - also here don't accumulate the memory usage
...
Free always the unused stuff.
2010-03-22 12:26:40 +01:00
Matthias Dieter Wallnöfer
93472b41de
s4:registry - "patchfile_dotreg.c" - fix a memory leak
...
Here we allocate memory on the "NULL" context through "reg_val_data_string" on
each call of "set_value". So when we have written out the allocated data on the
specified file descriptor we should immediately free this memory! Otherwise we
may end up with a big memory consumption on big registry databases.
2010-03-22 12:26:39 +01:00
Matthias Dieter Wallnöfer
5f24bfb7b9
s4:registry - "patchfile" - add comments
...
Helps to understand when we need to generate the hive diffs.
2010-03-22 12:26:29 +01:00
Andrew Bartlett
fe3e1af901
s4:dsdb Rework schema loading and add schema reloading
...
This commit reworks Samba4's schema loading code to detect when it
needs to reload the schema. This is done by watching the @REPLCHANGED
special DN.
The reload happens by means of a callback, which is only set when the
schema is loaded from the ldb - not when loaded from an LDIF file or
DRS.
We also rework the global schema handling - instead of storing the
pointer to the global schema in each ldb, we store a flag indicating
that the global schema should be returned at run time. This makes it
much easier to switch to a new global schema.
Andrew Bartlett
2010-03-22 20:24:41 +11:00
Matthias Dieter Wallnöfer
c8a9533902
s4:registry - "patchfile.c" - consider also the hives in the generated diffs
...
Apparently the diffs for the hives weren't generated previously.
2010-03-22 00:13:02 +01:00
Matthias Dieter Wallnöfer
056d262bb0
s4:registry - "patchfile.c" - fix a typo
2010-03-22 00:02:06 +01:00
Matthias Dieter Wallnöfer
872d2330a4
s4:regtree - fix counter variables to be "unsigned"
2010-03-21 23:41:50 +01:00
Matthias Dieter Wallnöfer
61761cbac8
s4:registry - "LDB backend" - "reg_ldb_unpack_value"
...
When the name isn't found it is the default value. Call it "" to be consistent.
2010-03-21 23:36:09 +01:00
Matthias Dieter Wallnöfer
7b54964a25
s4:registry - "LDB backend" - "reg_key_get_info"
...
Consider also the default value (if it exists) as value. That means:
- count it when setting "num_values"
- take also his buffer length as a candidate for the maximum value buffer length
This is what Windows does.
2010-03-21 23:19:32 +01:00
Matthias Dieter Wallnöfer
773faa5063
s4:registry - "LDB backend" - "ldb_get_default_value"
...
There exist also key objects (the hives) which don't contain a "key" entry at
all. This prevented to display their default value (my fault).
2010-03-21 23:02:31 +01:00
Matthias Dieter Wallnöfer
b7f129f5c4
s4:registry - "LDB backend" - make the key argument "const" of ldb_get_default_value
2010-03-21 22:19:12 +01:00
Matthias Dieter Wallnöfer
ea621efee7
s4:registry - "LDB backend" - fix indentation
2010-03-21 22:04:28 +01:00
Matthias Dieter Wallnöfer
6c39b10f1d
s4:regshell - here we don't need a newline - "ctime" itself provides one
2010-03-21 16:02:36 +01:00
Matthias Dieter Wallnöfer
d4425ecea5
s4:regshell - don't return an error code if we get a security descriptors error
...
s4 itself doesn't support them so print only the error code out (in s4's case
WERR_NOT_SUPPORTED).
2010-03-21 15:56:26 +01:00
Matthias Dieter Wallnöfer
ad83995de5
s4:registry - "LDB backend" - reg_key_get_info - adapt max. subkey and value length
...
Those lengths are measured in UTF8 string lengths and not in UTF16 ones (the
returned strings are generally in this format). Discovered this by checking the
s3 registry code.
Therefore we have to multiply the both numbers by two.
Discovered with the "regedt32" (old NT registry editor).
2010-03-21 15:33:52 +01:00
Matthias Dieter Wallnöfer
cc4e5c8beb
s4:registry - "LDB backend" - don't test for "0" as string termination on binary and unknown typed values
2010-03-21 14:10:17 +01:00
Matthias Dieter Wallnöfer
2f79217964
s4:registry - handle type "DWORD_BIG_ENDIAN" as type "DWORD"
...
Further tests show that (at least per default) there aren't any differences
between them.
2010-03-21 14:03:57 +01:00
Matthias Dieter Wallnöfer
a55031792d
s4:registry - "LDB backend" - fix up memory allocation for dynamic integers
...
We don't need to reserve memory for NULL termination when storing data as
integers.
2010-03-21 14:03:55 +01:00
Matthias Dieter Wallnöfer
1d49a266ab
s4:registry - "LDB backend" - Fix up the storage of binary REG_SZ/REG_EXPAND_SZ values
...
There seem to exist also UTF16 sequences which have byte sizes of a multiple of
two but are invalid (gd's winreg test shows this).
2010-03-21 14:03:23 +01:00
Matthias Dieter Wallnöfer
abe75a5c8c
s4:registry - use a macro for reverse byte order
2010-03-16 09:41:03 +01:00
Andrew Bartlett
2de07761e0
s4:dsdb Change dsdb_get_schema() callers to use new talloc argument
...
This choses an appropriate talloc context to attach the schema too,
long enough lived to ensure it does not go away before the operation
compleates.
Andrew Bartlett
2010-03-16 19:26:03 +11:00
Matthias Dieter Wallnöfer
19aa075642
s4:registry - check also for other registry value types in the generic test
2010-03-16 08:58:32 +01:00
Matthias Dieter Wallnöfer
b7c1444683
s4:registry - add a test for the "REG_DWORD_BIG_ENDIAN" datatype
2010-03-16 08:58:31 +01:00
Matthias Dieter Wallnöfer
2f686d8523
s4:registry - introduce the "REG_DWORD_BIG_ENDIAN" datatype
...
It's like the normal REG_DWORD type but the byte order swapped
2010-03-16 08:58:31 +01:00
Matthias Dieter Wallnöfer
163e559606
s4:registry - rpc - don't crash when communication partner isn't available
2010-03-15 13:44:00 +01:00
Matthias Dieter Wallnöfer
cc3eec1681
s4:registry - util.c - treat unsupported and binary values as the same in the conversion functions
...
We don't need to provide an extra representation for all available registry types.
But if we treat all unsupported types as binary we also get our tools (regtree,
regshell, regdiff...) working with them in a basic manner.
2010-03-15 13:28:12 +01:00
Matthias Dieter Wallnöfer
4e6c0e1f6f
s4:registry - util.c - move the "REG_NONE" case in the conversion functions on top of the switch
...
(As in the "reg_value_types" structure)
2010-03-15 13:27:40 +01:00
Matthias Dieter Wallnöfer
1e5010d353
s4:registry - local testsuite - add a test for REG_QWORD
...
Change also here to fixed-length HEX values output to test for the right
representation.
2010-03-15 13:27:35 +01:00
Matthias Dieter Wallnöfer
00934d4c2f
s4:registry - fix up the output of hexadecimal values
...
Use a fixed-length representation to avoid platform-specific issues.
2010-03-15 13:27:35 +01:00
Matthias Dieter Wallnöfer
80300af278
s4:registry - add support for REG_QWORD values
...
Basically the same as REG_DWORD but these are eight byte long.
2010-03-15 13:27:34 +01:00
Matthias Dieter Wallnöfer
eb8c8a0eca
s4:registry - util.c - add harder checks for inputs on "reg_val_data_string"
...
("NULL" result is error on most data types).
2010-03-14 18:46:23 +01:00
Matthias Dieter Wallnöfer
bb1ac0c75c
s4:registry - ldb.c - provide a mechanism for storing UTF8/binary REG_DWORD values
...
We need to support this as gd's WINREG torture test shows.
2010-03-14 18:46:22 +01:00
Matthias Dieter Wallnöfer
fbce5ded30
s4:registry - ldb.c - provide a mechansim for storing UTF8/binary REG_SZ/REG_EXPAND_SZ values
...
We need to support this as gd's WINREG torture test shows.
2010-03-14 18:46:22 +01:00
Matthias Dieter Wallnöfer
95bfd17e08
s4:registry - ldb.c - fix up a strange LDB filter
2010-03-14 18:46:21 +01:00
Matthias Dieter Wallnöfer
f72790daaa
s4:registry - ldb.c - fix up the memory handling in "reg_ldb_unpack_value"
...
Don't substitute existing data blobs with new ones and make sure, that the
result objects in the data blob don't have memory dependencies of the LDB value
input.
2010-03-14 18:46:21 +01:00
Matthias Dieter Wallnöfer
33eb1c95e5
s4:registry - ldb.c - check more for possible "Out of memory" circumstances
2010-03-14 18:46:21 +01:00
Matthias Dieter Wallnöfer
9b3c45754e
s4:registry - ldb.c - remove superfluous "query" variable
2010-03-14 18:46:21 +01:00
Matthias Dieter Wallnöfer
cd3c870333
s4:registry - ldb.c - Consider result values in "reg_ldb_pack_value"
...
Break on errors and return NULL and otherwise the message pointer.
2010-03-14 18:46:20 +01:00