aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2013-11-05 11:54:00 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:12 +0100
commit3bec7de52cfbb3c66ed1b1af10006ff393fbef03 (patch)
tree438cffd90feec94d4900a78d2fbfd76e2f9384c2
parent750f18b9ec920fabf30d1de931b4bc7af023e4d8 (diff)
downloadexternal_parameter-framework-3bec7de52cfbb3c66ed1b1af10006ff393fbef03.zip
external_parameter-framework-3bec7de52cfbb3c66ed1b1af10006ff393fbef03.tar.gz
external_parameter-framework-3bec7de52cfbb3c66ed1b1af10006ff393fbef03.tar.bz2
hostDomainGenerator.sh: fix lock permissions
BZ: 149851 The hostDomainGenerator.sh script uses a lockfile to protect some operations from concurrent execution. This mechanism uses a file that is created if it does not already exist. In this case, the file permissions are too stricts, and other users are unable to run the script anymore. This patch changes the permission on the lockfile, allowing other users to access it. Change-Id: Iec250a4022cb8f97973fa92020b27dc0e83890c6 Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
-rwxr-xr-xtools/xmlGenerator/hostDomainGenerator.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/xmlGenerator/hostDomainGenerator.sh b/tools/xmlGenerator/hostDomainGenerator.sh
index 2e10613..8cc815a 100755
--- a/tools/xmlGenerator/hostDomainGenerator.sh
+++ b/tools/xmlGenerator/hostDomainGenerator.sh
@@ -69,6 +69,7 @@ PFWStartTimeout=60
tmpFile=$(mktemp)
testPlatformPID=0
+lockFile="/var/lock/.hostDomainGenerator.lockfile"
# [Workaround]
# The build system does not preserve execution right in external prebuild
@@ -87,6 +88,10 @@ clean_up () {
echo "Clean sub process: $testPlatformPID"
test $testPlatformPID != 0 && kill $testPlatformPID 2>&1
rm "$tmpFile"
+
+ # Delete the lockfile
+ rm -f $lockFile
+
return $status
}
@@ -227,7 +232,11 @@ linkLibrary libremote-processor_host.so libremote-processor.so
# between potential concurrent execution of this script
#
# Acquire an exclusive lock on the file descriptor 200
-exec 200>/var/lock/.hostDomainGenerator.lockfile
+# The file used for locking must be created with non restrictive permissions, so
+# that the script can be used by multiple users.
+exec 200>$lockFile
+chmod -f 777 $lockFile || true
+
flock --timeout $PFWStartTimeout 200
# Start the pfw using different socket if it fails