-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempting to add better debug logs for root_child
This commit adds more debug output to tell us what user & group is currently executing BusKill and what are the permissions & owners on the root_child process. This can help resolve issues related to the permissions restrictions in-place when launching our root_child process as root, such as happened in bug #77: * #77
- Loading branch information
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
File: main.py | ||
Authors: Michael Altfield <[email protected]> | ||
Created: 2020-06-23 | ||
Updated: 2023-06-14 | ||
Version: 0.2 | ||
Updated: 2024-02-25 | ||
Version: 0.3 | ||
This is the main wrapper script for launching the BusKill app. | ||
|
@@ -19,7 +19,7 @@ | |
|
||
# this is needed for supporting Windows 10 with OpenGL < v2.0 | ||
# Example: VirtualBox w/ OpenGL v1.1 | ||
import platform, os | ||
import platform, os, grp | ||
CURRENT_PLATFORM = platform.system().upper() | ||
if CURRENT_PLATFORM.startswith( 'WIN' ): | ||
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2' | ||
|
@@ -66,6 +66,10 @@ | |
|
||
logging.debug( 'BUSKILL_VERSION|' +str(BUSKILL_VERSION)+ '|' ) | ||
logging.debug( 'os.environ|' +str(os.environ)+ '|' ) | ||
logging.debug( 'user|' +str(os.getlogin())+ '|' ) | ||
logging.debug( 'uid|' +str(os.getuid())+ '|' ) | ||
logging.debug( 'group|' +str(grp.getgrgid( os.getgid() ))+ '|' ) | ||
logging.debug( 'gid|' +str(os.getgid())+ '|' ) | ||
logging.debug( 'sys.argv|' +str(sys.argv)+ '|' ) | ||
logging.debug( 'sys.builtin_modules_names|' +str(sys.builtin_module_names)+ '|' ) | ||
logging.debug( 'sys.executable|' +str(sys.executable)+ '|' ) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
Authors: Michael Altfield <[email protected]> | ||
Co-Auth: Steven Johnson <[email protected]> | ||
Created: 2020-06-23 | ||
Updated: 2023-06-16 | ||
Version: 0.5 | ||
Updated: 2024-02-25 | ||
Version: 0.6 | ||
This is the heart of the buskill app, shared by both the cli and gui | ||
|
@@ -19,7 +19,7 @@ | |
################################################################################ | ||
|
||
import platform, multiprocessing, traceback, subprocess | ||
import urllib.request, re, json, certifi, sys, os, math, shutil, tempfile, random, gnupg, configparser | ||
import urllib.request, re, json, certifi, sys, os, grp, pwd, math, shutil, tempfile, random, gnupg, configparser | ||
import os.path | ||
from buskill_version import BUSKILL_VERSION | ||
from distutils.version import LooseVersion | ||
|
@@ -662,6 +662,21 @@ def spawn_root_child(self): | |
owner = os.stat(root_child_path).st_uid | ||
group = os.stat(root_child_path).st_gid | ||
|
||
msg = "DEBUG: root_child mode:|" +str(mode)+ "|" | ||
print( msg ); logger.debug( msg ) | ||
|
||
msg = "DEBUG: root_child uid owner:|" +str(owner)+ "|" | ||
print( msg ); logger.debug( msg ) | ||
|
||
msg = "DEBUG: root_child user owner name:|" +str(pwd.getpwuid(owner))+ "|" | ||
print( msg ); logger.debug( msg ) | ||
|
||
msg = "DEBUG: root_child gid owner:|" +str(group)+ "|" | ||
print( msg ); logger.debug( msg ) | ||
|
||
msg = "DEBUG: root_child group owner name:|" +str(grp.getgrgid(group))+ "|" | ||
print( msg ); logger.debug( msg ) | ||
|
||
# verify the mode of the file is exactly 0500 (octal) | ||
if mode != '0500': | ||
msg = 'ERROR: Permissions on root_child are not 0500. Refusing to spawn script as root!' | ||
|