diff --git a/src/buskill_gui.py b/src/buskill_gui.py index 4dfd75dd..94808fed 100755 --- a/src/buskill_gui.py +++ b/src/buskill_gui.py @@ -172,8 +172,11 @@ def toggle_buskill(self): # buskill failed to arm/disarm; tell the user msg = "Unable to toggle buskill state" - # for some reason 'e' is undefined, but we can get the exception thrown - # by the child process from its 'exception' instance field + # for some reason 'e' is sometimes undefined, but we can get the + # exception thrown by the child process from its 'exception' + # instance field + if e: + msg += "\n\nException: " +str(e) if self.bk.usb_handler.exception[0]: msg += "\n\nException: " +str(self.bk.usb_handler.exception[0]) diff --git a/src/packages/buskill/root_child_mac.py b/src/packages/buskill/root_child_mac.py index e380c738..9a8911da 100644 --- a/src/packages/buskill/root_child_mac.py +++ b/src/packages/buskill/root_child_mac.py @@ -167,8 +167,17 @@ def trigger_softshutdown_mac_halt(): # * https://github.com/BusKill/buskill-app/issues/14#issuecomment-1279975783 # * https://github.com/BusKill/buskill-app/issues/77#issuecomment-2254299923 -# set owner of binary to root:root -os.chown( os.path.abspath(__file__), 0, 0 ) +our_filepath = os.path.abspath(__file__) + +msg = "Attempting to harden ourselves " +str(our_filepath) +logging.info(msg) + +try: + # set owner of binary to root:root + os.chown( our_filepath, 0, 0 ) +except Exception as e: + msg = "Failed to harden" + logging.warning(msg) ############# # MAIN LOOP #