Fix crash in pdbedit

resolves: #541267

Guenther
This commit is contained in:
Guenther Deschner 2010-01-27 16:12:38 +00:00
parent d48a9ca95f
commit f3759650f3
2 changed files with 41 additions and 1 deletions

34
samba-3.4.5-pdbedit.patch Normal file
View File

@ -0,0 +1,34 @@
From ad6a97f4a6908fa8858cd4bb9e5d804e8c29aba0 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@samba.org>
Date: Wed, 27 May 2009 18:40:13 +0200
Subject: [PATCH] Do not segfault in pdb_search_destructor if no real search was started
(cherry picked from commit d07464b21fe652e205f5eb2c74d12495bab100ce)
---
source3/passdb/pdb_interface.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 8c00329..01815c6 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -1711,7 +1711,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
static int pdb_search_destructor(struct pdb_search *search)
{
- if (!search->search_ended) {
+ if ((!search->search_ended) && (search->search_end != NULL)) {
search->search_end(search);
}
return 0;
@@ -1733,6 +1733,7 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
result->num_entries = 0;
result->cache_size = 0;
result->search_ended = False;
+ result->search_end = NULL;
/* Segfault appropriately if not initialized */
result->next_entry = NULL;
--
1.6.6

View File

@ -1,4 +1,4 @@
%define main_release 53
%define main_release 54
%define samba_version 3.4.5
%define tdb_version 1.1.3
%define talloc_version 1.3.0
@ -45,6 +45,7 @@ Patch104: samba-3.0.0rc3-nmbd-netbiosname.patch
# The passwd part has been applied, but not the group part
Patch107: samba-3.2.0pre1-grouppwd.patch
Patch200: samba-3.2.5-inotify.patch
Patch201: samba-3.4.5-pdbedit.patch
Requires(pre): samba-common = %{epoch}:%{samba_version}-%{release}
Requires: pam >= 0:0.64
@ -202,6 +203,7 @@ cp %{SOURCE11} packaging/Fedora/
#%patch104 -p1 -b .nmbd-netbiosname # FIXME: does not apply
%patch107 -p1 -b .grouppwd
%patch200 -p0 -b .inotify
%patch201 -p1 -b .pdbedit
mv %samba_source/VERSION %samba_source/VERSION.orig
sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&\"%{samba_release}\"/' < %samba_source/VERSION.orig > %samba_source/VERSION
@ -654,6 +656,10 @@ exit 0
%{_datadir}/pixmaps/samba/logo-small.png
%changelog
* Wed Jan 26 2010 Guenther Deschner <gdeschner@redhat.com> - 3.4.5-54
- Fix crash in pdbedit
- resolves: #541267
* Tue Jan 19 2010 Guenther Deschner <gdeschner@redhat.com> - 3.4.5-53
- Update to 3.4.5