Make git-annex enable-tor work when using the linux standalone build
authorJoey Hess <joeyh@joeyh.name>
Wed, 26 Oct 2022 19:44:06 +0000 (15:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 26 Oct 2022 19:45:08 +0000 (15:45 -0400)
commit14f7a386f05e57d32fcd9ffbd815132c704c3705
treedf0b562ab46313bb2bca3fabe561931cddaaddfa
parenta8ce8ac75d30afc76e3543cd7e0acbb41f5207bf
Make git-annex enable-tor work when using the linux standalone build

Clean the standalone environment before running the su command
to run "sh". Otherwise, PATH leaked through, causing it to run
git-annex.linux/bin/sh, but GIT_ANNEX_DIR was not set,
which caused that script to not work:

[2022-10-26 15:07:02.145466106] (Utility.Process) process [938146] call: pkexec ["sh","-c","cd '/home/joey/tmp/git-annex.linux/r' && '/home/joey/tmp/git-annex.linux/git-annex' 'enable-tor' '1000'"]
/home/joey/tmp/git-annex.linux/bin/sh: 4: exec: /exe/sh: not found

Changed programPath to not use GIT_ANNEX_PROGRAMPATH,
but instead run the scripts at the top of GIT_ANNEX_DIR.
That works both when the standalone environment is set up, and when it's
not.

Sponsored-by: Kevin Mueller on Patreon
Annex/Path.hs
Assistant/Install.hs
Build/LinuxMkLibs.hs
CHANGELOG
Command/EnableTor.hs
Command/WebApp.hs
Utility/Su.hs
doc/bugs/__47__exe__47__git-annex.mdwn
doc/bugs/__47__exe__47__git-annex/comment_2_381ac4e8b27343cdc470584c05edec76._comment [new file with mode: 0644]