print FILE ", " . $dhcpsettings{"WINS2_${itf}"} if ($dhcpsettings{"WINS2_${itf}"});
print FILE ";\n" if ($dhcpsettings{"WINS1_${itf}"});
print FILE "\tnext-server " . $dhcpsettings{"NEXT_${itf}"} . ";\n" if ($dhcpsettings{"NEXT_${itf}"});
- print FILE "\tfilename \"" . $dhcpsettings{"FILE_${itf}"} . "\";\n" if ($dhcpsettings{"FILE_${itf}"});
+ print FILE "\tfilename \"" . &EscapeFilename($dhcpsettings{"FILE_${itf}"}) . "\";\n" if ($dhcpsettings{"FILE_${itf}"});
print FILE "\tdefault-lease-time " . ($dhcpsettings{"DEFAULT_LEASE_TIME_${itf}"} * 60). ";\n";
print FILE "\tmax-lease-time " . ($dhcpsettings{"MAX_LEASE_TIME_${itf}"} * 60) . ";\n";
print FILE "\tallow bootp;\n" if ($dhcpsettings{"ENABLEBOOTP_${itf}"} eq 'on');
print FILE "\thardware ethernet $temp[0];\n";
print FILE "\tfixed-address $temp[1];\n";
print FILE "\tnext-server $temp[3];\n" if ($temp[3]);
- print FILE "\tfilename \"$temp[4]\";\n" if ($temp[4]);
+ print FILE "\tfilename \"" . &EscapeFilename($temp[4]) . "\";\n" if ($temp[4]);
print FILE "\toption root-path \"$temp[5]\";\n" if ($temp[5]);
print FILE "}\n";
$key++;
}
return 0;
}
+
+sub EscapeFilename($) {
+ my $filename = shift;
+
+ # Replace all single / by \/
+ $filename =~ s/\//\\\//g;
+
+ return $filename;
+}