Skip to content
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

gopass: override GOPASS_CONFIG to fix completion generation #42400

Merged
merged 1 commit into from Jun 24, 2018

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Jun 22, 2018

gopass tries to write a version number to it's configuaration, even when
just generating the shell completion scripts. This fails, as
/homeless-shelter is read-only inside the sandbox.
As error messages are printed to stdout instead of stderr
(see gopasspw/gopass#877), the error message
lands inside the completion script, thus breaking it.

Workaround that by setting GOPASS_CONFIG to /dev/null

Motivation for this change

gopass' shell completion was broken. Turns out, first line of each completion script is

Failed to save config: failed to create dir '/homeless-shelter/.config/gopass': mkdir /homeless-shelter: permission denied

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@flokli
Copy link
Contributor Author

flokli commented Jun 22, 2018

/cc @andir

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gopass

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/9ljzvng6pi0nk6sdbb5ziv605vm0xwp9-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/9ljzvng6pi0nk6sdbb5ziv605vm0xwp9-gopass-1.8.1-bin
checking for references to /build in /nix/store/9ljzvng6pi0nk6sdbb5ziv605vm0xwp9-gopass-1.8.1-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/wjay807sci0rx08w1jlksnbbv5ag5si5-gopass-1.8.1
strip is /nix/store/4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/wjay807sci0rx08w1jlksnbbv5ag5si5-gopass-1.8.1
/nix/store/wjay807sci0rx08w1jlksnbbv5ag5si5-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/0aa1ngxygf1iqanfbpdb10klc7r343c0-bash-4.4-p19/bin/bash"
/nix/store/wjay807sci0rx08w1jlksnbbv5ag5si5-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/0aa1ngxygf1iqanfbpdb10klc7r343c0-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/wjay807sci0rx08w1jlksnbbv5ag5si5-gopass-1.8.1...
/nix/store/9ljzvng6pi0nk6sdbb5ziv605vm0xwp9-gopass-1.8.1-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gopass

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/3cpvlzij74vdj7gkvazvkwlrajqk1lmj-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/3cpvlzij74vdj7gkvazvkwlrajqk1lmj-gopass-1.8.1-bin
checking for references to /build in /nix/store/3cpvlzij74vdj7gkvazvkwlrajqk1lmj-gopass-1.8.1-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/7ixlwwf0vmxq1kpczbck917sl0lwg4xk-gopass-1.8.1
strip is /nix/store/min150lkigznaayzpwvf8d4jdl1dqvx6-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/7ixlwwf0vmxq1kpczbck917sl0lwg4xk-gopass-1.8.1
/nix/store/7ixlwwf0vmxq1kpczbck917sl0lwg4xk-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/23kq49wszxq7k41dqfk82q5vqwlq5sww-bash-4.4-p19/bin/bash"
/nix/store/7ixlwwf0vmxq1kpczbck917sl0lwg4xk-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/23kq49wszxq7k41dqfk82q5vqwlq5sww-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/7ixlwwf0vmxq1kpczbck917sl0lwg4xk-gopass-1.8.1...
/nix/store/3cpvlzij74vdj7gkvazvkwlrajqk1lmj-gopass-1.8.1-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: gopass

Partial log (click to expand)

/private/tmp/nix-build-gopass-1.8.1.drv-0
post-installation fixup
strip is /nix/store/8q05v40n0f7amgw70pk6bkb23r7hrzgn-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/p6xabs0r1fnryaxjnlr7ni1razg0c9qy-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/p6xabs0r1fnryaxjnlr7ni1razg0c9qy-gopass-1.8.1-bin
strip is /nix/store/8q05v40n0f7amgw70pk6bkb23r7hrzgn-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/br9hk8hrhz75vv94dbgaknw7zs0r6i7z-gopass-1.8.1
/nix/store/br9hk8hrhz75vv94dbgaknw7zs0r6i7z-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/7jlpy03vrh1v74b6rnrclbqc9s40ixkg-bash-4.4-p19/bin/bash"
/nix/store/br9hk8hrhz75vv94dbgaknw7zs0r6i7z-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/7jlpy03vrh1v74b6rnrclbqc9s40ixkg-bash-4.4-p19/bin/bash"
/nix/store/p6xabs0r1fnryaxjnlr7ni1razg0c9qy-gopass-1.8.1-bin

gopass tries to write a version number to it's configuaration, even when
just generating the shell completion scripts. This fails, as
/homeless-shelter is read-only inside the sandbox.
As error messages are printed to stdout instead of stderr
(see gopasspw/gopass#877), the error message
lands inside the completion script, thus breaking it.

Workaround that by setting GOPASS_CONFIG to `/dev/null`
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gopass

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/bgal6wlb5v2j34yvyn6sljyz628ximcw-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/bgal6wlb5v2j34yvyn6sljyz628ximcw-gopass-1.8.1-bin
checking for references to /build in /nix/store/bgal6wlb5v2j34yvyn6sljyz628ximcw-gopass-1.8.1-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/j32hx5k09c5fkyw1vbdc4nga5j55i4bl-gopass-1.8.1
strip is /nix/store/4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/j32hx5k09c5fkyw1vbdc4nga5j55i4bl-gopass-1.8.1
/nix/store/j32hx5k09c5fkyw1vbdc4nga5j55i4bl-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/0aa1ngxygf1iqanfbpdb10klc7r343c0-bash-4.4-p19/bin/bash"
/nix/store/j32hx5k09c5fkyw1vbdc4nga5j55i4bl-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/0aa1ngxygf1iqanfbpdb10klc7r343c0-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/j32hx5k09c5fkyw1vbdc4nga5j55i4bl-gopass-1.8.1...
/nix/store/bgal6wlb5v2j34yvyn6sljyz628ximcw-gopass-1.8.1-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gopass

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/gzbra6nk3x4bjnsh7qpcmzsw764g9k5c-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/gzbra6nk3x4bjnsh7qpcmzsw764g9k5c-gopass-1.8.1-bin
checking for references to /build in /nix/store/gzbra6nk3x4bjnsh7qpcmzsw764g9k5c-gopass-1.8.1-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/5gs1rvmwj8pkqnsdgb65wbkjk5wbirhy-gopass-1.8.1
strip is /nix/store/min150lkigznaayzpwvf8d4jdl1dqvx6-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/5gs1rvmwj8pkqnsdgb65wbkjk5wbirhy-gopass-1.8.1
/nix/store/5gs1rvmwj8pkqnsdgb65wbkjk5wbirhy-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/23kq49wszxq7k41dqfk82q5vqwlq5sww-bash-4.4-p19/bin/bash"
/nix/store/5gs1rvmwj8pkqnsdgb65wbkjk5wbirhy-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/23kq49wszxq7k41dqfk82q5vqwlq5sww-bash-4.4-p19/bin/bash"
checking for references to /build in /nix/store/5gs1rvmwj8pkqnsdgb65wbkjk5wbirhy-gopass-1.8.1...
/nix/store/gzbra6nk3x4bjnsh7qpcmzsw764g9k5c-gopass-1.8.1-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: gopass

Partial log (click to expand)

/private/tmp/nix-build-gopass-1.8.1.drv-0
post-installation fixup
strip is /nix/store/8q05v40n0f7amgw70pk6bkb23r7hrzgn-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/y1xl28fhw9i1zrszrzhi4l6iwnz6pr7b-gopass-1.8.1-bin/bin
patching script interpreter paths in /nix/store/y1xl28fhw9i1zrszrzhi4l6iwnz6pr7b-gopass-1.8.1-bin
strip is /nix/store/8q05v40n0f7amgw70pk6bkb23r7hrzgn-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/cl52zz6vy1csffzfy5cmzndwmqccnphr-gopass-1.8.1
/nix/store/cl52zz6vy1csffzfy5cmzndwmqccnphr-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkall.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/7jlpy03vrh1v74b6rnrclbqc9s40ixkg-bash-4.4-p19/bin/bash"
/nix/store/cl52zz6vy1csffzfy5cmzndwmqccnphr-gopass-1.8.1/share/go/src/github.com/gopasspw/gopass/vendor/golang.org/x/sys/unix/mkerrors.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/7jlpy03vrh1v74b6rnrclbqc9s40ixkg-bash-4.4-p19/bin/bash"
/nix/store/y1xl28fhw9i1zrszrzhi4l6iwnz6pr7b-gopass-1.8.1-bin

@xeji xeji merged commit 1588d6a into NixOS:master Jun 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants