1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

157 Commits

Author SHA1 Message Date
Volker Lendecke
0742faaacd r20037: Reduce code size slightly by shuffling stuff around 2007-10-10 12:16:22 -05:00
Volker Lendecke
ad1e00430b r20020: Arglll... eventlogadm links against reg_db but not the rest of the registry
stuff. Revert the last change.

This needs better fixing.

Volker
2007-10-10 12:16:21 -05:00
Volker Lendecke
cab5ccbbe4 r20019: Replace one set of tricky code by calls to another set of tricky code:
Initializing the reg_db now uses reg_createkey and reg_setvalue.

Volker
2007-10-10 12:16:21 -05:00
Volker Lendecke
281640823b r20018: Fix a memleak in reg_createkey 2007-10-10 12:16:21 -05:00
Volker Lendecke
ad22a46718 r20016: Add two utility functions for easy opening/creating registry keys 2007-10-10 12:16:20 -05:00
Volker Lendecke
a6039eb46c r20005: reg_open_path should become the replacement for regkey_open_internal. 2007-10-10 12:16:19 -05:00
Volker Lendecke
dc0300ec70 r20004: Remove a const, "name" is allocated anyway 2007-10-10 12:16:19 -05:00
Volker Lendecke
fea52801de r19991: Sorry for this 2000-liner...
The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.

On that way it fixes creating keys with more than one element in the
path. This did not work before.

Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.

Volker
2007-10-10 12:16:18 -05:00
Volker Lendecke
8b3d860f27 r19990: Fix comment 2007-10-10 12:16:18 -05:00
Volker Lendecke
6cab254c49 r19963: Add 'registry shares = yes' and registry key security descriptors. 2007-10-10 12:16:16 -05:00
Volker Lendecke
fd429c8c06 r19948: Fix a memleak 2007-10-10 12:16:15 -05:00
Volker Lendecke
a177bbb2d5 r19947: Change regkey_open_internal to take the parent key and a talloc_ctx as
arguments. This also replaces regkey_close_internal by TALLOC_FREE.

Volker
2007-10-10 12:16:14 -05:00
Volker Lendecke
a660993d14 r19913: Fix a const warning 2007-10-10 12:16:08 -05:00
Volker Lendecke
01a53590a6 r19912: Move the subkey cache to srv_winreg_nt.c 2007-10-10 12:16:08 -05:00
Volker Lendecke
81bd816fa2 r19872: Move the value cache to srv_winreg_nt.c. Fix some minor issues found while
playing with regedit.exe.

Volker
2007-10-10 12:16:03 -05:00
Volker Lendecke
ed4dc40512 r19858: Fix a memleak, add a const 2007-10-10 12:16:03 -05:00
Volker Lendecke
ce44158dde r19853: Update a link 2007-10-10 12:16:02 -05:00
Volker Lendecke
5ec7379220 r19841: Wrap regdb_store_keys and regdb_store_values in tdb transactions 2007-10-10 12:16:01 -05:00
Volker Lendecke
ff4123c8f2 r19839: Fix the build, we are not there yet :-) 2007-10-10 12:16:01 -05:00
Volker Lendecke
f722f3341f r19838: We have to delete the value record as well, otherwise the old values pop up
again if the key is re-created.

Volker
2007-10-10 12:16:01 -05:00
Volker Lendecke
6639f8c119 r19837: Some reformatting (Jerry, I hope you do not mind 2007-10-10 12:16:01 -05:00
Volker Lendecke
969eb9cda6 r19828: Add a helper function to pull *and* unparse local registry values 2007-10-10 12:16:00 -05:00
Volker Lendecke
f808182346 r19780: Ok, regkey_open_internal needs a regkey_close_internal. Giving a talloc ctx is
misleading here. This needs fixing properly :-)

Volker
2007-10-10 12:15:55 -05:00
Volker Lendecke
b57e446789 r19779: Fail properly on talloc_strdup failure 2007-10-10 12:15:55 -05:00
Volker Lendecke
cb7f4211b8 r19778: Make regkey_open_internal take a talloc ctx 2007-10-10 12:15:55 -05:00
Volker Lendecke
17c7c337f6 r19777: Make regsubkey_ctr_addkey return WERROR. Nobody checks this so far, but this
will change.

