|
25 | 25 | This file hardens the WebScripts installation and configuration. |
26 | 26 | """ |
27 | 27 |
|
28 | | -__version__ = "0.0.9" |
| 28 | +__version__ = "0.0.10" |
29 | 29 | __author__ = "Maurice Lambert" |
30 | 30 | __author_email__ = "[email protected]" |
31 | 31 | __maintainer__ = "Maurice Lambert" |
@@ -323,26 +323,36 @@ def harden_script(self, section: dict, filename: str) -> None: |
323 | 323 | """ |
324 | 324 |
|
325 | 325 | logger_info("Hardens script " + repr(filename)) |
326 | | - logger_debug("Add the launcher") |
| 326 | + logger_debug(f"Add launcher {executable!r} for {filename!r}") |
327 | 327 | section["launcher"] = executable |
328 | 328 | specific_config_file = section.get("configuration_file") |
329 | 329 |
|
330 | 330 | if specific_config_file: |
331 | 331 | specific_config_file = basename(specific_config_file) |
332 | 332 |
|
333 | 333 | script_name, _ = splitext(basename(filename)) |
334 | | - logger_info(f"Configure script named: {script_name}") |
| 334 | + logger_info("Configure script named: " + repr(script_name)) |
335 | 335 | for config_file in self.json_config_files: |
336 | 336 | if config_file.endswith(specific_config_file): |
337 | 337 | section["configuration_file"] = config_file |
338 | 338 | self.get_configurations(config_file, filename) |
339 | 339 | break |
| 340 | + else: |
| 341 | + logger_error( |
| 342 | + "Configuration file not found for " + repr(filename) |
| 343 | + ) |
340 | 344 |
|
341 | 345 | for py_filename in self.py_scripts_files: |
342 | | - if py_filename.endswith(filename): |
343 | | - logger_debug("Add the script absolute path.") |
| 346 | + py_basename = basename(py_filename) |
| 347 | + if py_basename == filename: |
| 348 | + logger_debug( |
| 349 | + "Add the script absolute path" |
| 350 | + f" {py_filename!r} for {filename!r}." |
| 351 | + ) |
344 | 352 | section["path"] = py_filename |
345 | 353 | break |
| 354 | + else: |
| 355 | + logger_error("Script file not found for " + repr(filename)) |
346 | 356 |
|
347 | 357 | def linux_hardening_file_permissions(self) -> None: |
348 | 358 | """ |
|
0 commit comments