]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Ensure static-master-update-component runs as the right user
authorPeter Palfrader <peter@palfrader.org>
Sat, 22 Dec 2012 20:06:24 +0000 (21:06 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 22 Dec 2012 20:06:24 +0000 (21:06 +0100)
modules/roles/files/static-mirroring/static-master-update-component

index 6f7ff03aae6c6515b3f6209dc50b0c048fd21118..f2ea1165367cbf69edf5a1561210edcf4e81fc33 100755 (executable)
@@ -35,6 +35,10 @@ base=/home/staticsync/static-master/master
 set -e
 set -u
 
+if [ "`id -u`" != "`stat -c %u "$base"`" ]; then
+  echo >&2 "You are probably running this as the wrong user."
+  exit 1
+fi
 
 lock() {
   local fd="$1"; shift