From 8e2d9cd5ab9aabbfe1e65f635e7a10c473240d69 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 26 Sep 2007 04:41:34 +0000 Subject: Bug #74615 - Quote all file paths inside dispatch-conf shell commands. (trunk r7803) svn path=/main/branches/2.1.2/; revision=7831 --- bin/dispatch-conf | 6 +++--- cnf/dispatch-conf.conf | 4 ++-- pym/dispatch_conf.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 6e7ab71f6..5d33343f7 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -29,9 +29,9 @@ import dispatch_conf from portage_exec import find_binary FIND_EXTANT_CONFIGS = "find '%s' %s -iname '._cfg????_%s' ! -iname '.*~' ! -iname '.*.bak'" -DIFF_CONTENTS = 'diff -Nu %s %s' -DIFF_CVS_INTERP = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"' -DIFF_WSCOMMENTS = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"' +DIFF_CONTENTS = "diff -Nu '%s' '%s'" +DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'" +DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'" # We need a secure scratch dir and python does silly verbose errors on the use of tempnam oldmask = os.umask(0077) diff --git a/cnf/dispatch-conf.conf b/cnf/dispatch-conf.conf index d4caa9557..d9ccc12a6 100644 --- a/cnf/dispatch-conf.conf +++ b/cnf/dispatch-conf.conf @@ -12,13 +12,13 @@ use-rcs=no # Diff for display # %s old file # %s new file -diff="diff -Nu %s %s | less --no-init --QUIT-AT-EOF" +diff="diff -Nu '%s' '%s' | less --no-init --QUIT-AT-EOF" # Diff for interactive merges. # %s output file # %s old file # %s new file -merge="sdiff --suppress-common-lines --output=%s %s %s" +merge="sdiff --suppress-common-lines --output='%s' '%s' '%s'" # Automerge files comprising only CVS interpolations (e.g. Header or Id) # (yes or no) diff --git a/pym/dispatch_conf.py b/pym/dispatch_conf.py index 690772bf8..860ffea30 100644 --- a/pym/dispatch_conf.py +++ b/pym/dispatch_conf.py @@ -16,9 +16,9 @@ RCS_BRANCH = '1.1.1' RCS_LOCK = 'rcs -ko -M -l' RCS_PUT = 'ci -t-"Archived config file." -m"dispatch-conf update."' RCS_GET = 'co' -RCS_MERGE = 'rcsmerge -p -r' + RCS_BRANCH + ' %s >%s' +RCS_MERGE = "rcsmerge -p -r" + RCS_BRANCH + " '%s' > '%s'" -DIFF3_MERGE = 'diff3 -mE %s %s %s >%s' +DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'" def read_config(mandatory_opts): try: @@ -33,7 +33,7 @@ def read_config(mandatory_opts): for key in mandatory_opts: if not opts.has_key(key): if key == "merge": - opts["merge"] = "sdiff --suppress-common-lines --output=%s %s %s" + opts["merge"] = "sdiff --suppress-common-lines --output='%s' '%s' '%s'" else: print >> sys.stderr, 'dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal' % (key,) @@ -106,7 +106,7 @@ def file_archive(archive, curconf, newconf, mrgconf): # Archive the current config file if it isn't already saved if os.path.exists(archive) \ - and len(commands.getoutput('diff -aq %s %s' % (curconf,archive))) != 0: + and len(commands.getoutput("diff -aq '%s' '%s'" % (curconf,archive))) != 0: suf = 1 while suf < 9 and os.path.exists(archive + '.' + str(suf)): suf += 1 -- cgit v1.2.3-1-g7c22