Age | Commit message (Collapse) | Author | Files | Lines |
|
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)
|
|
I think this is actually a false warning, but as I've seen it with high gcc
warning levels, lets fix it :-)
Volker
(This used to be commit 3f671033bca7a025f9639728a0a0a0adede6ed35)
|
|
WBFLAG_PAM_CONTACT_TRUSTDOM. This
can not work for NTLM auth, where we only have a workstation account for our
own domain. For the PAM Kerberos login we need to find a better way to do
this, probably using Dsr_GetDCName and some winbind-crafted krb5.conf.
Volker
(This used to be commit bf7c608147bcbbedd89b3dcd24a929ea3e601bc8)
|
|
think is a direct bug, but some code that needs clarification :-).
Jeremy.
(This used to be commit 61901a3f10de64a72b655d9aa884424a4fc88a44)
|
|
if rrec can be null make sure we *never* deref it.
Jeremy.
(This used to be commit d6d7a5ac62b6ee08e365c5982302b1d8dc69a78f)
|
|
Jeremy.
(This used to be commit 46e10980927f1dfa4a1995e778df880cf823cbdb)
|
|
Jeremy.
(This used to be commit dd47e0ef1175a57ec2e9b797ac942cb79f4a5d05)
|
|
Jeremy.
(This used to be commit f4bf550b5757024b41062784b185b52a1a0e11f4)
|
|
exit path.
Jeremy.
(This used to be commit 95ef857c89a330ef4012ba3c10d2bbbbab112b34)
|
|
Jeremy.
(This used to be commit 0dc37dd2d85d59e7287cebcb7019194cf6754074)
|
|
(This used to be commit c803e1b2afdfc5bd983f046c976c01adebcfa1ad)
|
|
Jeremy.
(This used to be commit 0f1dffb2f2ce5ace1b3216f578ab115c976624c7)
|
|
part of the changes I made but something that's been there
a while.... Coverity bugid #41.
Jeremy.
(This used to be commit 2f6cf810eae124820a073258ffe62aace7a92d9c)
|
|
Guenther
(This used to be commit 0ae3fddf95a95ec8a2f4d52e1276c1721b33ddfd)
|
|
affinity cache.
Guenther
(This used to be commit b8c07babbd22832132da8f70026aa1816983bc38)
|
|
(This used to be commit ab62c8d93acb432678e301e57aeb86887913ebe6)
|
|
(This used to be commit 705d8118081784e9907648fd1daaaa5ec0285972)
|
|
Jerry, this just fixes the warning. This routine does not seem to cope well
with !UNMARSHALLING. You might want to look...
Volker
(This used to be commit 2c0c40dfb5da9e901e099295f43032a745e71253)
|
|
* Finish prototype of the "add port command" implementation
Format is "addportcommand portname deviceURI"
* DeviceURI is either
- socket://hostname:port/
- lpr://hostname/queue
depending on what the client sent in the request
(This used to be commit 6d74de7a676b71e83a3c3714743e6380c04e4425)
|
|
with the "MonitorUI" call
* Fix some parsing errors
This gets us to the Add Port Wizard dialog.
(This used to be commit a444aa7f0088fb71ff89df8c280209188b33ec3d)
|
|
(This used to be commit a34ab5c827630a5517e4c706877a172e6063f227)
|
|
* Add support for the "Local Port" monitor as well through this API
(This used to be commit ba9cdd88a0abf90a9c04959e554d7e4f10d17ff7)
|
|
variable.
(This used to be commit 8f48c6d1e54b4f085f0db879ef548efecba7b42d)
|
|
> for the svn log:
>
> - Solaris' /bin/sh doesn't know "test -e" - let's use "test -f" instead
>
> Some volunteer wanna check this in? :)
>
> Cheers
> Bjoern
Volker
(This used to be commit 58d5f2031ac6018417ecd3c2306c120b5c7d1e43)
|
|
Began the poet, his face as pale as death.
"I will go first, and you will follow me."
---
Adding XcvDataPort() to the spoolss code for remotely
add ports. The design is to allow an intuitive means
of creating a new CUPS print queue from the Windows 2000/XP
APW without hacks like specifying the deviceURI in the
location field of the printer properties dialog.
Also set 'default devmode = yes' as the new default
since it causes no harm and only is executed when you
have a NULL devmode anyways.
(This used to be commit 123e478ce5b5f63a61d00197332b847e83722468)
|
|
Fix incorrect size understanding of sid name type (yes it's
already correct in the Samba4 IDL :-).
Jeremy.
(This used to be commit 305a774d2880a57d1ebdf2ecf2d7e0b519695a33)
|
|
Jeremy.
(This used to be commit 13de4d000e04ffca41814554bdee8291ddb1efe2)
|
|
Jeremy.
(This used to be commit 36df6ba3ad8b93744577ad92df0fe0b9bf9a4300)
|
|
* disable winbind enum {users,groups} by default after
further conversations with Volker.
(This used to be commit d640d815405ce226c51577de5524daf63515d0a7)
|
|
Jeremy.
(This used to be commit 9ed3bd431c8b8073e177df463e254cf45529bed6)
|
|
Volker
(This used to be commit ae9614ce019e25fb29dad8429d93f3140c2f84ad)
|
|
that counts.
Jeremy.
(This used to be commit aa85ba4f3799ffbe5c6f84f768f03a4c68d879dc)
|
|
(This used to be commit a374546c7e8dfc17eb2346c518d1d89f28c32feb)
|
|
* winbind nested groups = yes
* host msdfs = ye
* msdfs root = yes
(This used to be commit b5f01559e1f75c427e59646ee79e18433806213e)
|
|
list rather than bailing out
(This used to be commit acff5163ca7be59e01438f7cf63faef9ed54b820)
|
|
* Fix parsing error in eventlogadm caused by log entries
with no DAT: line.
(This used to be commit f0a8f438793a806e8cf73e1e695b09e540a4239e)
|
|
a user since we no longer pay any attention to the value.
(This used to be commit 085c6859ee5b97efe9ec06e95877d500822d3c82)
|
|
Add the missing comment about needing to save the new share name.
(This used to be commit bb3b15e631c8dae7aaea303be18e086d63ee16d6)
|
|
When only allowing one connection per server, the cache needs to track which
share is currently connected, or we never know whether a tdis()/tcon() for the
new share is required.
(This used to be commit ad0a725ef5f68db442b3b217c5a852086eff9297)
|
|
a new empty acl in remove_posix_acl if you don't bother
to set it on the file in question :-).
Jeremy.
(This used to be commit 12eccc8fe4ed043698970de42921757eb0448c84)
|
|
(This used to be commit c13af58f6322104a45d0e620cc26f522a47af2ab)
|
|
(This used to be commit deb35f85b3b96e431902ec5e771821f9e69d7f99)
|
|
(This used to be commit 6e4af8cd153e2eb39c5c10e718ec76ee103aa180)
|
|
Thanks to tridge's changes to the directory delete on close tests
for catching this.
Jeremy.
(This used to be commit 01ef957d4846191071f95393e6e76e48d4c6aa24)
|
|
upgrade it calls tdbsam_convert() which calls tdbsam_open()
deep inside the init_sam_from_buffer_vX call.
If the ref count hasn't been set yet then we will close
the tdbsam reference in tdbsam_getsampwsid().
smbpasswd -a was core-dumping again :-).
Jeremy
(This used to be commit 993069eb87c190ba8ee92224340c8f9ffb3ade74)
|
|
up typing and tighten error checking a little.
(This used to be commit 37e12a196b1b1ee57b17a21226ba55d3aa6c69a5)
|
|
(This used to be commit cde31d5957ff9a009e111ab3719d20e70a5053b6)
|
|
(This used to be commit 2afcbbfb6f2efcc2e10106b10a87365556013787)
|
|
(This used to be commit 59f95ea752d932b00d4a4ff37311b830d65c8a03)
|
|
(This used to be commit 76c100834d125b889d29d0fc38934bed4cc77e19)
|