- slpd crashes if slptool findsrvtypes is run, when message logging is on

(#523609)
This commit is contained in:
Rex Dieter 2009-09-16 12:59:25 +00:00
parent 4297b9020a
commit 870a732861
2 changed files with 56 additions and 11 deletions

View File

@ -0,0 +1,36 @@
diff -up openslp-1.2.1/slpd/slpd_log.c.orig openslp-1.2.1/slpd/slpd_log.c
--- openslp-1.2.1/slpd/slpd_log.c.orig 2005-02-08 05:34:31.000000000 +0000
+++ openslp-1.2.1/slpd/slpd_log.c 2009-09-15 19:39:23.000000000 +0100
@@ -179,7 +179,8 @@ void SLPDLogBuffer(const char* prefix, i
if (G_SlpdLogFile)
{
fprintf(G_SlpdLogFile,"%s",prefix);
- fwrite(buf,bufsize,1,G_SlpdLogFile);
+ if (buf && (bufsize > 0))
+ fwrite(buf,bufsize,1,G_SlpdLogFile);
fprintf(G_SlpdLogFile,"\n");
fflush(G_SlpdLogFile);
}
@@ -275,7 +276,21 @@ void SLPDLogSrvTypeRqstMessage(SLPSrvTyp
/*-------------------------------------------------------------------------*/
{
SLPDLog("Message SRVTYPERQST:\n");
- SLPDLogBuffer(" namingauth = ", srvtyperqst->namingauthlen, srvtyperqst->namingauth);
+
+ if (srvtyperqst->namingauthlen == 0xffff)
+ {
+ /* Naming authority matches all */
+ SLPDLog(" namingauth = (all)\n");
+ }
+ else if (srvtyperqst->namingauthlen == 0)
+ {
+ SLPDLog(" namingauth = (empty)\n");
+ }
+ else
+ {
+ /* Naming authority has been provided */
+ SLPDLogBuffer(" namingauth = ", srvtyperqst->namingauthlen, srvtyperqst->namingauth);
+ }
SLPDLogBuffer(" scope = ", srvtyperqst->scopelistlen, srvtyperqst->scopelist);
}

View File

@ -2,7 +2,7 @@
Summary: Open implementation of Service Location Protocol V2 Summary: Open implementation of Service Location Protocol V2
Name: openslp Name: openslp
Version: 1.2.1 Version: 1.2.1
Release: 13%{?dist} Release: 14%{?dist}
Group: System Environment/Libraries Group: System Environment/Libraries
License: BSD License: BSD
@ -11,7 +11,11 @@ Source: http://dl.sourceforge.net/sourceforge/openslp/openslp-1.2.1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source1: slpd.init Source1: slpd.init
Patch1: openslp-1.2.1-optflags.patch Patch1: openslp-1.2.1-optflags.patch
# slpd crashes if slptool findsrvtypes is run, when message logging is on
# http://bugzilla.redhat.com/523609
Patch2: openslp-1.2.1-nullauth.patch
BuildRequires: automake libtool BuildRequires: automake libtool
BuildRequires: bison BuildRequires: bison
@ -30,7 +34,7 @@ by RFC 2608 and RFC 2614.
%package devel %package devel
Summary: OpenSLP headers and libraries Summary: OpenSLP headers and libraries
Group: Development/Libraries Group: Development/Libraries
Requires: %{name} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
OpenSLP header files and libraries. OpenSLP header files and libraries.
@ -49,12 +53,14 @@ OpenSLP server daemon to dynamically register services.
%setup -q %setup -q
%patch1 -p1 -b .optflags %patch1 -p1 -b .optflags
%patch2 -p1 -b .nullauth
# tarball goof (?), it wants to re-automake anyway, so let's do it right. # tarball goof (?), it wants to re-automake anyway, so let's do it right.
libtoolize --force #libtoolize --force
aclocal #aclocal
autoconf #autoconf
automake --add-missing #automake --add-missing
autoreconf -f -i
# remove CVS leftovers... # remove CVS leftovers...
find . -name "CVS" | xargs rm -rf find . -name "CVS" | xargs rm -rf
@ -117,15 +123,15 @@ fi
%defattr(-,root,root) %defattr(-,root,root)
%doc AUTHORS COPYING FAQ NEWS README THANKS %doc AUTHORS COPYING FAQ NEWS README THANKS
%config(noreplace) %{_sysconfdir}/slp.conf %config(noreplace) %{_sysconfdir}/slp.conf
%{_bindir}/* %{_bindir}/slptool
%{_libdir}/lib*.so.* %{_libdir}/libslp.so.1*
%files server %files server
%defattr(-,root,root) %defattr(-,root,root)
%doc doc/html/IntroductionToSLP %doc doc/html/IntroductionToSLP
%doc doc/html/UsersGuide %doc doc/html/UsersGuide
%doc doc/html/faq* %doc doc/html/faq*
%{_sbindir}/* %{_sbindir}/slpd
%config(noreplace) %{_sysconfdir}/slp.reg %config(noreplace) %{_sysconfdir}/slp.reg
%config(noreplace) %{_sysconfdir}/slp.spi %config(noreplace) %{_sysconfdir}/slp.spi
%config(noreplace) %{_initrddir}/slpd %config(noreplace) %{_initrddir}/slpd
@ -134,11 +140,14 @@ fi
%defattr(-,root,root) %defattr(-,root,root)
%doc doc/html/ProgrammersGuide %doc doc/html/ProgrammersGuide
%doc doc/rfc %doc doc/rfc
%{_includedir}/* %{_includedir}/slp.h
%{_libdir}/lib*.so %{_libdir}/libslp.so
%changelog %changelog
* Wed Sep 16 2009 Rex Dieter <rdieter@fedoraproject.org> - 1.2.1-14
- slpd crashes if slptool findsrvtypes is run, when message logging is on (#523609)
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.2.1-13 * Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.2.1-13
- rebuilt with new openssl - rebuilt with new openssl