summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2013-09-19 01:35:59 +0000
committerMichael Stapelberg <michael@stapelberg.de>2013-09-19 01:35:59 +0000
commit4af0725a7eaf98d49aa1700149a72467925afb3b (patch)
tree5092d6dcbd300a4f642c9c3be4810f6ca89a55d1
parent0944f6a261739c299495dac7fa4711ca59c22853 (diff)
downloadinit-system-helpers-4af0725a7eaf98d49aa1700149a72467925afb3b.tar.gz
d-s-h: add safety check for unmask
-rwxr-xr-xscript/deb-systemd-helper6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/deb-systemd-helper b/script/deb-systemd-helper
index 18ca4a4..c11f30f 100755
--- a/script/deb-systemd-helper
+++ b/script/deb-systemd-helper
@@ -416,7 +416,11 @@ sub unmask_service {
my @entries = state_file_entries($statefile);
- unlink($service_link) if -l $service_link;
+ if (! -l $service_link || readlink($service_link) ne '/dev/null') {
+ debug "Not unmasking $service_link because it is not a link to /dev/null";
+ next;
+ }
+ unlink($service_link);
if (@entries > 0) {
my $service_path = $entries[0];