Spaces:
Sleeping
Sleeping
Download scripts/check_perms.py from jinv2/Shensist-AIS-Terminal: direct link, hf CLI and curl.
- Browser
- Download file 848 Bytes
-
https://huggingface.co/spaces/jinv2/Shensist-AIS-Terminal/resolve/main/scripts/check_perms.py
- Command line
-
hf download hf://spaces/jinv2/Shensist-AIS-Terminal/scripts/check_perms.py
-
curl -L -o check_perms.py https://huggingface.co/spaces/jinv2/Shensist-AIS-Terminal/resolve/main/scripts/check_perms.py
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() | |