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

kwallet-pam: wrap pam_kwallet_init #70140

Merged
merged 1 commit into from Oct 1, 2019
Merged

Conversation

matthewbauer
Copy link
Member

This needs a compatible env as kwalletd daemon. Need to wrap it to
correct this.

Fixes #68316

Motivation for this change
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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@worldofpeace
Copy link
Contributor

This is weird, it doesn't get automatically wrapped at libexec?
I remember fixing that.

@worldofpeace
Copy link
Contributor

Ahh, that's because it's a bash script

#!/nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/sh

if test -n "$PAM_KWALLET5_LOGIN" ; then
    env | /nix/store/abmhyn7g89695m9zaqjqg4y94a065mm7-socat-1.7.3.3/bin/socat STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN
fi

@@ -4,7 +4,8 @@ mkDerivation {
name = "kwallet-pam";
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ pam socat libgcrypt qtbase kwallet ];
postPatch = ''
sed -i pam_kwallet_init -e "s|socat|${lib.getBin socat}/bin/socat|"
qtWrapperArgs = [ "--prefix PATH : ${lib.getBin socat}/bin" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a dontWrapQtApps = true;?
Just to make it clear pam_kwallet_init is a script and we have to wrap manually.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the above comment.

@worldofpeace worldofpeace added the 9.needs: port to stable A PR needs a backport to the stable release. label Oct 1, 2019
@@ -4,7 +4,8 @@ mkDerivation {
name = "kwallet-pam";
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ pam socat libgcrypt qtbase kwallet ];
postPatch = ''
sed -i pam_kwallet_init -e "s|socat|${lib.getBin socat}/bin/socat|"
qtWrapperArgs = [ "--prefix PATH : ${lib.getBin socat}/bin" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to leave the patch in place for the absolute path of socat. I don't like prefixing PATH when we know exactly what program we are looking for; there's not telling in the future what other programs might end up at that PATH entry.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, although the other side of this is we have a sed expression that may or may not always work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. We should change that to substituteInPlace so the build will fail if it stops working. (Not necessary for this PR.)

This needs a compatible env as kwalletd daemon. Need to wrap it to
correct this.

Fixes NixOS#68316
@matthewbauer
Copy link
Member Author

Updated

@worldofpeace
Copy link
Contributor

backported in d079834

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.

Can't automatically login to KDE wallet
3 participants