From b9d1fc0c85e9bd18e5e768913ba2c0a00f19876c Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 19 Nov 2005 16:04:25 +0000 Subject: [PATCH] Special-case an MHCONTEXT of "/dev/null" and don't try to lock it -- some user scripts may use this to suppress modification of context. --- ChangeLog | 5 +++++ sbr/context_read.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ab8f4a..e8ba4c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-19 Peter Maydell + + * bug #14977: sbr/context_read.c: special case an MHCONTEXT of + "/dev/null" and don't try to lock it. + 2005-11-09 Peter Maydell * sbr/mf.c: fix buffer overrun with absurdly long addresses diff --git a/sbr/context_read.c b/sbr/context_read.c index fcc12f9..6a1eea1 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -120,8 +120,11 @@ context_read (void) if ((cp = getenv ("MHCONTEXT")) == (char *)0 || *cp == '\0') cp = context; - /* context is NULL if context_foil() was called to disable use of context */ - if (!cp) { + /* context is NULL if context_foil() was called to disable use of context + * We also support users setting explicitly setting MHCONTEXT to /dev/null. + * (if this wasn't specialcased then the locking would be liable to fail) + */ + if (!cp || (strcmp(cp,"/dev/null") == 0)) { ctxpath = NULL; return; } -- 1.7.10.4