From 3e64b642ca9b5e66dbd9a16687632b270acc32da Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 20 Dec 2014 08:39:12 +0100 Subject: [PATCH] Make sure that "feature enable" uses relative paths for the symlinks fixes #8121 --- lib/cli/featureutility.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cli/featureutility.cpp b/lib/cli/featureutility.cpp index 6f487b421..de3577309 100644 --- a/lib/cli/featureutility.cpp +++ b/lib/cli/featureutility.cpp @@ -97,9 +97,11 @@ int FeatureUtility::EnableFeatures(const std::vector& features) << ConsoleColorTag(Console_Normal) << ". Make sure to restart Icinga 2 for these changes to take effect.\n"; #ifndef _WIN32 - if (symlink(source.CStr(), target.CStr()) < 0) { + String relativeSource = "../features-available/" + feature + ".conf"; + + if (symlink(relativeSource.CStr(), target.CStr()) < 0) { Log(LogCritical, "cli") - << "Cannot enable feature '" << feature << "'. Linking source '" << source << "' to target file '" << target + << "Cannot enable feature '" << feature << "'. Linking source '" << relativeSource << "' to target file '" << target << "' failed with error code " << errno << ", \"" << Utility::FormatErrorNumber(errno) << "\"."; errors.push_back(feature); continue; -- 2.40.0