Repository navigation
Ask for the sudo password on screen instead of requiring passwordless sudo - #1
Closed
Z3R0C1PH3R wants to merge 2 commits into
Closed
Z3R0C1PH3R wants to merge 2 commits into
Z3R0C1PH3R wants to merge 2 commits into
Conversation
Si `sudo -n` dice que hace falta contraseña, la lista de ajustes la pide encima («Password required») y repite el cambio con `sudo -S -p ""`. La contraseña va por la entrada estándar (run_process admite ahora entrada), nunca en la línea de órdenes; no se guarda y se borra de la memoria al acabar (SecretInput, wipe). Si no vale, se vuelve a pedir con el aviso en rojo. Sudo la recuerda unos minutos. - model/sudo_password: classify_sudo (mensajes de sudo con LC_ALL=C) y SecretInput, con pruebas en power_model_test. - linux_input: Shift (mayúsculas y signos de un teclado de PC) y la capa Sym del Cardputer, leída de su mapa de teclas; al soltar sale la misma tecla que al pulsar. - La T no cambia el tema mientras se escribe la contraseña. - Simulador: ZEROPOWER_SIMULATE_SUDO=<clave> para probar la pantalla.
El resto de la interfaz ya estaba en inglés: «Mantén ESC para salir», «Guardada en» y «No se pudo capturar» se habían quedado en español. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Closing for now: fixing some layout issues first. Will reopen when it's ready. |
Contributor
Author
|
Superseded by #2, which includes these changes plus the layout fixes. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the device user needs a password for
sudo, changing a system setting used to fail with "Needs passwordless sudo". Now ZeroPower asks for the password on screen and retries the change.How it works
PowerControl::applystill triessudo -nfirst, so passwordless setups behave exactly as before.env LC_ALL=C sudo -S -p "" zeropower-helper set ….run_processnow takes optional input. It is never on the command line, so it never shows in/proc.SecretInput,wipe).Typing the password
linux_inputnow understands Shift: capital letters, plus US shifted symbols on USB keyboards./usr/share/keymaps/tca8418_keypad_m5stack_keymap.map, with a built-in copy as fallback. Some of those codes collide with PC punctuation codes (51 is&there, not,), so they only apply to thetca8418device.Tdoesn't toggle the theme while the password field is open (BaseViewModel::set_text_entry).Other
classify_sudoandSecretInputlive insrc/model/sudo_password.*and have tests inpower_model_test.ZEROPOWER_SIMULATE_SUDO=<password>makes the simulated system ask for it once.Tested
pineeds a password for sudo:power_model_testpasses. Built with thecp0-cross-packageworkflow in a Debian trixie container.Made with Cursor