-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
fix filetype detection in sudo>=1.8.13 #SudoEditInit #79
Conversation
Would you happen to have a link to a changelog/CVE/whatever that explains what changed? |
Link to bugfix Link to issue |
58eb009
to
e350b22
Compare
let files = split($SUDO_COMMAND, ' ')[1:-1] | ||
if len(files) ==# argc() | ||
for i in range(argc()) | ||
let ppid = system('ps -o ppid:1= -p ' . getpid()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears not to work on BSD ps. Tested on macOS.
\ '|endif' | ||
endfor | ||
endif | ||
endfunction | ||
if $SUDO_COMMAND =~# '^sudoedit ' | ||
let file_name = expand('%:t:p') | ||
if file_name =~# '.\{-}\(XX\)\@=' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't portable either. XX
appears to be Linux specific.
This feature no longer works on any host I have access to, so I have removed it for now. In addition to the portability issues I have called out, I have concerns about calling I think it may be time to walk away. I am thus closing this PR, but I am not ruling out pursuing a more robust solution. |
Well, at least the shell alias worked very well for me and didn't hurt in the pile of all the other aliases and functions. Removing the feature entirely is a bit sad but might as well copy the one function into my vimrc and drop the rest of the plugin. |
If that was your attempt to get me to bring it back, then I regret to inform you it has backfired. |
Fix filetype detection in vim-eunuch.
Existing workaround requires creation of a shell function:
sudoedit() { SUDO_COMMAND="sudoedit $1" command sudoedit "$1" }