projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e91c8c2
)
core: don't allow enabling if unit is masked
author
Jan Synacek
<jsynacek@redhat.com>
Tue, 7 Oct 2014 11:35:41 +0000
(13:35 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Tue, 7 Oct 2014 21:08:18 +0000
(17:08 -0400)
src/shared/install.c
patch
|
blob
|
history
diff --git
a/src/shared/install.c
b/src/shared/install.c
index
fa064c2
..
945bb27
100644
(file)
--- a/
src/shared/install.c
+++ b/
src/shared/install.c
@@
-1516,6
+1516,19
@@
int unit_file_enable(
return r;
STRV_FOREACH(i, files) {
+ UnitFileState state;
+
+ state = unit_file_get_state(scope, root_dir, *i);
+ if (state < 0) {
+ log_error("Failed to get unit file state for %s: %s", *i, strerror(-state));
+ return state;
+ }
+
+ if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
+ log_error("Failed to enable unit: Unit %s is masked", *i);
+ return -ENOTSUP;
+ }
+
r = install_info_add_auto(&c, *i);
if (r < 0)
return r;