feat: toggle-bluetooth rewrite in python with systemd run0 sandboxing#1215
Merged
RoyalOughtness merged 66 commits intosecureblue:livefrom Sep 8, 2025
Merged
feat: toggle-bluetooth rewrite in python with systemd run0 sandboxing#1215RoyalOughtness merged 66 commits intosecureblue:livefrom
RoyalOughtness merged 66 commits intosecureblue:livefrom
Conversation
HastD
requested changes
Jul 31, 2025
Collaborator
HastD
left a comment
There was a problem hiding this comment.
Overall looks good, just have some minor suggestions to improve error handling and code clarity/style.
9437b25 to
8b71bfe
Compare
RoyalOughtness
previously approved these changes
Sep 7, 2025
codacy and ruff fixes
RoyalOughtness
previously approved these changes
Sep 7, 2025
Collaborator
HastD
requested changes
Sep 8, 2025
files/system/usr/libexec/secureblue/sandbox/sandboxed_function.py
Outdated
Show resolved
Hide resolved
HastD
approved these changes
Sep 8, 2025
RoyalOughtness
previously approved these changes
Sep 8, 2025
RoyalOughtness
approved these changes
Sep 8, 2025
ghost
reviewed
Oct 16, 2025
| cur_status: str = "enabled" if bluetooth_currently_enabled else "disabled" | ||
| file_status: str = "enabled" if enabled_by_file else "disabled" | ||
|
|
||
| print( |
Collaborator
There was a problem hiding this comment.
this is a merged PR
| file_status: str = "enabled" if enabled_by_file else "disabled" | ||
|
|
||
| print( | ||
| f"Bluetooth is currently {cur_status}, and after a reboot will {file_matches_sys}be {file_status}" |
There was a problem hiding this comment.
add space after {file_matches_sys} and 'be'
| state_already_set = target_state_enabled == enabled_by_file | ||
| if state_already_set: | ||
| print_status(enabled_by_file) | ||
| else: |
| """ | ||
|
|
||
|
|
||
| def main(): |
There was a problem hiding this comment.
can we add a type and return hints, so we can see what type is returned from the function?
| A class that wraps a function to be run in a sandbox | ||
| """ | ||
|
|
||
| import dataclasses |
| import dataclasses | ||
|
|
||
|
|
||
| @dataclasses.dataclass |
ghost
reviewed
Oct 16, 2025
| # Copyright (C) 2025 Daniel Hast | ||
| # Systemd sandboxing of run0 invocation adapted from run0edit, originally licensed | ||
| # under MIT OR Apache-2.0. Used here under the terms of the Apache License 2.0. | ||
| system_calls_to_deny: list[str] = [ |
Collaborator
|
@klorishow32 This PR has already been merged—if you want to make changes to this script, you can make a separate PR for it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Script functionality tested in vm.