Shensist-AIS-Terminal / scripts /check_perms.py
Antigravity Agent
🏛️ 架构重生:彻底切除 80MB 历史肿瘤,实现轻量化 14 号行星部署
36bec3f
raw
history blame contribute delete
848 Bytes
import os
import stat
def check_uinput():
path = "/dev/uinput"
print(f"--- Checking {path} ---")
if not os.path.exists(path):
print(f"❌ {path} does not exist.")
return
# Check stats
st = os.stat(path)
print(f"Mode: {oct(st.st_mode)}")
print(f"Owner UID: {st.st_uid}")
print(f"Group GID: {st.st_gid}")
# Check current user/groups
print(f"\nCurrent User UID: {os.getuid()}")
print(f"Current Groups GIDs: {os.getgroups()}")
# Try opening for writing
try:
with open(path, 'w') as f:
print(f"✅ Successfully opened {path} for writing.")
except PermissionError:
print(f"❌ Permission Denied: Cannot open {path} for writing.")
except Exception as e:
print(f"❌ Error: {e}")
if __name__ == "__main__":
check_uinput()