[OpenWrt-Devel] [PATCH][packages] lighttpd: errorlog failed if running as non root user

Christian Schoenebeck christian.schoenebeck at gmail.com
Tue Jul 22 15:34:07 EDT 2014


From: Christian Schoenebeck <christian.schoenebeck at gmail.com>
Date: Tue, 22 Jul 2014 19:55:43 +0200
Subject: [PATCH][packages] lighttpd: errorlog failed if running as non root user

(log.c.118) opening errorlog '/var/log/lighttpd/server.log' failed: Permission denied
if running as non root user (what's should be the default on web-servers).

Fix: create log directory only if not exist and chmod 777 to allow anyone 
to write and create files inside default log directory

Signed-off-by: Christian Schoenebeck <christian.schoenebeck at gmail.com>
---
 net/lighttpd/files/lighttpd.init | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init
index d73a5da..b318a02 100644
--- a/net/lighttpd/files/lighttpd.init
+++ b/net/lighttpd/files/lighttpd.init
@@ -6,7 +6,8 @@ SERVICE_USE_PID=1
 START=50
 
 start() {
-	mkdir -m 0755 -p /var/log/lighttpd
+	[ -d /var/log/lighttpd ] || mkdir -p /var/log/lighttpd
+	chmod 0777 /var/log/lighttpd
 	service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
 }
 
 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list