git.iko.soy/typeable/nixpkgs
on master help sign in
gnome3.gnome-keyring: CAP_IPC_LOCK gnome-keyring-daemon

From gkd-capability.c: This program needs the CAP_IPC_LOCK posix capability. We want to allow either setuid root or file system based capabilies to work. If file system based capabilities, this is a no-op unless the root user is running the program. In that case we just drop capabilities down to IPC_LOCK. If we are setuid root, then change to the invoking user retaining just the IPC_LOCK capability. The application is aborted if for any reason we are unable to drop privileges.

commit2d6247a41477513d47cdec0e268c62296e1bb931 authorworldofpeace <worldofpeace@users.noreply.github.com> dateMon 15 Apr 2019, 14:54 (8 years ago) parent29884b2
2 files changed+15
nixos/modules/services/desktops/gnome3/gnome-keyring.nix+5 pkgs/desktops/gnome-3/core/gnome-keyring/default.nix+10
nixos/modules/services/desktops/gnome3/gnome-keyring.nix+5
@@ -37,6 +37,11 @@ with lib;
3737
3838 security.pam.services.login.enableGnomeKeyring = true;
3939
40+ security.wrappers.gnome-keyring-daemon = {
41+ source = "${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon";
42+ capabilities = "cap_ipc_lock=ep";
43+ };
44+
4045 };
4146
4247}
pkgs/desktops/gnome-3/core/gnome-keyring/default.nix+10
@@ -46,6 +46,16 @@ stdenv.mkDerivation rec {
4646 make check
4747 '';
4848
49+ # Use wrapped gnome-keyring-daemon with cap_ipc_lock=ep
50+ postFixup = ''
51+ files=($out/etc/xdg/autostart/* $out/share/dbus-1/services/*)
52+
53+ for file in ''${files[*]}; do
54+ substituteInPlace $file \
55+ --replace "$out/bin/gnome-keyring-daemon" "/run/wrappers/bin/gnome-keyring-daemon"
56+ done
57+ '';
58+
4959 passthru = {
5060 updateScript = gnome3.updateScript {
5161 packageName = "gnome-keyring";