Build configs should not be globally writable (thanks Jeremy)

This commit is contained in:
Gregory Kurtzer
2022-01-19 06:01:33 +00:00
parent ae0455eba1
commit d35f368b21
14 changed files with 110 additions and 47 deletions

View File

@@ -85,12 +85,12 @@ func Configure(show bool) error {
d.Nodes = append(d.Nodes, nodes...)
if controller.Dhcp.Template == "" {
templateFile = path.Join(buildconfig.SYSCONFDIR, "warewulf/dhcp/default-dhcpd.conf")
templateFile = path.Join(buildconfig.SYSCONFDIR(), "warewulf/dhcp/default-dhcpd.conf")
} else {
if strings.HasPrefix(controller.Dhcp.Template, "/") {
templateFile = controller.Dhcp.Template
} else {
templateFile = path.Join(buildconfig.SYSCONFDIR, "warewulf/dhcp/"+controller.Dhcp.Template+"dhcpd.conf")
templateFile = path.Join(buildconfig.SYSCONFDIR(), "warewulf/dhcp/"+controller.Dhcp.Template+"dhcpd.conf")
}
}