Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
(This used to be commit 053efc20981e0280c6af0ebb9e17cea07da85fe8)
|
|
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.
(This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
|
|
eventlog registry keys so that file properties can be displayed
(This used to be commit 270fef5175559ba6345bb2c3e264c527a6a084c5)
|
|
printer as the username map might get in the way
(This used to be commit 46bf28c81c27dfdc412318a83bf565211a58a47d)
|
|
(This used to be commit 59c00924b67aa3d37a933731a56d03963ec7f1b5)
|
|
value name
(This used to be commit 34c3fd77b320d4fe5e0f1452aa09ea5ec2797494)
|
|
x86_64 box.
Jeremy.
(This used to be commit d720867a788c735e56d53d63265255830ec21208)
|
|
(This used to be commit 47b626a8f72629fd1bbabf35b68e24d202df2555)
|
|
source keys
* my patches to get registry utility functions linking
with eventlogadm tool
(This used to be commit 24e7663086f5d15c7e3fd8069667169b91d1acda)
|
|
REG_MULTI_SZ
(This used to be commit db8d85aa1ec5c486f061f97627b6b18a0e17cd34)
|
|
(This used to be commit e858eed813b5a9a8d57262142c5bbde2951b5590)
|
|
* 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
(This used to be commit 6c6bf6ca5fd430a7a20bf20ed08050328660e570)
|
|
(This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac)
|
|
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
|
|
(This used to be commit 8c819cd0c670acfe7be2ecd927ef8de6fa5226f2)
|
|
(This used to be commit d30356b9ad90ad33dc93028829954632ab774c74)
|
|
(This used to be commit 18d05431831c88f6302a55fe23f51951987f2cb0)
|
|
(This used to be commit ef7e0d70c68976766c01e1212e2b8f48f6895f98)
|
|
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.
(This used to be commit b12a05b23782cfcb93fb4811807ef388de97c95c)
|
|
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.
(This used to be commit ef721333ab9639cb5346067497e99fbd0d4425dd)
|
|
Win2k and WinXP user profile security descriptors.
(This used to be commit 3a3bf4ddb702647b48baf9073c4fca0e1e16a194)
|
|
(This used to be commit c588c2ee69fa72089e9c0aed6881a76f4e490d86)
|
|
name and not the 4 character hash key
(This used to be commit 8d347561919ded19b1e7096aceb119c66f461c61)
|
|
(This used to be commit 5d592691e4d4f1cd47bd062633a54d7892548ee7)
|
|
(This used to be commit e9427912a763b0e4bb47724f835b91c2252105e8)
|
|
the wire
* fix dup_a_regval() when size is 0
* ensure we pass a pstring to unlink_internals (fixes delete_driver
code)
(This used to be commit 353e63ff421c564a1b7c7cfe95982f31c871a227)
|
|
(This used to be commit ed93cc50e1064dc5a3145d97555715b0b2915db4)
|
|
(This used to be commit d6b1f695a0baf2042ce121702cdcbbf59e94bd94)
|
|
<jason@ncac.gwu.edu>
(This used to be commit 9f8344e31d3628338b434ee3e530b7f7322e6fe1)
|
|
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
(This used to be commit d07179de2f2a6eb1d13d0e25ac10de1a21475559)
|
|
(This used to be commit bd878197954cf4d259dfd01f2d4cb4a663b34121)
|
|
Print Migrator now works as long as the addprinter command can
handle the name
(This used to be commit 61f14cdcbd3b183caf6172d5b60b0888fc4363f7)
|
|
Need to add delete_key support
(This used to be commit 9a27f7181adca10f60c47d342a51dec34321e12b)
|
|
key to PRINTER_INFO_2 fields.
(This used to be commit fadda2f240eb3c8eb08198c702a93e23b14f0fcc)
|
|
(not immediate values below the <printer name> key yet.
(This used to be commit a872ea5f0e29f7b585574a56b52a5eb44cb92278)
|
|
* use SAMBA_PRINTER_PORT_NAME in registry values for builtin printer
port
(This used to be commit 63bc03536b6d0622005448f0f7be2739e06a432a)
|
|
(This used to be commit d3427960b0676c506c639b582a2544dc58990c9e)
|
|
when packing values. It is a compatible change though and will
not require a tdb version upgrade
* Can successfully create new printer subkeys via winreg that
are immediately available via spoolss calls. Still cannot delete
keys yet though. That comes next.
(This used to be commit 00bce2b3bb78a44842a258b1737076281297d247)
|
|
* more work on the store_values() functions for the Printers key
* add Control\Print\Monitors key to list for reg_db
(This used to be commit 89f17b41cee633838b8cbd0d1bf8119a4b8d707e)
|
|
* move to registry.tdb for port listing (at least via the winreg ops)
If no one opposes on the samba list, we'll move to a registry
lookup for enumerating ports rather than the 'enumports command'.
This means that there is a bit of a disconnect between EnumPorts() and
RegEnumKey('hklm\software\microsoft\windows nt\currentversion\ports').
(This used to be commit 6f654c5741e98abf00c010c5dd38038092c0f7a3)
|
|
(This used to be commit f0a1c6b9cec28d5b4aa8a1a2f9b34d1f13113a6c)
|
|
(still not completely back to the read functionality
we previously had but the cleanup is progressing)
(This used to be commit 04431372a698433b4936392047228908a64ff382)
|
|
for every fetch/store callback (some keys should never have a value)
(This used to be commit 7466351dd059b75c29bc0d2977c6c9d318a14dc6)
|
|
e.g. 'hklm\software\microsoft\windows nt\currentversion\ports'
should have no subkeys. Return an error if a client tries
to open a path below here
(This used to be commit 7a2ecb1aec2b84e6bc326be4a1191fb54526c430)
|
|
* make regdb_store_XXX() and regdb_fetch_XXX() functions non-static
* use case sensitive string lookups in reg_dynamic.c since the
keys have already been normalized
* move to new design for making printing related data available
via the winreg pipe (with the intent of allowing writes)
(This used to be commit 28c7293ee9e68b913faf8d74d63f73e09087169b)
|
|
"Honest office! It was a mistake! I thought the safety lock was on!"
* Fix problem setting registry values in in-memory objects
I now have printmig.exe successfully creating all of the printer
registry keys (in the tdb backend) which means that the top level
semantics are correct.
(This used to be commit 52899551070ddb8f185d53bd125ae06c192ef7b0)
|
|
printmig.exe assumes that the LUID of the SeBackupPrivlege
on the target server matches the LUID of the privilege
on the local client. Even though an LUID is never guaranteed
to be the same across reboots. How *awful*! My cat could
write better code! (more on my cat later....)
* Set the privelege LUID in the global PRIVS[] array
* Rename RegCreateKey() to RegCreateKeyEx() to better match MSDN
* Rename the unknown field in RegCreateKeyEx() to disposition
(guess according to MSDN)
* Add the capability to define REG_TDB_ONLY for using the reg_db.c
functions and stress the RegXXX() rpc functions.
(This used to be commit 0d6352da4800aabc04dfd7c65a6afe6af7cd2d4b)
|
|
to a thin layer in fetch_reg_values(). Not entirely efficient
seeing as the the dynamic value paths are stored in an unsorted
array but it is one strequal() per path. If this was really big
it should be worked into the reghook_cache().
(This used to be commit 63b81ad3cb484090a181fbd13e04922a5c17e7d9)
|
|
in init_registry_data()
* Add means of storing registry values in registry.tdb
* add builtin_registry_values[] array for REG_DWORD and REG_SZ
values needed during startup
* Finish up RegDeleteValue() and RegSetValue()
* Finish up regdb_store_reg_values() and regdb_fetch_reg_values()
I can now create and retrieve values using regedit.exe on Win2k.
bin/net -S rain -U% rpc registry enumerate 'hklm\software\samba'
Valuename = Version
Type = REG_SZ
Data = 3.0.20
Next is to do the virtual writes in reg_printing.c and I'll be
done with Print Migrator (yeah! finally)
(This used to be commit 3d837e58db9ded64d6b85f047012c7d487be4627)
|
|
* merge a compile warning fix from trunk to SAMBA_3_0
(This used to be commit 71eb018a05c5012fbd42ba6817aabc0797d38ba1)
|