[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779997: unblock: (pre-approval) mksh/50d-4



Control: tag -1 - moreinfo

Hi,

I've just uploaded mksh/50d-5 (as prepared by Thorsten) with the
following debdiff to mksh/50d-3 (i.e. ignoring the broken 50d-4
upload):

diff -Nru mksh-50d/debian/changelog mksh-50d/debian/changelog
--- mksh-50d/debian/changelog	2014-10-23 11:20:27.000000000 +0200
+++ mksh-50d/debian/changelog	2015-03-13 15:28:43.000000000 +0100
@@ -1,3 +1,12 @@
+mksh (50d-5) unstable; urgency=medium
+
+  * QA upload.
+  * Backport upstream fix:
+    - [tg] SECURITY: make unset HISTFILE actually work
+  * Adjust shell version accordingly
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Sat, 07 Mar 2015 22:16:53 +0100
+
 mksh (50d-3) unstable; urgency=high
 
   * QA upload.
diff -Nru mksh-50d/debian/patches/debian-changes mksh-50d/debian/patches/debian-changes
--- mksh-50d/debian/patches/debian-changes	2014-10-23 11:24:49.000000000 +0200
+++ mksh-50d/debian/patches/debian-changes	2015-03-13 15:30:05.000000000 +0100
@@ -18,7 +18,7 @@
  
  expected-stdout:
 -	@(#)MIRBSD KSH R50 2014/10/07
-+	@(#)MIRBSD KSH R50 2014/10/19
++	@(#)MIRBSD KSH R50 2014/10/19 Debian-5
  description:
  	Check version of shell.
  stdin:
@@ -27,7 +27,7 @@
  ---
  expected-stdout:
 -	@(#)LEGACY KSH R50 2014/10/07
-+	@(#)LEGACY KSH R50 2014/10/19
++	@(#)LEGACY KSH R50 2014/10/19 Debian-5
  description:
  	Check version of legacy shell.
  stdin:
@@ -531,6 +531,39 @@
  	/* set $# and $* */
  	if (setargs) {
  		wp += argi - 1;
+--- mksh-50d.orig/histrap.c
++++ mksh-50d/histrap.c
+@@ -563,7 +563,7 @@ sethistfile(const char *name)
+ 		return;
+ 
+ 	/* if the name is the same as the name we have */
+-	if (hname && strcmp(hname, name) == 0)
++	if (hname && name && !strcmp(hname, name))
+ 		return;
+ 
+ 	/*
+@@ -581,7 +581,8 @@ sethistfile(const char *name)
+ 		hist_source->line = 0;
+ 	}
+ 
+-	hist_init(hist_source);
++	if (name)
++		hist_init(hist_source);
+ }
+ #endif
+ 
+@@ -713,8 +714,10 @@ hist_init(Source *s)
+ 	hist_source = s;
+ 
+ #if HAVE_PERSISTENT_HISTORY
+-	if ((hname = str_val(global("HISTFILE"))) == NULL)
++	if (((hname = str_val(global("HISTFILE"))) == NULL) || !*hname) {
++		hname = NULL;
+ 		return;
++	}
+ 	strdupx(hname, hname, APERM);
+ 	hs = hist_init_first;
+ 
 --- mksh-50d.orig/main.c
 +++ mksh-50d/main.c
 @@ -34,7 +34,7 @@
@@ -561,7 +594,7 @@
 +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.701 2014/10/19 21:53:08 tg Exp $");
  #endif
 -#define MKSH_VERSION "R50 2014/10/07"
-+#define MKSH_VERSION "R50 2014/10/19"
++#define MKSH_VERSION "R50 2014/10/19 Debian-5"
  
  /* arithmetic types: C implementation */
  #if !HAVE_CAN_INTTYPES
@@ -585,3 +618,17 @@
  
  #define X_EXTRA	20	/* this many extra bytes in X string */
  
+--- mksh-50d.orig/var.c
++++ mksh-50d/var.c
+@@ -1351,6 +1351,11 @@ unsetspec(struct tbl *vp)
+ 	 */
+ 
+ 	switch (special(vp->name)) {
++#if HAVE_PERSISTENT_HISTORY
++	case V_HISTFILE:
++		sethistfile(NULL);
++		return;
++#endif
+ 	case V_IFS:
+ 		setctypes(TC_IFSWS, C_IFS);
+ 		ifs0 = ' ';

It already built fine on all platforms except sparc (still at
needs-build as of now):
https://buildd.debian.org/status/package.php?p=mksh&suite=unstable

Please verify that I indeed upload a non-broken package this time. :-)

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE

Attachment: signature.asc
Description: Digital signature


Reply to: