AUR (en) - wsl-hello-sudo-bin (original) (raw)
The below patch fixes the install script. Probably not the most correct one but gets the work done.
diff --git a/install.sh b/install.sh
--- a/install.sh
+++ b/install.sh
@@ -2,6 +2,10 @@
set -e
+curr="$PWD"
+cd "$(realpath "$(dirname "$0")")"
+trap "cd '$curr'" EXIT
+
prompt_yn () {
read -r -p "$1: " response
if [[ -z "$response" ]]; then
@@ -91,8 +95,8 @@ fi
set +x
echo_stage "Installing Windows component of WSL-Hello-sudo..."
set -x
-chmod +x build/WindowsHelloBridge.exe
+sudo chmod +x build/WindowsHelloBridge.exe
cp build/WindowsHelloBridge.exe "$PAM_WSL_HELLO_WINPATH/"
set +x
echo_stage "Installing PAM module to the Linux system..."
@@ -175,7 +179,7 @@ sudo cp "$KEY_PATH" /etc/pam_wsl_hello/public_keys/
set +x
echo_stage "Creating uninstall.sh..."
if [ ! -e "uninstall.sh" ] || prompt_yn "'uninstall.sh' already exists. Overwrite it? [Y/n]" "y" ; then
- cat > uninstall.sh << EOS
+ cat << EOS | sudo tee uninstall.sh
echo -e "\e[31mNote: Please ensure that config files in /etc/pam.d/ are restored to as they were before WSL-Hello-sudo was installed\e[m"
set -x
sudo rm -rf /etc/pam_wsl_hello
@@ -186,7 +190,7 @@ if [ ! -e "uninstall.sh" ] || prompt_yn "'uninstall.sh' already exists. Overwrit
fi
rm -rf "${PAM_WSL_HELLO_WINPATH}"
EOS
- chmod +x uninstall.sh
+ sudo chmod +x uninstall.sh
else
echo "Skipping creation of 'uninstall.sh'..."
fi
I tried to follow your instructions from ArchWiki but noticed that this package is broken in three ways:
1 - Requires VCRUNTIME140.dll but this is not mentioned anywhere
2 -
[andreymal@wsl ~]$ /opt/wsl-hello-sudo/install.sh
No built binary was found. Build first before installing.
3 -
[andreymal@wsl ~]$ cd /opt/wsl-hello-sudo/
[andreymal@wsl wsl-hello-sudo]$ ./install.sh
[1/6] Installing Windows component of WSL-Hello-sudo...
[...]
+ chmod +x build/WindowsHelloBridge.exe
chmod: changing permissions of 'build/WindowsHelloBridge.exe': Operation not permitted
[...]
[5/6] Creating uninstall.sh...
./install.sh: line 178: uninstall.sh: Permission denied
This error means I have to copy /opt/wsl-hello-sudo/ somewhere else, which makes this package practically useless