1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

279 Commits

Author SHA1 Message Date
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
Jeremy Allison
d720867a78 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
2007-10-10 11:05:02 -05:00
Gerald Carter
47b626a8f7 r11136: patches from Brian Moran for eventlogadm utility 2007-10-10 11:05:02 -05:00
Gerald Carter
24e7663086 r11123: * patches from Brian Moran for creating new eventlog
source keys
* my patches to get registry utility functions linking
  with eventlogadm tool
2007-10-10 11:05:00 -05:00
Gerald Carter
db8d85aa1e r11073: safety checks on pointers to prevent crashing when converting REG_MULTI_SZ 2007-10-10 11:05:00 -05:00
Gerald Carter
e858eed813 r11072: add routines for converting REG_MULTI_SZ to and from char** 2007-10-10 11:05:00 -05:00
Gerald Carter
6c6bf6ca5f r10819: merging a couple of fixes from trunk
* only keep the registry,tdb file open when we have an open key handle
* tpot's setup.py fix
* removing files that no longer exist in trunk and copying some
  that were missing in 3.0
2007-10-10 11:04:54 -05:00
Gerald Carter
f10aa9fb84 r10781: merging eventlog and svcctl code from trunk 2007-10-10 11:04:53 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Gerald Carter
8c819cd0c6 r10012: fix build breakage caused by forgotten commit in local tree 2007-10-10 11:03:31 -05:00
Jelmer Vernooij
d30356b9ad r9965: Fix some typo's 2007-10-10 11:03:29 -05:00
Gerald Carter
18d0543183 r9914: key ordering in hash list is case insensitive 2007-10-10 11:03:28 -05:00
Gerald Carter
ef7e0d70c6 r9895: fix typo in registry path 2007-10-10 11:03:27 -05:00
Gerald Carter
b12a05b237 r9894: Add new registry key expected by Windows XP clients.
HKLM\\SYSTEM\\CurrentControlSet\\Control\\Termininal Server\\DefaultUserConfiguration

Apparently this started showing up after the winreg-write support
was added in 3.0.20rc1 or so.

Also modifed init_registry_data() to always run and add the
required keys.  Initial values however are only written if
they don't already exist.

This makes it easier to add new keys without having to rev the
tdb version number (which is really unnecessary in this case).

Portions of patch reviewed by Thomas Bork on the general samba ml.
2007-10-10 11:03:27 -05:00
Gerald Carter
ef721333ab r9739: conver the reg_objects (REGSUBKEY_CTR & REGVAL_CTR) to use
the new talloc() features:

 Note that the REGSUB_CTR and REGVAL_CTR objects *must* be talloc()'d
 since the methods use the object pointer as the talloc context for
 internal private data.

 There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
 pair of functions.  Simply TALLOC_ZERO_P() and TALLOC_FREE() the
 object.

Also had to convert the printer_info_2->NT_PRINTER_DATA field
to be talloc()'d as well.  This is just a stop on the road to
cleaning up the printer memory management.
2007-10-10 11:03:25 -05:00
Gerald Carter
3a3bf4ddb7 r9657: fix final issue with regf sk_records; profiles now successfully rewrites
Win2k and WinXP user profile security descriptors.
2007-10-10 11:03:24 -05:00
Gerald Carter
c588c2ee69 r9656: fix bug in sk record list with next offsets 2007-10-10 11:03:23 -05:00
Gerald Carter
8d34756191 r9486: ensure that the registry hash records are sorted by original subkey name and not the 4 character hash key 2007-10-10 11:01:11 -05:00
Tim Potter
5d592691e4 r9278: Remove unused variable. Bugzilla #2983. 2007-10-10 11:00:30 -05:00
Gerald Carter
e9427912a7 r9115: using #define for reg paths rather than typing the string 2007-10-10 11:00:26 -05:00
Gerald Carter
353e63ff42 r9086: * fix invalid read in parse_spoolss when writing a devmode to
the wire
* fix dup_a_regval() when size is 0
* ensure we pass a pstring to unlink_internals (fixes delete_driver
  code)
2007-10-10 11:00:25 -05:00
Gerald Carter
ed93cc50e1 r8607: BUG 2900 more compiler warnings 2007-10-10 11:00:12 -05:00
Gerald Carter
d6b1f695a0 r8606: BUG 2899: fix compiler warning in regfio routine 2007-10-10 11:00:12 -05:00
Gerald Carter
9f8344e31d r8604: BUG 2890: fix unitialized variable reported by Jason Mader <jason@ncac.gwu.edu> 2007-10-10 11:00:12 -05:00
Gerald Carter
d07179de2f r8501: * disable printer handle object cache (was mostly used
for NT4 clients enumerating printer data on slow CPUs)
* fix pinter and secdesc record upgrade to normalize the key
  (rev'd printer tdb version)
* fixed problem that was normalizing the printername name field

in general, this should fix the issues upgrading print servers
from 3.0.14a to 3.0.20
2007-10-10 11:00:06 -05:00
Gerald Carter
bd87819795 r8327: * don't use unitialized variables 2007-10-10 10:58:20 -05:00
Gerald Carter
61f14cdcbd r8325: * punt....don't normalize the printer name in the RegCreateKey().
Print Migrator now works as long as the addprinter command can
  handle the name
2007-10-10 10:58:19 -05:00
Gerald Carter
9a27f7181a r8324: * initial cut at creating printers via the registry API
Need to add delete_key support
2007-10-10 10:58:19 -05:00
Gerald Carter
fadda2f240 r8323: * convert RegSetValue() calls immediately beneath the printer
key to PRINTER_INFO_2 fields.
2007-10-10 10:58:19 -05:00