Invoke tar(1) with the -p option when installing a package

from an URL (i.e., do it the same way as when installing
from a file).  This fixes the lossage of the setuid bits.
It wasn't a problem before because GNU tar(1) implied the
-p option for root, but BSD tar(1) doesn't do that.

Discussed with:	tobez and some advanced users :)
This commit is contained in:
Ruslan Ermilov 2007-03-06 14:54:45 +00:00
parent 55b8273c83
commit d73d2e1de2

View File

@ -142,9 +142,9 @@ fileGetURL(const char *base, const char *spec, int keep_package)
close(fd);
execl("/usr/bin/tar", "tar",
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
Verbose ? "-xjvf" : "-xjf",
Verbose ? "-xpjvf" : "-xpjf",
#else
Verbose ? "-xzvf" : "-xzf",
Verbose ? "-xpzvf" : "-xpzf",
#endif
"-", (char *)0);
_exit(2);