]> git.proxmox.com Git - swtpm.git/commitdiff
samples: create lock with name .lock.swtpm-localca rather than .lock
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Sun, 26 Aug 2018 19:26:59 +0000 (15:26 -0400)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Sun, 26 Aug 2018 20:03:53 +0000 (16:03 -0400)
To avoid clashes with the lock files created by swtpm, have
swtpm-localca creata a lock file with the name .lock.swtpm-localca
so they can share directories if necessary.

This patch makes tests/test_tpm2_swtpm_setup_create_cert run on
OpenBSD since the swtpm and swtpm-localca then do not interfere
with the file locks. This doesn't seem to be an issue on Linux
or Cygwin, though, where probably the file locking is implemented
differently.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.om>
samples/swtpm-localca

index bcad117b6459c3b9c8e6ecd62c53a7426d7c77d0..fbaed9866a0b71c92fc07183606e6a56c9d8a1a3 100755 (executable)
@@ -456,7 +456,7 @@ main() {
        fi
        STATEDIR="$tmp"
        make_dir "$STATEDIR"
-       LOCK="${STATEDIR}/.lock"
+       LOCK="${STATEDIR}/.lock.swtpm-localca"
        if [ ! -w ${LOCK} ]; then
                touch $LOCK
                if [ ! -w ${LOCK} ]; then