Closed michaelchanwork closed 4 years ago
DO NOT MERGE, from testing looks like another bug, will update
Some bugs in sudo itself, also regarding spaces
sudo netsh advfirewall firewall add rule name="lolchat" dir=out remoteip=172.65.244.155 protocol=TCP action=block
realpath: Chan/bin/win-sudo/s/sudobackend: No such file or directory
UAC elevation was canceled
After taking out dev/null redirection from powershell line and adding a debugging line(won't output anything if there is no error) {noformat} \; (\$Error[0]).InvocationInfo.Line {noformat}
Start-Process : A positional parameter cannot be found that accepts argument 'Files/Git/'.
At line:1 char:1
+ Start-Process "C:\Program Files\Git\usr\bin\bash" "/c/Users/Michael C ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
Start-Process "C:\Program Files\Git\usr\bin\bash" "/c/Users/Michael Chan/bin/win-sudo/s/sudobackend", "/tmp/.sudo.5526" -Verb RunAs -WorkingDirectory C:/Program Files/Git/ -WindowStyle Hidden; ($Error[0]).InvocationInfo.Line
From there, it hangs(hard to tell with all the changes to fds and pipes), but from what I can tell, isn't related to the changes I made nor spaces in paths. Feel free to make edits/merge.
I'll open an issue regarding the hanging after the powershell command, if you have suggestions let me know.
Thank you.
Currently, if username has a space, script will fail; path to bashrc/bash_profile gets broken up
Have tested fix, ensures spaces in path are handled, resulting in
And sudo works!