diff options
author | bmah <bmah@FreeBSD.org> | 2001-02-09 20:07:06 +0000 |
---|---|---|
committer | bmah <bmah@FreeBSD.org> | 2001-02-09 20:07:06 +0000 |
commit | fcdd10fefc48869cc1fbebf3946aa47c0bde6293 (patch) | |
tree | 482264b2c0bfa22499ed9b87183f6f8a18547f61 | |
parent | c90a74625467e4820dd5d3ae10a6be8a81173e53 (diff) | |
download | FreeBSD-src-fcdd10fefc48869cc1fbebf3946aa47c0bde6293.zip FreeBSD-src-fcdd10fefc48869cc1fbebf3946aa47c0bde6293.tar.gz |
Prevent the commands output of pkg_version.pl from being executed without the
user actually editing the output. Too many people were rampantly abusing
this feature via "pkg_version -c | sh" without really being cognizant
of the dangers involved (ports upgrade kits) or the fact that it
just plain wasn't designed for it (dependencies). We'll try to keep
people from shooting themselves in the foot.
Will be MFC-ed to RELENG_4 and RELENG_3 after cooling-off period.
-rwxr-xr-x | usr.sbin/pkg_install/version/pkg_version.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/version/pkg_version.pl b/usr.sbin/pkg_install/version/pkg_version.pl index 633e107..3a57510 100755 --- a/usr.sbin/pkg_install/version/pkg_version.pl +++ b/usr.sbin/pkg_install/version/pkg_version.pl @@ -325,6 +325,20 @@ while (<INDEX>) { close INDEX; # +# If we're doing commands output, cripple the output so that users +# can't just pipe the output to sh(1) and expect this to work. +# +if ($ShowCommandsFlag) { + print<<EOF +echo "The commands output of pkg_version cannot be executed without editing." +echo "You MUST save this output to a file and then edit it, taking into" +echo "account package dependencies and the fact that some packages cannot" +echo "or should not be upgraded." +exit 1 +EOF +} + +# # Produce reports # # Prior versions of pkg_version used commas (",") as delimiters |