SECURITY: make “unset HISTFILE” really work

additionally, make “HISTFILE=” the same, document the truncation and
re-reading process’ further and already-known bugs; this needs work
This commit is contained in:
tg
2015-03-07 20:46:31 +00:00
parent d3f3c3ec22
commit be147e3426
5 changed files with 36 additions and 15 deletions

7
var.c
View File

@@ -28,7 +28,7 @@
#include <sys/sysctl.h>
#endif
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.186 2015/02/06 10:56:49 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.187 2015/03/07 20:46:31 tg Exp $");
/*-
* Variables
@@ -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 = ' ';