1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

54 Commits

Author SHA1 Message Date
Matthew DeVore
232054c09b lib/util: remove extra safe_string.h file
lib/util/safe_string.h is similar to source3/include/safe_string.h, but
the former has fewer checks. It is missing bcopy, strcasecmp, and
strncasecmp.

Add the missing elements to lib/util/safe_string.h remove the other
safe_string.h which is in the source3-specific path. To accomodate
existing uses of str(n?)casecmp, add #undef lines to source files where
they are used.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-08-28 02:18:40 +00:00
Douglas Bagnall
28eb49c7ed lib/registry/regf: better initialise nk_block
We were initialising a uint32_t[5] block with memset(..., 5) when we
surely meant memset(..., 5 * sizeof(uint32_t)) or some equivalent.

Thanks go to gcc-7 and -Wmemset-elt-size. The warning looks like this:

../source4/lib/registry/regf.c: In function ‘reg_create_regf_file’:
../source4/lib/registry/regf.c:2095:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(nk.unk3, 0, 5);
    ^~~~~~

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-11-30 20:36:24 +01:00
Günther Deschner
b0d21f44e5 werror: replace WERR_GENERAL_FAILURE with WERR_GEN_FAILURE in source4/lib/registry/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:21 +02:00
Günther Deschner
70807a4267 werror: replace WERR_BADFILE with WERR_FILE_NOT_FOUND in source4/lib/registry/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:17 +02:00
Volker Lendecke
a99a5a34a5 Fix the developer O3 build
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Wed Feb 25 16:32:29 CET 2015 on sn-devel-104
2015-02-25 16:32:29 +01:00
Stefan Metzmacher
ea132fd7d1 s4:lib/registry: fix compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:45 +01:00
Andreas Schneider
7a50f089e0 s4-libregistry: Improve NULL handling of name.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:30:11 +01:00
Andreas Schneider
2aca90b9a0 s4-libregistry: Make sure we don't dereference a NULL pointer.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:30:01 +01:00
Matthias Dieter Wallnöfer
042372bc20 s4:lib/registry/regf.c - always generate debug messages on error cases
We need to know what is going on.

Reviewed-by: Jelmer
2011-11-03 20:10:06 +01:00
Wilco Baan Hofman
a8adadbe5b Fix issues addressed by Jelmer:
* Add a comment about why the reg_strhex_to_data_blob was added
 * Fix int which should've been a boolean

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-10-03 15:31:38 +02:00
Wilco Baan Hofman
2d4500deea Fix registry editor to be compatible with Windows 7.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-10-03 15:31:37 +02:00
Wilco Baan Hofman
90d82870b0 5 uint32_t's should be set, not 5 bytes.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-10-03 15:31:37 +02:00
Wilco Baan Hofman
b3d2345bd1 The root key should be created as a root key, not subkey.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-10-03 15:31:37 +02:00
Wilco Baan Hofman
a23aa3f5f1 Make sure that regf only writes to disk every five seconds or when flushed or destroyed
Brings speed up on a large .reg import from 17.5s to 0.95s, over 18 times faster

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-10-03 15:31:37 +02:00
wilco@baanhofman.nl
7efcb3ca66 Fix file corruption (non-updated header) on new allocation.
Also fixes debug messages to use hex offsets.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-09-19 12:34:54 -07:00
wilco@baanhofman.nl
d0cef92532 Fix crash when no subkeys exist. Fix writing outside of buffer error by regf backend.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-09-19 12:34:54 -07:00
Matthias Dieter Wallnöfer
05f31c3f6d s4:registry/regf.c - add some casts to suppress build warnings on Solaris 2010-06-20 22:33:02 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Matthias Dieter Wallnöfer
ef3490e799 s4:registry - "REGF backend" - don't ignore wrong-sized REG_DWORD/REG_DWORD_BIG_ENDIAN values 2010-04-08 15:29:40 +02:00
Matthias Dieter Wallnöfer
79fccc45bc s4:registry - "regf backend" - fix it up regarding REG_DWORD/REG_DWORD_BIG_ENDIAN_VALUES
This is needed to make it platform independently work (also on big endian
platforms as little endian).

Also add a size check before storing a DWORD.
2010-04-07 20:22:57 +02: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
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
89ab6818e1 s4:libregistry - change counters to be "unsigned"
Also the s4 registry library has to have "unsigned" counters like the Windows
one.
2010-03-06 17:48:25 +01:00
Matthias Dieter Wallnöfer
91bf841c2e s4:registry/regf.c - specify the context when freeing the "regf" variable
Otherwise we get a "talloc_free with references" warning.
2010-02-22 22:15:03 +01:00
Andrew Tridgell
5ab6a8d077 s4-registry: fixed byte order assumptions
the registry tests were broken on big-endian systems
2010-02-07 18:41:59 +11:00
Wilco Baan Hofman
8067bf629c Fix unintentional free of the last value when adding a new value to a key.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-01-20 09:59:18 +13:00
Wilco Baan Hofman
45bb24e939 Fix trailing garbage in the hbin block.
This specifically fixes a problem showing extra bytes of garbage in list and
print in regshell, even though the vk.data_length has the correct size.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-11-15 19:26:50 +01:00
Jelmer Vernooij
169ff6efea registry: Fix warning freeing talloc pointer with multiple parents. 2009-09-26 15:41:22 +02:00
Matthias Dieter Wallnöfer
2627c6c0c2 Fixed some uninitialised variables
I tried hard to not change the program logic. Should fix bug #6439.
2009-06-19 11:32:01 +10:00
Stefan Metzmacher
4cb9ccd841 s4:lib/registry: fix c++ warnings
metze
2009-02-05 17:48:10 +01:00
scudette@gmail.com
793f1cdbd9 Changed code to use proper talloc context instead of NULL to control memory leak. 2009-01-02 20:55:20 +01:00
scudette@gmail.com
de58ef45ac Fixes uninitialised access as reported by valgrind. 2009-01-02 20:55:20 +01:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Jelmer Vernooij
1b99d8fbb5 Use common util_file code. 2008-10-12 17:34:43 +02:00
Wilco Baan Hofman
12147fca2b Add support for security descriptors. Also patched the regf backend to support this.
Did not touch the ldb, dir and rpc backends yet.
(This used to be commit c4626f21a8)
2008-04-14 22:52:51 +02:00
Jelmer Vernooij
ec7394e7d2 Merge hive.h into registry.h
(This used to be commit 3ca14fdf74)
2008-04-02 13:59:48 +02:00
Jelmer Vernooij
c7dc53b851 Merge branch 'v4-0-test' into id10ts-registry
(This used to be commit f98b59021a)
2008-03-03 00:23:09 +01:00
Andrew Kroeger
79eea32976 registry: Implement recursive deletes for regf-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 regf-backed registry consistent with Windows.

The regf-backed registry does not have transactional integrity when performing
multiple operations.  Therefore, if an error occurs during the recursive
deletion, the regf-backed registry may be left in an inconsistent state.
(This used to be commit b0321bad29)
2008-02-26 19:27:14 -06:00
Jelmer Vernooij
c38c2765d1 Remove yet more uses of global_loadparm.
(This used to be commit e01c1e87c0)
2008-02-21 17:17:37 +01:00
Jelmer Vernooij
55ad09a01b registry: Use correct return values.
(This used to be commit 98ebdbe52f)
2008-01-18 03:42:00 +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 1e31fcb8a0)
2008-01-18 03:41:59 +01:00
Jelmer Vernooij
47f6bbf8cf r26689: registry: Return max_subkeynamelen, max_valnamelen and max_valbufsize in getkeyinfo().
(This used to be commit b06896d237)
2008-01-07 08:18:07 -06:00
Jelmer Vernooij
7d5f0e0893 r26639: librpc: Pass iconv convenience on from RPC connection to NDR library, so it can be overridden by OpenChange.
(This used to be commit 2f29f80e07)
2008-01-01 16:12:15 -06:00
Jelmer Vernooij
86dc05e99f r26638: libndr: Require explicitly specifying iconv_convenience for ndr_struct_push_blob().
(This used to be commit 61ad78ac98)
2008-01-01 16:12:11 -06: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 46dfa63d4f)
2007-12-21 05:50:16 +01:00
Jelmer Vernooij
96a200511e r26443: Remove global_loadparm instances.
(This used to be commit 8242c69623)
2007-12-21 05:50:11 +01:00
Jelmer Vernooij
27b21a386e r26439: Require tdr_pull users to specify a smb_iconv convenience context.
(This used to be commit 76fd57be29)
2007-12-21 05:50:07 +01:00
Jelmer Vernooij
5e00673a40 r26438: Store iconv convenience in tdr push contexts.
(This used to be commit dffef31627)
2007-12-21 05:50:07 +01:00
Stefan Metzmacher
529763a9aa r25920: ndr: change NTSTAUS into enum ndr_err_code (samba4 callers)
lib/messaging/
lib/registry/
lib/ldb-samba/
librpc/rpc/
auth/auth_winbind.c
auth/gensec/
auth/kerberos/
dsdb/repl/
dsdb/samdb/
dsdb/schema/
torture/
cluster/ctdb/
kdc/
ntvfs/ipc/
torture/rap/
ntvfs/
utils/getntacl.c
ntptr/
smb_server/
libcli/wrepl/
wrepl_server/
libcli/cldap/
libcli/dgram/
libcli/ldap/
libcli/raw/
libcli/nbt/
libnet/
winbind/
rpc_server/

metze
(This used to be commit 6223c7fddc)
2007-12-21 05:45:02 +01:00
Günther Deschner
cc8f4eb3cd r25544: Cleanup some more indents in lib/registry.
Guenther
(This used to be commit 0d9826dc54)
2007-10-10 15:07:51 -05:00