MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ValidateFreshName

Method ValidateFreshName

lib/remote/configpackageutility.cpp:380–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380bool ConfigPackageUtility::ValidateFreshName(const String& name)
381{
382 if (name.IsEmpty())
383 return false;
384
385 /* check for path injection */
386 if (ContainsDotDot(name))
387 return false;
388
389 return std::all_of(name.Begin(), name.End(), [](char c) {
390 return std::isalnum(c, std::locale::classic()) || c == '_' || c == '-';
391 });
392}
393
394std::mutex& ConfigPackageUtility::GetStaticPackageMutex()
395{

Callers

nothing calls this directly

Calls 3

IsEmptyMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected