-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crux-find-alternate-file-as-root called on local files #20
Comments
I'm guessing something's off with the permissions of those local files. |
Hmm. I might be wrong, but have recently noticed that whenever I use M-. to jump to system installed elisp, the first load fails due to an attempt to re-open as root. After a brief investigation I can confirm it with the following sequence:
I don't believe the hook should be that aggressive about re-opening as root. |
I've bumped into this too. I fixed it with: (remove-hook 'find-file-hook #'crux-reopen-as-root) Currently, opening any file that is read-only and not owned by the current user triggers a root login prompt. This occurs for viewing system files (e.g This is assuming that the user wants to open the file, as root, and edit it. This isn't always true. If I don't have root on that box, it's pointless. If I just want to view an important system file, it's hazardous to open it as root as I might accidentally make changes that break things. Changing the default behaviour of find-file like this caught me by surprise. @bbatsov what's the original intent of this feature? Could we make this opt-in, the same way crux keybindings are opt-in? |
Currently, opening any file that is read-only and not owned by the current user triggers a root login prompt. This occurs for viewing system files (e.g /etc/fstab), built-in elisp libraries (e.g. simple.el.gz) and simply viewing files owned by other users on a shared system. We can't assume that this is the behaviour users want, and changing built-in functions without asking is surprising. Fixes bbatsov#20.
Rather than changing the default find-file behavior, providing a minor mode enables users to opt-in or toggle the behavior. Fixes bbatsov#20.
Rather than changing the default find-file behavior, providing a minor mode enables users to opt-in or toggle the behavior. Fixes bbatsov#20.
Rather than changing the default find-file behavior, providing a minor mode enables users to opt-in or toggle the behavior. Fixes bbatsov#20.
Rather than changing the default find-file behavior, providing a minor mode enables users to opt-in or toggle the behavior. Fixes #20.
When attempting to open a new file crux-reopen-as-root always calls crux-find-alternate-file-as-root and prompts for password.
I had to remove the hook for find-file.
The text was updated successfully, but these errors were encountered: