Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
systemd.1059
0001-core-don-t-allow-enabling-if-unit-is-maske...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-core-don-t-allow-enabling-if-unit-is-masked.patch of Package systemd.1059
From f7101b7368dfe41dbc8b7203e06133cccb589c01 Mon Sep 17 00:00:00 2001 From: Jan Synacek <jsynacek@redhat.com> Date: Tue, 7 Oct 2014 13:35:41 +0200 Subject: [PATCH] core: don't allow enabling if unit is masked --- src/shared/install.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git src/shared/install.c src/shared/install.c index fa064c2..945bb27 100644 --- src/shared/install.c +++ 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; -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor