Skip to content

fix(python): remove mode=0o700 DACL lockout and add chewing in-memory fallback - #988

Merged
PCMan merged 7 commits into
masterfrom
fix/python-acl-and-chewing-resilience
Oct 24, 2026
Merged

PCMan merged 7 commits into
masterfrom
fix/python-acl-and-chewing-resilience

Conversation

@PCMan

@PCMan PCMan commented Oct 24, 2026

Copy link
Copy Markdown
Member

Remove mode=0o700 from os.makedirs across server.py, chewing_config.py, rime_ime.py, and cinbase. On Windows, passing mode=0o700 sets restrictive security descriptors (DACLs) on NTFS directories in APPDATA and LOCALAPPDATA, preventing other processes or standard users from accessing logs, user databases, and configuration files.

Validate ChewingContext in libchewing.py, raising RuntimeError when context creation fails and guarding del against null pointers.

In chewing_ime.py, wrap ChewingContext creation in a try/except block to automatically fallback to an in-memory database if opening the user phrase database on disk fails.

Generated with assistance from Antigravity (Gemini 3.8 Flash)

PCMan added 7 commits October 24, 2026 14:51
- Remove mode=0o700 DACL restrictions from server.py, chewing_config.py, and rime_ime.py.
- Validate ChewingContext and safely guard __del__ in libchewing.py.

Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
Generated with assistance from Antigravity (Gemini 3.8 Flash)
@PCMan PCMan self-assigned this Oct 24, 2026
@PCMan
PCMan merged commit b0257c6 into master Oct 24, 2026
4 of 6 checks passed
@PCMan
PCMan deleted the fix/python-acl-and-chewing-resilience branch October 24, 2026 22:29
asdf80730 added a commit to asdf80730/PIME that referenced this pull request Oct 25, 2026
Upstream landed EasyIME#997/EasyIME#998 (launcher close forwarding and client-ID
validation), EasyIME#988 (Python user-dir ACL fallback), EasyIME#971/EasyIME#951/EasyIME#937/EasyIME#936
(node guards and tests), EasyIME#996 (AGENTS.md AI declaration and header
rules), and dropped the vendored inetc plugin in EasyIME#966.

Conflict resolutions:
- node/server.js: take upstream, which supersedes our EasyIME#937 implementation
  with an uncaughtException handler and the same fallback service.
- node/loadServices.js: keep upstream's guards and re-thread the fork's
  `baseDir` parameter so test/loadServices.test.js still drives a fixture.
- node/package.json: run upstream's nimeServer suite plus the two local
  suites, matching the CI steps.
- PIMELauncher/src/protocol.rs: keep upstream's parse_backend_input and
  the rustfmt layout from local master.

Generated with assistance from omp (DeepSeek V4.1 Flash).
asdf80730 added a commit to asdf80730/PIME that referenced this pull request Oct 25, 2026
… Wine

EasyIME#1000 added test_cinbase_cand_per_page.py, test_cinbase_wildcard.py and
test_dayi_symbols.py. All three import `cinbase`, which imports `winsound`
and `windll` at module scope, so the Linux host run failed on the import
and the bundled-interpreter run under Wine aborted into `winedbg` on
`propsys.dll.VariantToString` and never returned.

- Import the smoke runner's Win32 shims in those modules: the logic under
  test never calls a Win32 function, so the host run exercises it.
- Skip them under Wine, where the shim is a no-op and the same import
  hangs `winedbg`; `ime_smoke_runner.under_wine()` detects Wine through
  ntdll's `wine_get_version`.
- EasyIME#988 made a failed chewing context raise, so the smoke runner gained a
  skip marker for "Failed to create chewing context": the bundled DLLs are
  Windows builds, and the runner only ever runs on Linux.
- `tests/run_local_tests.sh` now fails only on real failures again; the
  bundled step returns in 3s instead of being killed at the deadline.

Generated with assistance from omp (DeepSeek V4.1 Flash).
PCMan pushed a commit that referenced this pull request Nov 12, 2026
An elevated PIMELauncher makes the Python backend create %APPDATA%\\PIME
owned by BUILTIN\\Administrators, which the normal sign-in session cannot
read; input methods then silently swallow keys with no error anywhere.
The folder-creation and NULL-context fixes from the report landed in
#988; this completes the remaining suggestion: the watchdog now logs a
warning naming the cause and the two icacls repair commands right after
logging is set up, before any backend can create those folders. The
worker child inherits the same token and stays silent, so the log
carries one warning.

Architecture and design by asdf80730. Implementation generated with AI
assistance from omp (Qwen3.8-Flash-Next).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant