Skip to content

Commit

Permalink
Use f-string with formatting to convert octal permissions to string
Browse files Browse the repository at this point in the history
Previous method produced incorrect results if user permissions were
set to zero.
  • Loading branch information
igo95862 committed Aug 18, 2024
1 parent b7d2d6d commit 140bc98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bubblejail/bwrap_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, permissions: Optional[int] = None):
def to_args(self) -> Generator[str, None, None]:
if self.permissions is not None:
yield "--perms"
yield oct(self.permissions).lstrip("0o")
yield f"{self.permissions:04o}"

yield from super().to_args()

Expand Down

0 comments on commit 140bc98

Please sign in to comment.