Skip to content

Commit c6611ee

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
use mktemp in update scripts to avoid race conditions See merge request !254
2 parents ea30e1c + 2c7813b commit c6611ee

File tree

5 files changed

+36
-20
lines changed

5 files changed

+36
-20
lines changed

interface/lib/classes/validate_dkim.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
3131
@author Florian Schaal, info@schaal-24.de
32-
@copyrighth Florian Schaal, info@schaal-24.de
32+
@copyright Florian Schaal, info@schaal-24.de
3333
*/
3434

3535

interface/lib/classes/validate_openvz.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
3030
@author Florian Schaal, info@schaal-24.de
31-
@copyrighth Florian Schaal, info@schaal-24.de
31+
@copyright Florian Schaal, info@schaal-24.de
3232
*/
3333

3434
class validate_openvz {

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
3131
@author Florian Schaal, info@schaal-24.de
32-
@copyrighth Florian Schaal, info@schaal-24.de
32+
@copyright Florian Schaal, info@schaal-24.de
3333
*/
3434

3535

server/scripts/update_from_dev.sh

100644100755
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
#!/bin/bash
22

3-
cd /tmp
4-
rm -f ispconfig3-dev.tar.gz
3+
{
4+
umask 0077 \
5+
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
6+
&& test -d "${tmpdir}" \
7+
&& cd "${tmpdir}"
8+
} || {
9+
echo 'mktemp failed'
10+
exit 1
11+
}
12+
513
wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
6-
rm -rf ispconfig3-master*
714
tar xzf ispconfig3-dev.tar.gz
15+
16+
echo -n "Latest git version: "
17+
ls -1d ispconfig3-master*
818
cd ispconfig3-master*/install
19+
920
php -q \
1021
-d disable_classes= \
1122
-d disable_functions= \
1223
-d open_basedir= \
1324
update.php
25+
1426
cd /tmp
15-
rm -rf /tmp/ispconfig3-master* /tmp/ispconfig3-dev.tar.gz
27+
rm -rf "${tmpdir}"
1628

1729
exit 0

server/scripts/update_from_tgz.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
#!/bin/bash
22

3-
cd /tmp
4-
5-
if [ -f ISPConfig-3-stable.tar.gz ]
6-
then
7-
rm -f ISPConfig-3-stable.tar.gz
8-
fi
3+
{
4+
umask 0077 \
5+
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
6+
&& test -d "${tmpdir}" \
7+
&& cd "${tmpdir}"
8+
} || {
9+
echo 'mktemp failed'
10+
exit 1
11+
}
912

1013
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
1114
if [ -f ISPConfig-3-stable.tar.gz ]
1215
then
1316
tar xvfz ISPConfig-3-stable.tar.gz
1417
cd ispconfig3_install/install/
1518
php -q \
16-
-d disable_classes= \
17-
-d disable_functions= \
18-
-d open_basedir= \
19-
update.php
20-
rm -rf /tmp/ispconfig3_install/install
21-
rm -f ISPConfig-3-stable.tar.gz
19+
-d disable_classes= \
20+
-d disable_functions= \
21+
-d open_basedir= \
22+
update.php
23+
cd /tmp
24+
rm -rf "${tmpdir}"
2225
else
2326
echo "Unable to download the update."
27+
exit 1
2428
fi
2529

26-
exit 0
30+
exit 0

0 commit comments

Comments
 (0)