Wilco Baan Hofman
cb670f366c
Revert "s4:registry - adaptions for "add memory contexts for delete value/key functions""
...
This reverts commit 43170dafbcbe7464bce9b4c6d76532d7d0bf5b9a.
Conflicts:
source4/lib/registry/dir.c
source4/lib/registry/util.c
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-03-29 18:43:59 +02:00
Wilco Baan Hofman
f8e67f198a
Revert "s4:registry - "util" - make "reg_key_add_abs" consistent with "reg_key_del_abs""
...
This reverts commit 9d8592978e28c492d971a3b5a4c0133febc149ea.
Conflicts:
source4/lib/registry/util.c
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-03-29 18:43:59 +02:00
Wilco Baan Hofman
d90f1a7146
Revert of commit 5b6ad54f43741c0c25b35e44cafe5fed352ff133 in registry.h
...
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-03-29 18:43:59 +02:00
Wilco Baan Hofman
541e2942f8
Remove incorrect const, something that was correct in commit 9c3e6249fd984b823a77cab0514601d2a487920a
...
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-03-29 18:43:59 +02:00
Wilco Baan Hofman
3629798f72
Revert "s4:registry - "util" - remove "const" from "reg_abs_path""
...
This reverts commit 9c3e6249fd984b823a77cab0514601d2a487920a.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-03-29 18:43:59 +02:00
Andrew Tridgell
7ed349cace
pytalloc: allow for using a system libtalloc-dev with pytalloc
...
When we have a system talloc library, we still need to grab pytalloc.h
from lib/talloc. We don't want to just use -Ilib/talloc, as otherwise
we'll get the in-tree talloc.h which may not be compatible with the
system talloc.h
So we need to give the path to pytalloc.h
2010-03-29 21:34:29 +11:00
Andrew Tridgell
088096d1ba
python: use '#!/usr/bin/env python' to cope with varying install locations
...
this should be much more portable
2010-03-25 14:37:19 +11:00
Matthias Dieter Wallnöfer
3a2488870f
s4:registry - "reg_ldb_pack_value" - provide workarounds when the server receives non-standard data.
...
For now we reset/delete the "data" attribute. Anyway there is the need to find
a better solution (we probably want to change the format and save all data as
we got it like Windows itself does).
These workarounds are needed since for example the Windows 2000 Registry Editor
initialises empty REG_SZ strings with content '\0' and length 1 (not a valid
UTF16 sequence - "convert_string_talloc" breaks). So we simply reset/delete the
"data" attribute which works (no content).
2010-03-23 16:46:17 +01:00
Matthias Dieter Wallnöfer
0426b5b786
s4:registry - "LDB backend" - fix indentation
2010-03-23 16:46:17 +01:00
Matthias Dieter Wallnöfer
a6f5e495b1
s4:registry - "LDB backend" - revert the length check for UTF16 strings
...
Let this do the "convert_string_talloc" function as it was before.
2010-03-23 00:26:01 +01:00
Matthias Dieter Wallnöfer
bca353561e
s4:registry - "LDB backend" - revert the binary storage of "REG_SZ", "REG_DWORD" and "REG_QWORD"
...
We agreed that this hack isn't the best of the possible solutions.
2010-03-23 00:16:19 +01:00
Matthias Dieter Wallnöfer
c69afbbfd0
s4:registry - "reg_key_del/add_abs": call "talloc_free" only on valid objects
2010-03-22 22:38:45 +01:00
Matthias Dieter Wallnöfer
12f42e35bc
s4:registry - "reg_import_hive_key" - change a "talloc_steal" into a "talloc_reference"
...
Use a "talloc_reference" since the "hive" variable can continue to exist also
after the destructed "struct local_key" object. It is also referenced by the
"mountpoints" structure under the "ctx" object.
2010-03-22 22:31:08 +01:00
Matthias Dieter Wallnöfer
e2466334a0
s4:registry - "patchfile" - add another "W_ERROR_HAVE_NO_MEMORY" macro call
2010-03-22 22:31:08 +01:00
Matthias Dieter Wallnöfer
8046cbe3c1
s4:registry - "local" - add also here more "W_ERROR_HAVE_NO_MEMORY" macro tests
2010-03-22 22:31:07 +01:00
Matthias Dieter Wallnöfer
e690c0776f
s4:registry - "util.c" - initialise "result" in "reg_key_add_abs"
2010-03-22 22:31:06 +01:00
Matthias Dieter Wallnöfer
e78289f167
s4:registry - "samba.c" - add a "talloc_free"
2010-03-22 22:31:05 +01:00
Matthias Dieter Wallnöfer
dc17292f1a
s4:registry - add more "W_ERROR_HAVE_NO_MEMORY" invocations (on talloc'ed stuff)
2010-03-22 22:31:05 +01:00
Matthias Dieter Wallnöfer
9c3e6249fd
s4:registry - "util" - remove "const" from "reg_abs_path"
...
Here it's not really needed
2010-03-22 22:31:04 +01:00
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
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