From ce8fc6c08d62e4379a3b3d362e30a9035d7f737e Mon Sep 17 00:00:00 2001 From: Peter Vrabec Date: Mon, 27 Aug 2007 11:55:11 +0000 Subject: [PATCH] fix segfault of data-change-warn option (#255261), patch from dkopecek@redhat.com --- star-1.5-changewarnSegv.patch | 85 +++++++++++++++++++++++++++++++++++ star.spec | 8 +++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 star-1.5-changewarnSegv.patch diff --git a/star-1.5-changewarnSegv.patch b/star-1.5-changewarnSegv.patch new file mode 100644 index 0000000..2609f1e --- /dev/null +++ b/star-1.5-changewarnSegv.patch @@ -0,0 +1,85 @@ +--- star-1.5/star/checkerr.c.orig-segv 2006-10-31 18:06:25.000000000 +0100 ++++ star-1.5/star/checkerr.c 2007-08-27 11:42:39.000000000 +0200 +@@ -183,44 +183,45 @@ LOCAL struct eflags { + */ + LOCAL UInt32_t + errflags(eflag, doexit) +- char *eflag; +- BOOL doexit; ++ char *eflag; ++ BOOL doexit; + { +- register char *p = eflag; +- char *ef = _endword(eflag); +- char ec; +- register struct eflags *ep; +- register int slen; +- register UInt32_t nflags = 0; +- +- ec = *ef; +- *ef = '\0'; +- do { +- for (ep = eflags; ep->fname; ep++) { +- slen = strlen(ep->fname); +- if ((strncmp(ep->fname, p, slen) == 0) && +- (p[slen] == '|' || p[slen] == ' ' || +- p[slen] == '\0')) { +- nflags |= ep->fval; +- break; +- } +- } +- if (ep->fname == NULL) { +- if (doexit) +- comerrno(EX_BAD, "Bad flag '%s'\n", p); +- *ef = ec; /* Restore old character */ +- return (0); +- } +- p = strchr(p, '|'); +- } while (p && *p++ == '|'); +- +- *ef = ec; /* Restore old character */ +- if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) { +- if (doexit) +- comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag); +- return (0); +- } +- return (nflags); ++ register struct eflags *ep; ++ register int slen; ++ register UInt32_t nflags = 0; ++ char *curflags; ++ char *curflag; ++ ++ curflags = strdup (eflag); ++ *_endword(curflags) = '\0'; ++ curflag = strtok (curflags, "|"); ++ ++ while (curflag != NULL) { ++ for (ep = eflags; ep->fname; ep++) { ++ slen = strlen (ep->fname); ++ if ((strncmp (ep->fname, curflag, slen)) == 0) { ++ nflags |= ep->fval; ++ goto next; ++ } ++ } ++ ++ if (doexit) ++ comerrno (EX_BAD, "Bad flag '%s' \n", curflag); ++ ++ free (curflags); ++ return (0); ++ next: ++ curflag = strtok (NULL, "|"); ++ } ++ ++ free (curflags); ++ ++ if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) { ++ if (doexit) ++ comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag); ++ return (0); ++ } ++ return (nflags); + } + + LOCAL ec_t * diff --git a/star.spec b/star.spec index be62c25..754446c 100644 --- a/star.spec +++ b/star.spec @@ -4,11 +4,12 @@ Summary: An archiving tool with ACL support Name: star Version: 1.5a84 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://cdrecord.berlios.de/old/private/star.html Source: ftp://ftp.berlios.de/pub/star/alpha/%{name}-%{version}.tar.bz2 Patch1: star-1.5-newMake.patch Patch2: star-1.5-selinux.patch +Patch3: star-1.5-changewarnSegv.patch License: CDDL Group: Applications/Archiving BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -25,6 +26,7 @@ and can restore individual files from the archive. Star supports ACL. %if %{WITH_SELINUX} %patch2 -p1 -b .selinux %endif +%patch3 -p1 -b .changewarnSegv for PLAT in %{arm} x86_64 ppc64 s390 s390x; do for AFILE in gcc cc; do @@ -95,6 +97,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man1/spax.1* %changelog +* Mon Aug 27 2007 Peter Vrabec 1.5a84-2 +- fix segfault of data-change-warn option (#255261), + patch from dkopecek@redhat.com + * Fri Aug 24 2007 Peter Vrabec 1.5a84-1 - new upstream release with CVE-2007-4134 fix