Volker
2007-10-10 12:15:54 -05:00
Jelmer Vernooij
b41c52b9db r18745: Use the Samba4 data structures for security descriptors and security descriptor
buffers.

Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
2007-10-10 12:00:54 -05:00
Stefan Metzmacher
2f58645b70 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
2007-10-10 11:51:59 -05:00
Jeremy Allison
ae20201494 r17878: Fix possible null deref found by Stanford checker.
Jeremy.
2007-10-10 11:38:56 -05:00
Jeremy Allison
09652dc71c r17867: Fix null deref in error code path. Found by the
Stanford checker.
Jeremy.
2007-10-10 11:38:55 -05:00
Volker Lendecke
be9aaffdac r17333: Some C++ warnings 2007-10-10 11:38:26 -05:00
Volker Lendecke
c0d9114706 r17047: Fix a typo and a possible NULL dereference 2007-10-10 11:19:22 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Jeremy Allison
590b58cb50 r16650: Fix bug #3890 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:06 -05:00
Jeremy Allison
7580eb947c r16636: Fix bug #3884 reported by jason@ncac.gwu.edu
Jeremy.
2007-10-10 11:19:05 -05:00
Jeremy Allison
d04462f1d8 r16634: Fix bug #3883 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:04 -05:00
Jeremy Allison
067feef343 r16603: Klockwork #2028. Fix null deref on error path.
Jeremy.
2007-10-10 11:19:03 -05:00
Volker Lendecke
8cf364e602 r16490: Fix a memleak and two typos 2007-10-10 11:18:57 -05:00
Jeremy Allison
4fbeae1a3a r16424: Fix possible null deref and a memory leak found by
examining Klockwork #1519. get_printer_subkeys()
could return zero without initializing it's return
pointer arg. Fixed this. Added free of subkey pointer
return in registry/reg_printing.c (interesting that
neithe Coverity or Klocwork found this one).
Jeremy.
2007-10-10 11:18:52 -05:00
Volker Lendecke
d6547d12b1 r16409: Fix Klocwork ID's.
1177

In reg_perfcount.c: 1200 1202 1203 1204
In regfio.c: 1243 1245 1246 1247 1251

Jerry, the reg_perfcount and regfio.c ones, can you take a look please? This
is really your code, and I'm not sure I did the right thing to return an
error.

smbcacls.c: 1377
srv_eventlog_nt.c: 1415 1416 1417
srv_lsa_nt.c: 1420 1421
srv_netlog_nt.c: 1429
srv_samr_nt: 1458 1459 1460

Volker

Volker
2007-10-10 11:18:52 -05:00
Volker Lendecke
d52002c1c9 r15104: Implement Samba4's tdb_name().
Volker
2007-10-10 11:16:23 -05:00
Jeremy Allison
a40c7a0cd8 r14768: Fix potential null deref coverity bugs #255, #256.
Jeremy.
2007-10-10 11:15:47 -05:00
Jeremy Allison
e2e2d8b939 r14766: Fix possible NULL deref. Coverity #254.
Jeremy.
2007-10-10 11:15:47 -05:00
Volker Lendecke
1b247ff2ed r14247: Fix Coverity bug # 136 2007-10-10 11:15:20 -05:00
Jeremy Allison
053efc2098 r13978: Here is why it's essential to use SAFE_FREE instead of free.
If we use free(data.dptr) and then the subsequent tdb_open
fails in _reg_perfcount_get_counter_data() then data.dptr
is left as a non-zero pointer that has been freed. This would
cause it to be reused later on. Coverity bug #162.
Jeremy.
2007-10-10 11:11:02 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Gerald Carter
270fef5175 r12002: patch from marcin to allow for the creation of a File value in the eventlog registry keys so that file properties can be displayed 2007-10-10 11:05:41 -05:00
Gerald Carter
46bf28c81c r11860: BUG 3156: don't use find_service() when explicitly looking for a printer as the username map might get in the way 2007-10-10 11:05:31 -05:00
Gerald Carter
59c00924b6 r11579: syncing up perf counter code cfrom trunk 2007-10-10 11:05:21 -05:00
Gerald Carter
34c3fd77b3 r11227: patch from brian moran to fix typo in eventlog message file registry value name 2007-10-10 11:05:06 -05:00