mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-03 20:40:17 -05:00
Add error handling for icacls calls
This commit is contained in:
parent
a8fc8f0591
commit
0189a3b4a3
1 changed files with 9 additions and 3 deletions
|
|
@ -270,9 +270,15 @@ static int InstallIcinga(void)
|
||||||
// TODO: In Icinga 2.14, rename features-available/mainlog.conf to mainlog.conf.deprecated
|
// TODO: In Icinga 2.14, rename features-available/mainlog.conf to mainlog.conf.deprecated
|
||||||
// so that it's no longer listed as an available feature.
|
// so that it's no longer listed as an available feature.
|
||||||
|
|
||||||
ExecuteCommand("icacls", "\"" + dataDir + "\" /grant *S-1-5-20:(oi)(ci)m");
|
if (!ExecuteCommand("icacls", "\"" + dataDir + "\" /grant *S-1-5-20:(oi)(ci)m")){
|
||||||
ExecuteCommand("icacls", "\"" + dataDir + "\\etc\" /inheritance:r /grant:r *S-1-5-20:(oi)(ci)m *S-1-5-32-544:(oi)(ci)f");
|
throw std::runtime_error("failed to set ACLs for " + dataDir);
|
||||||
ExecuteCommand("icacls", "\"" + dataDir + "\\var\" /inheritance:r /grant:r *S-1-5-20:(oi)(ci)m *S-1-5-32-544:(oi)(ci)f");
|
}
|
||||||
|
if (!ExecuteCommand("icacls", "\"" + dataDir + "\\etc\" /inheritance:r /grant:r *S-1-5-20:(oi)(ci)m *S-1-5-32-544:(oi)(ci)f")) {
|
||||||
|
throw std::runtime_error("failed to set ACLs for " + dataDir + "\\etc");
|
||||||
|
}
|
||||||
|
if (!ExecuteCommand("icacls", "\"" + dataDir + "\\var\" /inheritance:r /grant:r *S-1-5-20:(oi)(ci)m *S-1-5-32-544:(oi)(ci)f")) {
|
||||||
|
throw std::runtime_error("failed to set ACLs for " + dataDir + "\\var");
|
||||||
|
}
|
||||||
|
|
||||||
ExecuteIcingaCommand("--scm-install daemon");
|
ExecuteIcingaCommand("--scm-install daemon");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue