From: Gunnar Beutner Date: Sat, 20 Dec 2014 07:39:12 +0000 (+0100) Subject: Make sure that "feature enable" uses relative paths for the symlinks X-Git-Tag: v2.3.0~434 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e64b642ca9b5e66dbd9a16687632b270acc32da;p=icinga2 Make sure that "feature enable" uses relative paths for the symlinks fixes #8121 --- 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;