Dr. Werner Fink 2010-10-08 12:55:02 +00:00 committed by Git OBS Bridge
parent fde6d58b46
commit 84eadbfe0a
3 changed files with 47 additions and 2 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Oct 8 14:50:56 CEST 2010 - werner@suse.de
- Fix crash on unset on local IFS within shell functions (bnc#636389)
-------------------------------------------------------------------
Tue Jun 29 16:09:17 CEST 2010 - werner@suse.de

View File

@ -67,6 +67,7 @@ Patch13: ksh93-sigpipe.dif
Patch14: ksh93-ia64.dif
Patch15: ksh93-s390.dif
Patch16: ksh93-leak.dif
Patch17: ksh93-ifs.dif
%global use_suid_exe 0
%global use_locale 1
%global debug_memleak 0
@ -134,6 +135,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf
%endif
%patch15
%patch16
%patch17
%build
typeset -i IGNORED=0x$(ps --no-headers -o ignored $$)
@ -249,10 +251,10 @@ find share/ -type d -a -empty | xargs -r rm -vrf
rm -f ./test64
case "$RPM_ARCH" in
ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
s390*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
ppc*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
esac
RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g')
RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g2')
UNIVERSE=att
LDFLAGS="-lm"
LDSOFLG=""
@ -261,6 +263,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf
cflags @$nobuiltin RPM_OPT_FLAGS
cflags -fno-strict-aliasing RPM_OPT_FLAGS
cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS
cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS
cflags -g RPM_OPT_FLAGS
cflags -pipe RPM_OPT_FLAGS
cflags -Wl,-O2 LDFLAGS

37
ksh93-ifs.dif Normal file
View File

@ -0,0 +1,37 @@
--- src/cmd/ksh93/sh/init.c
+++ src/cmd/ksh93/sh/init.c 2010-10-08 12:43:27.123926224 +0000
@@ -456,6 +456,8 @@ static void put_cdpath(register Namval_t
}
#endif /* _hdr_locale */
+static const void* ifs_hdr;
+
/* Trap for IFS assignment and invalidates state table */
static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp)
{
@@ -464,9 +466,14 @@ static void put_ifs(register Namval_t* n
ip->ifsnp = 0;
if(!val)
{
- fp = nv_stack(np, NIL(Namfun_t*));
- if(fp && !fp->nofree)
- free((void*)fp);
+ Namfun_t *xp = nv_stack(np, NIL(Namfun_t*));
+ if(xp)
+ {
+ if(xp == ifs_hdr)
+ xp->nofree = 1;
+ if(xp->nofree == 0)
+ free((void*)xp);
+ }
}
if(val != np->nvalue.cp)
nv_putv(np, val, flags, fp);
@@ -1597,6 +1604,7 @@ static Init_t *nv_init(Shell_t *shp)
ip->LANG_init.nofree = 1;
#endif /* _hdr_locale */
nv_stack(IFSNOD, &ip->IFS_init.hdr);
+ ifs_hdr = (IFSNOD)->nvfun;
nv_stack(PATHNOD, &ip->PATH_init);
nv_stack(FPATHNOD, &ip->FPATH_init);
nv_stack(CDPNOD, &ip->CDPATH_init);