From ea891ea8d3dc52a70f306b102dd59d4a40fa4781 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 22 Dec 2012 21:06:24 +0100 Subject: [PATCH] Ensure static-master-update-component runs as the right user --- .../files/static-mirroring/static-master-update-component | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/roles/files/static-mirroring/static-master-update-component b/modules/roles/files/static-mirroring/static-master-update-component index 6f7ff03aa..f2ea11653 100755 --- a/modules/roles/files/static-mirroring/static-master-update-component +++ b/modules/roles/files/static-mirroring/static-master-update-component @@ -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 -- 2.20.1