More aggressive umasking

This commit is contained in:
Administrator 2022-04-01 01:25:24 +00:00
parent 2af37624f7
commit b3efea151e
2 changed files with 4 additions and 6 deletions

View File

@ -7,13 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- Nothing yet.
### Fixed ### Fixed
- Nothing yet. - Protect files in ~/.sporestack with aggressive `umask`.
## [6.0.0a1 - 2022-03-31] ## [6.0.0a1 - 2022-03-31]

View File

@ -59,6 +59,9 @@ HOME = Path(_home)
SPORESTACK_DIR = HOME / ".sporestack" SPORESTACK_DIR = HOME / ".sporestack"
# Try to protect files in ~/.sporestack
os.umask(0o0077)
cli = typer.Typer(help=HELP) cli = typer.Typer(help=HELP)
token_cli = typer.Typer() token_cli = typer.Typer()
@ -251,7 +254,6 @@ def save_machine_info(machine_info: Dict[str, Any], overwrite: bool = False) ->
""" """
Save info to disk. Save info to disk.
""" """
os.umask(0o0077)
directory = server_info_path() directory = server_info_path()
hostname = machine_info["vm_hostname"] hostname = machine_info["vm_hostname"]
json_file = directory / f"{hostname}.json" json_file = directory / f"{hostname}.json"