From 9392655b2ad3d7044e84dc8b331e47e0deed3e2f Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 3 Jun 2013 13:59:28 +0300 Subject: [PATCH] enable symlink protection only if nginx is higher than 1.0 --- upd/convert-templates.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upd/convert-templates.sh b/upd/convert-templates.sh index 7d77b6060..3f5c332d8 100755 --- a/upd/convert-templates.sh +++ b/upd/convert-templates.sh @@ -117,7 +117,8 @@ sed -i '/Symlinks protection/d' /etc/nginx/nginx.conf sed -i '/disable_symlinks.*/d' /etc/nginx/nginx.conf # Add improved symlink protection -if [ -e "$TPL/nginx" ]; then +nginx_version=$(rpm -q nginx| grep nginx-1| cut -f 2 -d .) +if [ -e "/tmp/nginx" ] && [[ "$nginx_version" -gt '0' ]]; then for tpl in $(ls $TPL/nginx |grep -v proxy_ip.tpl); do check_symlink=$(grep disable_symlinks $TPL/nginx/$tpl) if [ -z "$check_symlink" ]; then