Browse Source

Update ACL control

Paolo Galli 4 years ago
parent
commit
43b3666c7b
1 changed files with 12 additions and 0 deletions
  1. 12 0
      lcmlog-server-utils

+ 12 - 0
lcmlog-server-utils

@@ -63,6 +63,7 @@ method_init()
 		else
 			echo "Setting up data folder..."
 			mkdir $DIR/data
+			touch $DIR/data/.data
 			echo "Completed."
 		fi
 
@@ -72,6 +73,7 @@ method_init()
 		else
 			echo "Setting up logs folder..."
 			mkdir $DIR/logs
+			touch $DIR/logs/logfile
 			echo "Completed."
 		fi
 
@@ -163,7 +165,9 @@ method_updateACL()
 		# remove old permissions
 		echo "Removing old permissions..."
 		setfacl -b $DIR/data
+		setfacl -b $DIR/data/.data
 		setfacl -b $DIR/logs
+		setfacl -b $DIR/logs/logfile
 
 		# add new permissions
 		echo "Setting up new permissions..."
@@ -171,25 +175,33 @@ method_updateACL()
 		# set 150
 		for uid in $(awk '{print $1}' $DIR/auth/150); do
 			setfacl -m u:$uid:rwx $DIR/data
+			setfacl -m u:$uid:rwx $DIR/data/.data
 			setfacl -m u:$uid:rwx $DIR/logs
+			setfacl -m u:$uid:rwx $DIR/logs/logfile
 		done
 
 		# set admin
 		for uid in $(awk '{print $1}' $DIR/auth/Admin); do
 			setfacl -m u:$uid:rwx $DIR/data
+			setfacl -m u:$uid:rwx $DIR/data/.data
 			setfacl -m u:$uid:rwx $DIR/logs
+			setfacl -m u:$uid:rwx $DIR/logs/logfile
 		done
 		
 		# set ex 150
 		for uid in $(awk '{print $1}' $DIR/auth/Valhalla); do
 			setfacl -m u:$uid:rx $DIR/data
+			setfacl -m u:$uid:rx $DIR/data/.data
 			setfacl -m u:$uid:rwx $DIR/logs
+			setfacl -m u:$uid:rwx $DIR/logs/logfile
 		done
 		
 		# set ex admin
 		for uid in $(awk '{print $1}' $DIR/auth/Nirvana); do
 			setfacl -m u:$uid:rwx $DIR/data
+			setfacl -m u:$uid:rwx $DIR/data/.data
 			setfacl -m u:$uid:rwx $DIR/logs
+			setfacl -m u:$uid:rwx $DIR/logs/logfile
 		done
 
 		echo "Done."