1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-31 10:46:16 +00:00

Backport security fix from version 1.160.

VuXML entry: ae7b7f65-05c7-11d9-b45d-000c41e2cdad.

Approved by:	portmgr
This commit is contained in:
Jimmy Olgeni 2004-09-15 17:19:53 +00:00
parent df8a93b656
commit fde6b1c54a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=118185
2 changed files with 35 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= webmin
PORTVERSION= 1.150
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= sysutils
MASTER_SITES= http://www.webmin.com/updates/ \
${MASTER_SITE_SOURCEFORGE}

View File

@ -0,0 +1,34 @@
$FreeBSD$
--- maketemp.pl.orig Wed Sep 15 00:00:08 2004
+++ maketemp.pl Wed Sep 15 00:00:19 2004
@@ -3,17 +3,16 @@
$tmp_dir = $ENV{'tempdir'} || "/tmp/.webmin";
-if (!-d $tmp_dir) {
- mkdir($tmp_dir, 0755) || exit 1;
- }
-chown($<, $(, $tmp_dir);
-chmod(0755, $tmp_dir);
-@st = lstat($tmp_dir);
-if (@st && $st[4] == $< && (-d _) &&
- ($st[2] & 0777) == 0755) {
- exit 0;
- }
-else {
- exit 1;
+while($tries++ < 10) {
+ local @st = lstat($tmp_dir);
+ exit(0) if ($st[4] == $< && (-d _) && ($st[2] & 0777) == 0755);
+ if (@st) {
+ unlink($tmp_dir) || rmdir($tmp_dir) ||
+ system("/bin/rm -rf ".quotemeta($tmp_dir));
+ }
+ mkdir($tmp_dir, 0755) || next;
+ chown($<, $(, $tmp_dir);
+ chmod(0755, $tmp_dir);
}
+exit(1);