Skip to content

Fix update stay-awake parent check under non-C locales - #14943

Open
thesteganos wants to merge 1 commit into
omacom:quattrofrom
thesteganos:fix-stay-awake-locale
Open

thesteganos wants to merge 1 commit into
omacom:quattrofrom
thesteganos:fix-stay-awake-locale

Conversation

@thesteganos

Copy link
Copy Markdown

Problem

On a system with a non-English locale, omarchy update (and therefore omarchy-channel-set) aborts right after the snapshot step with:

Refusing to use an unsafe Omarchy update inhibitor state path.

root_owned_parent_chain in bin/omarchy-update-stay-awake reads the file type with stat -c %F and compares it to directory. %F is translated by the locale. Under pt_BR.UTF-8 it returns diretório, so the check fails on /run/user even though the whole parent chain is root-owned and not group/other writable.

Fix

Run that stat call with LC_ALL=C, so %F is always the untranslated name. The numeric %u/%a fields are unaffected. This is the only stat ... %F in the repo.

Testing

  • With LANG=pt_BR.UTF-8, test/shell.d/update-stay-awake-security-test.sh fails right away on the current quattro (0/15) and passes fully with this change (15/15).
  • Verified end to end: omarchy-channel-set dev completed on a pt_BR system once this change was in place.

🤖 Generated with Claude Code

stat %F is translated by the locale (e.g. 'diretório' in pt_BR), so the
comparison against 'directory' failed and the update was refused with an
unsafe state path error. Force the C locale for that call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This change appears safe to merge.

Summary

Pins /usr/bin/stat to the C locale in root_owned_parent_chain, so translated directory names no longer stop updates.

  • Updates can use safe runtime paths under non-English locales.

Reviews (1) · Last reviewed commit: "Fix update stay-awake parent check under..." · Reviewed by Greptile

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