aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-04-08 22:57:42 +0000
committerRoy Marples <roy@marples.name>2008-04-08 22:57:42 +0000
commit87597357116dffd4e1136c16aab431844877a247 (patch)
tree799477bf981dcbd27e8ebd1f31a9b566e80f1013 /src
parent034b9b7a12228bfa9171aae2b578c649ff1de54e (diff)
Give an error when running zap as a generic user.
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc.c7
-rw-r--r--src/rc/runscript.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index afd20d5f..c94c7a4b 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -501,7 +501,7 @@ bool rc_service_mark(const char *service, const RC_SERVICE state)
base = basename_c(service);
if (state != RC_SERVICE_STOPPED) {
- if (! exists(init)) {
+ if (!exists(init)) {
free(init);
return false;
}
@@ -547,7 +547,10 @@ bool rc_service_mark(const char *service, const RC_SERVICE state)
symlink(init, was);
skip_wasinactive = true;
}
- unlink(file);
+ if (unlink(file) == -1) {
+ free(init);
+ return false;
+ }
}
}
}
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index c2cef71c..2f96d7ac 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -1306,7 +1306,8 @@ int runscript(int argc, char **argv)
}
} else if (strcmp(optarg, "zap") == 0) {
einfo("Manually resetting %s to stopped state", applet);
- rc_service_mark(applet, RC_SERVICE_STOPPED);
+ if (!rc_service_mark(applet, RC_SERVICE_STOPPED))
+ eerrorx("rc_service_mark: %s", strerror(errno));
uncoldplug();
} else
svc_exec(optarg, NULL);