From 7203768930e92271702ae96ddfc9e27b808d28b6 Mon Sep 17 00:00:00 2001 From: Andreas Hasenack Date: Fri, 11 Jan 2008 18:08:37 +0000 Subject: - fix infinitely growing kdmrc with set variable AllowShutdown to None (#12821) --- Makefile | 2 +- share/ConfigFile.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e1d23f..ba29b4c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE = msec -VERSION = 0.50.4 +VERSION = 0.50.5 SVNPATH = svn+ssh://svn.mandriva.com/svn/soft/msec all: promisc_check msec_find python diff --git a/share/ConfigFile.py b/share/ConfigFile.py index 4b89d53..26a93e6 100644 --- a/share/ConfigFile.py +++ b/share/ConfigFile.py @@ -201,6 +201,7 @@ class ConfigFile: lines = self.get_lines() idx=0 value=str(value) + start_regexp = start if start: status = BEFORE @@ -231,6 +232,10 @@ class ConfigFile: self.modified() log(_('set variable %s to %s in %s') % (var, value, self.path,)) return self + if status == BEFORE: + # never found the start delimiter + log(_('WARNING: never found regexp %s in %s, not writing changes') % (start_regexp, self.path)) + return self if space.search(value): s = var + '="' + value + '"' else: -- cgit v1.2.1