summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2014-03-25 14:06:34 +0200
committerPanu Matilainen <pmatilai@redhat.com>2014-09-05 14:47:20 +0300
commitbf58bc92ff755448c2542996851976cc39cc63e1 (patch)
tree14287665623863f479d21a71f355a7dde2a8f886
parent175675a1dd96bba53f19ae86b97515c6ead9c32f (diff)
downloadrpm-bf58bc92ff755448c2542996851976cc39cc63e1.tar.gz
Ensure clean paths are used for matching in debugedit (RhBug:1077148)
- Things like extra slashes can cause sources not to be found at all due to path prefix matching, canonicalize the argument paths first. (cherry picked from commit 91456b1bb8e93deef683a9c40b1fe7f1de3da99e)
-rw-r--r--tools/debugedit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/debugedit.c b/tools/debugedit.c
index df7beccce..0f85885e3 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -1541,6 +1541,12 @@ main (int argc, char *argv[])
}
}
+ /* Ensure clean paths, users can muck with these */
+ if (base_dir)
+ canonicalize_path(base_dir, base_dir);
+ if (dest_dir)
+ canonicalize_path(dest_dir, dest_dir);
+
/* Make sure there are trailing slashes in dirs */
if (base_dir != NULL && base_dir[strlen (base_dir)-1] != '/')
{