Hello community, here is the log from the commit of package ksh for openSUSE:Factory checked in at 2012-10-26 17:11:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ksh (Old) and /work/SRC/openSUSE:Factory/.ksh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ksh", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/ksh/ksh.changes 2012-10-19 13:32:07.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ksh.new/ksh.changes 2012-10-26 17:11:33.000000000 +0200 @@ -1,0 +2,22 @@ +Thu Oct 25 12:09:48 UTC 2012 - [email protected] + +- Make last patch smart that is use /dev/shm for temporary file + descriptors + +------------------------------------------------------------------- +Tue Oct 23 13:23:12 UTC 2012 - [email protected] + +- Add a workaround for filled /tmp file systems (bnc#786134) +- Check for subshell if tmp file can be used otherwise use a + a pipe (bnc#786134) +- Restore shell variables before any outpur will be placed in + a temp file or buffer (bnc#786134) + +------------------------------------------------------------------- +Fri Oct 19 15:06:50 UTC 2012 - [email protected] + +- Be able to export justified and zerofilled variables (bnc#785360) +- This requires that variables with this attributes should be really + cleared if unset + +------------------------------------------------------------------- New: ---- ksh93-pathtemp.dif ksh93-zerofill.dif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ksh.spec ++++++ --- /var/tmp/diff_new_pack.cuvVDR/_old 2012-10-26 17:11:36.000000000 +0200 +++ /var/tmp/diff_new_pack.cuvVDR/_new 2012-10-26 17:11:36.000000000 +0200 @@ -111,6 +111,8 @@ Patch26: ksh93-read-dont-ignore-esc.dif Patch27: astksh_builtin_poll20120806_001.diff Patch28: ksh93-env.dif +Patch29: ksh93-zerofill.dif +Patch30: ksh93-pathtemp.dif Patch42: ksh-locale.patch %description @@ -195,6 +197,8 @@ %patch26 %patch27 %patch28 +%patch29 +%patch30 %build # ++++++ ksh93-pathtemp.dif ++++++ --- src/cmd/ksh93/bltins/trap.c +++ src/cmd/ksh93/bltins/trap.c 2012-10-23 15:45:37.000000000 +0000 @@ -102,6 +102,7 @@ int b_trap(int argc,char *argv[],Shbltin /* internal traps */ if(sig&SH_TRAP) { + char **trap = (shp->st.otrap?shp->st.otrap:shp->st.trap); sig &= ~SH_TRAP; if(sig>SH_DEBUGTRAP) { @@ -110,10 +111,11 @@ int b_trap(int argc,char *argv[],Shbltin } if(pflag) { - if(arg=shp->st.trap[sig]) + if(arg=trap[sig]) sfputr(sfstdout,sh_fmtq(arg),'\n'); continue; } + shp->st.otrap = 0; if(shp->st.trap[sig]) free(shp->st.trap[sig]); shp->st.trap[sig] = 0; @@ -402,7 +404,7 @@ static void sig_list(register Shell_t *s } for(sig=SH_DEBUGTRAP; sig>=0; sig--) { - if(!(trap=shp->st.trap[sig])) + if(!(trap=shp->st.otrap?shp->st.otrap[sig]:shp->st.trap[sig])) continue; sfprintf(sfstdout,trapfmt,sh_fmtq(trap),traps[sig]); } --- src/cmd/ksh93/include/defs.h +++ src/cmd/ksh93/include/defs.h 2012-10-23 15:42:45.000000000 +0000 @@ -90,6 +90,7 @@ struct sh_scoped int ioset; unsigned short trapmax; char *trap[SH_DEBUGTRAP+1]; + char **otrap; char **trapcom; char **otrapcom; void *timetrap; --- src/cmd/ksh93/include/shnodes.h +++ src/cmd/ksh93/include/shnodes.h 2012-10-23 14:23:06.000000000 +0000 @@ -211,7 +211,7 @@ union Shnode_u extern void sh_freeup(Shell_t*); extern void sh_funstaks(struct slnod*,int); -extern Sfio_t *sh_subshell(Shell_t*,Shnode_t*, int, int); +extern Sfio_t *sh_subshell(Shell_t*,Shnode_t*, volatile int, int); #if defined(__EXPORT__) && defined(_BLD_DLL) && defined(_BLD_shell) __EXPORT__ #endif --- src/cmd/ksh93/sh/subshell.c +++ src/cmd/ksh93/sh/subshell.c 2012-10-25 10:09:34.574345265 +0000 @@ -455,7 +455,7 @@ void sh_subjobcheck(pid_t pid) * output of command <t>. Otherwise, NULL will be returned. */ -Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, int flags, int comsub) +Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub) { struct subshell sub_data; register struct subshell *sp = &sub_data; @@ -528,6 +528,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_ sh_stats(STAT_SUBSHELL); /* save trap table */ shp->st.otrapcom = 0; + shp->st.otrap = savst.trap; if((nsig=shp->st.trapmax*sizeof(char*))>0 || shp->st.trapcom[0]) { nsig += sizeof(char*); @@ -602,6 +603,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_ } if(!shp->savesig) shp->savesig = -1; + nv_restore(sp); if(comsub) { /* re-enable job control */ @@ -666,7 +668,6 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_ { int n; shp->options = sp->options; - nv_restore(sp); if(sp->salias) { shp->alias_tree = dtview(sp->salias,0); @@ -685,6 +686,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_ memset(&shp->st.trapcom[savst.trapmax],0,n*sizeof(char*)); shp->st = savst; shp->curenv = savecurenv; + shp->st.otrap = 0; if(nsig) { memcpy((char*)&shp->st.trapcom[0],savsig,nsig); --- src/lib/libast/path/pathtemp.c +++ src/lib/libast/path/pathtemp.c 2012-10-25 10:35:14.510345073 +0000 @@ -73,15 +73,49 @@ #include <ls.h> #include <tv.h> #include <tm.h> +#include <error.h> #define ATTEMPT 10 #define TMP_ENV "TMPDIR" #define TMP_PATH_ENV "TMPPATH" #define TMP1 "/tmp" -#define TMP2 "/usr/tmp" +#define TMP2 "/var/tmp" -#define VALID(d) (*(d)&&!eaccess(d,W_OK|X_OK)) +static inline int xaccess(const char *path, int mode) +{ + static size_t pgsz; + struct statvfs vfs; + int ret; + + if (!pgsz) + pgsz = strtoul(astconf("PAGESIZE",NiL,NiL),NiL,0); + + if (!path || !*path) + { + errno = EFAULT; + goto err; + } + + do + ret = statvfs(path, &vfs); + while (ret < 0 && errno == EINTR); + + if (ret < 0) + goto err; + + if (vfs.f_frsize*vfs.f_bavail < pgsz) + { + errno = ENOSPC; + goto err; + } + + return eaccess(path, mode); +err: + return -1; +} + +#define VALID(d) (*(d)&&!xaccess(d,W_OK|X_OK)) static struct { @@ -182,7 +216,7 @@ pathtemp(char* buf, size_t len, const ch tv.tv_nsec = 0; else tvgettime(&tv); - if (!(d = (char*)dir) || *d && eaccess(d, W_OK|X_OK)) + if (!(d = (char*)dir) || (*d && xaccess(d, W_OK|X_OK))) { if (!tmp.vec) { @@ -227,7 +261,7 @@ pathtemp(char* buf, size_t len, const ch tmp.dir = tmp.vec; d = *tmp.dir++; } - if (!d && (!*(d = astconf("TMP", NiL, NiL)) || eaccess(d, W_OK|X_OK)) && eaccess(d = TMP1, W_OK|X_OK) && eaccess(d = TMP2, W_OK|X_OK)) + if (!d && (!*(d = astconf("TMP", NiL, NiL)) || xaccess(d, W_OK|X_OK)) && xaccess(d = TMP1, W_OK|X_OK) && xaccess(d = TMP2, W_OK|X_OK)) return 0; } if (!len) --- src/lib/libast/sfio/sftmp.c +++ src/lib/libast/sfio/sftmp.c 2012-10-25 12:09:18.026344912 +0000 @@ -20,6 +20,14 @@ * * ***********************************************************************/ #include "sfhdr.h" +#if _PACKAGE_ast +# if defined(__linux__) && _lib_statfs +# include <sys/statfs.h> +# ifndef TMPFS_MAGIC +# define TMPFS_MAGIC 0x01021994 +# endif +# endif +#endif /* Create a temporary stream for read/write. ** The stream is originally created as a memory-resident stream. @@ -207,7 +215,24 @@ Sfio_t* f; int fd; #if _PACKAGE_ast +# if defined(__linux__) && _lib_statfs + /* + * Use the area of POSIX shared memory objects for the new temporary file descriptor + * that is do not access HD or SSD but only the memory based tmpfs of the POSIX SHM + */ + static int doshm; + static char *shm = "/dev/shm"; + if (!doshm) + { + struct statfs fs; + if (statfs(shm, &fs) < 0 || fs.f_type != TMPFS_MAGIC || eaccess(shm, W_OK|X_OK)) + shm = NiL; + doshm++; + } + if(!(file = pathtemp(NiL,PATH_MAX,shm,"sf",&fd))) +# else if(!(file = pathtemp(NiL,PATH_MAX,NiL,"sf",&fd))) +# endif return -1; _rmtmp(f, file); free(file); ++++++ ksh93-zerofill.dif ++++++ --- src/cmd/ksh93/bltins/typeset.c +++ src/cmd/ksh93/bltins/typeset.c 2012-10-19 16:56:48.561818559 +0200 @@ -746,6 +746,7 @@ } if (tp->aflag == '-') { + int oldnum; if((flag&NV_EXPORT) && (strchr(name,'.') || nv_isvtree(np))) errormsg(SH_DICT,ERROR_exit(1),e_badexport,name); #if SHOPT_BSH @@ -764,6 +765,9 @@ else if(!(flag&NV_LJUST)) newflag &= ~NV_LJUST; } + oldnum = nv_size(np); + if (oldnum > 0) + tp->argnum = oldnum; } else { @@ -1222,7 +1226,7 @@ if(shp->subshell) np=sh_assignok(np,0); } - if(!nv_isnull(np)) + if(!nv_isnull(np) || nv_size(np) || nv_isattr(np,~(NV_MINIMAL|NV_NOFREE))) _nv_unset(np,0); if(troot==shp->var_tree && shp->st.real_fun && (dp=shp->var_tree->walk) && dp==shp->st.real_fun->sdict) nv_delete(np,dp,NV_NOFREE); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
