aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2005-07-29 11:28:03 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2005-07-29 11:28:03 +0000
commit8b4c82b30ee276edd1974c5f088f65754961e883 (patch)
treec7443de14a283b43a8a596b118ffacd6867f7158 /tools
parent614232077b80467ed64c53acf77591f3b6648b27 (diff)
downloadsrc-8b4c82b30ee276edd1974c5f088f65754961e883.tar.gz
src-8b4c82b30ee276edd1974c5f088f65754961e883.zip
In realpath(), make sure each path component consists only of safe
characters, and untaint it.
Notes
Notes: svn path=/head/; revision=148513
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/tinderbox/tbmaster.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/tools/tinderbox/tbmaster.pl b/tools/tools/tinderbox/tbmaster.pl
index b48545f41515..71751a1797df 100644
--- a/tools/tools/tinderbox/tbmaster.pl
+++ b/tools/tools/tinderbox/tbmaster.pl
@@ -91,7 +91,9 @@ sub realpath($;$) {
or die("unable to resolve symlink '$realpath/$part': $!\n");
$realpath = realpath($target, $realpath);
} else {
- $realpath .= "/$part";
+ $part =~ m/^([\w.-]+)$/
+ or die("unsafe path '$realpath/$part'\n");
+ $realpath .= "/$1";
}
}
return $realpath;