summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@phys.columbia.edu>2008-06-23 18:53:20 -0400
committerJameson Graef Rollins <jrollins@phys.columbia.edu>2008-06-23 18:53:20 -0400
commitda4eaf98b33ae5acd3280f4fa4dbe023997135dd (patch)
tree6e546de5c0c8f2a1564a9e18813e428ae6b9bd66 /src/common
parent16db05446adda4fd53e22e5859ea8c498f190097 (diff)
Add trap to remove lockfiles on exit.
Diffstat (limited to 'src/common')
-rw-r--r--src/common6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common b/src/common
index 9dcc5e8..1908022 100644
--- a/src/common
+++ b/src/common
@@ -445,6 +445,9 @@ update_known_hosts() {
# least one host
returnCode=0
+ # set the trap to remove any lockfiles on exit
+ trap "lockfile-remove $KNOWN_HOSTS" EXIT
+
# create a lockfile on known_hosts
lockfile-create "$KNOWN_HOSTS"
@@ -526,6 +529,9 @@ update_authorized_keys() {
# at least one user ID
returnCode=0
+ # set the trap to remove any lockfiles on exit
+ trap "lockfile-remove $AUTHORIZED_KEYS" EXIT
+
# create a lockfile on authorized_keys
lockfile-create "$AUTHORIZED_KEYS"