diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-07-29 11:28:03 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-07-29 11:28:03 +0000 |
commit | 8b4c82b30ee276edd1974c5f088f65754961e883 (patch) | |
tree | c7443de14a283b43a8a596b118ffacd6867f7158 /tools | |
parent | 614232077b80467ed64c53acf77591f3b6648b27 (diff) | |
download | src-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.pl | 4 |
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; |