mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
Adapting everything for the merged permissions wrappers work.
This commit is contained in:
parent
390ab0b3ef
commit
98c058a1ee
55 changed files with 162 additions and 131 deletions
|
@ -169,7 +169,7 @@ in
|
||||||
${cfg.extraInit}
|
${cfg.extraInit}
|
||||||
|
|
||||||
# The setuid wrappers override other bin directories.
|
# The setuid wrappers override other bin directories.
|
||||||
export PATH="${config.security.wrapperDir}:$PATH"
|
export PATH="${config.security.permissionsWrapperDir}:$PATH"
|
||||||
|
|
||||||
# ~/bin if it exists overrides other bin directories.
|
# ~/bin if it exists overrides other bin directories.
|
||||||
export PATH="$HOME/bin:$PATH"
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
|
|
@ -262,7 +262,7 @@ chroot $mountPoint /nix/var/nix/profiles/system/activate
|
||||||
# Ask the user to set a root password.
|
# Ask the user to set a root password.
|
||||||
if [ -z "$noRootPasswd" ] && [ -x $mountPoint/var/setuid-wrappers/passwd ] && [ -t 0 ]; then
|
if [ -z "$noRootPasswd" ] && [ -x $mountPoint/var/setuid-wrappers/passwd ] && [ -t 0 ]; then
|
||||||
echo "setting root password..."
|
echo "setting root password..."
|
||||||
chroot $mountPoint /var/setuid-wrappers/passwd
|
chroot $mountPoint /var/permissions-wrappers/passwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ in
|
||||||
security.permissionsWrappers.setuid =
|
security.permissionsWrappers.setuid =
|
||||||
[ { program = "kbdlight";
|
[ { program = "kbdlight";
|
||||||
source = "${pkgs.kbdlight.out}/bin/kbdlight";
|
source = "${pkgs.kbdlight.out}/bin/kbdlight";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}];
|
}];
|
||||||
|
|
|
@ -25,7 +25,7 @@ in
|
||||||
security.permissionsWrappers.setuid =
|
security.permissionsWrappers.setuid =
|
||||||
[ { program = "light";
|
[ { program = "light";
|
||||||
source = "${pkgs.light.out}/bin/light";
|
source = "${pkgs.light.out}/bin/light";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}];
|
}];
|
||||||
|
|
|
@ -102,18 +102,18 @@ in
|
||||||
chgpasswd = { rootOK = true; };
|
chgpasswd = { rootOK = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
security.setuidPrograms =
|
security.permissionsWrappers.setuid =
|
||||||
[
|
[
|
||||||
{ program = "su";
|
{ program = "su";
|
||||||
source = "${pkgs.shadow.su}/bin/su";
|
source = "${pkgs.shadow.su}/bin/su";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ program = "chfn";
|
{ program = "chfn";
|
||||||
source = "${pkgs.shadow.out}/bin/chfn";
|
source = "${pkgs.shadow.out}/bin/chfn";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
25
nixos/modules/programs/unity3d.nix
Normal file
25
nixos/modules/programs/unity3d.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.programs.unity3d;
|
||||||
|
in {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
programs.unity3d.enable = mkEnableOption "Unity3D, a game development tool";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
security.permissionsWrappers.setuid = [{
|
||||||
|
program = "unity-chrome-sandbox";
|
||||||
|
source = "${pkgs.unity3d.sandbox}/bin/unity-chrome-sandbox";
|
||||||
|
owner = "root";
|
||||||
|
#group = "root";
|
||||||
|
setuid = true;
|
||||||
|
#setgid = true;
|
||||||
|
}];
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.unity3d ];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ with lib;
|
||||||
config = mkIf (cfg.confineSUIDApplications) {
|
config = mkIf (cfg.confineSUIDApplications) {
|
||||||
security.apparmor.profiles = [ (pkgs.writeText "ping" ''
|
security.apparmor.profiles = [ (pkgs.writeText "ping" ''
|
||||||
#include <tunables/global>
|
#include <tunables/global>
|
||||||
/var/setuid-wrappers/ping {
|
/var/permissions-wrappers/ping {
|
||||||
#include <abstractions/base>
|
#include <abstractions/base>
|
||||||
#include <abstractions/consoles>
|
#include <abstractions/consoles>
|
||||||
#include <abstractions/nameservice>
|
#include <abstractions/nameservice>
|
||||||
|
@ -33,7 +33,7 @@ with lib;
|
||||||
${pkgs.attr.out}/lib/libattr.so* mr,
|
${pkgs.attr.out}/lib/libattr.so* mr,
|
||||||
|
|
||||||
${pkgs.iputils}/bin/ping mixr,
|
${pkgs.iputils}/bin/ping mixr,
|
||||||
/var/setuid-wrappers/ping.real r,
|
/var/permissions-wrappers/ping.real r,
|
||||||
|
|
||||||
#/etc/modules.conf r,
|
#/etc/modules.conf r,
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ in
|
||||||
[
|
[
|
||||||
{ program = "login_duo";
|
{ program = "login_duo";
|
||||||
source = "${pkgs.duo-unix.out}/bin/login_duo";
|
source = "${pkgs.duo-unix.out}/bin/login_duo";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,34 +444,35 @@ in
|
||||||
|
|
||||||
security.permissionsWrappers.setuid =
|
security.permissionsWrappers.setuid =
|
||||||
[
|
[
|
||||||
(optionals config.security.pam.enableEcryptfs
|
{ program = "unix_chkpwd";
|
||||||
{ program = "mount.ecryptfs_private"
|
source = "${pkgs.pam}/sbin/unix_chkpwd.orig";
|
||||||
source = "${pkgs.ecryptfs.out}/bin/mount.ecryptfs_private";
|
owner = "root";
|
||||||
user = "root";
|
group = "root";
|
||||||
group = "root";
|
setuid = true;
|
||||||
setuid = true;
|
}
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
(optionals config.security.pam.enableEcryptfs
|
] ++ (optional config.security.pam.enableEcryptfs
|
||||||
{ program = "umount.ecryptfs_private";
|
{ program = "umount.ecryptfs_private";
|
||||||
source = "${pkgs.ecryptfs.out}/bin/umount.ecryptfs_private";
|
source = "${pkgs.ecryptfs.out}/bin/umount.ecryptfs_private";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
})
|
}
|
||||||
]
|
) ++ (optional config.security.pam.enableEcryptfs
|
||||||
|
{ program = "mount.ecryptfs_private";
|
||||||
|
source = "${pkgs.ecryptfs.out}/bin/mount.ecryptfs_private";
|
||||||
|
owner = "root";
|
||||||
|
group = "root";
|
||||||
|
setuid = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
environment.etc =
|
environment.etc =
|
||||||
mapAttrsToList (n: v: makePAMService v) config.security.pam.services;
|
mapAttrsToList (n: v: makePAMService v) config.security.pam.services;
|
||||||
|
|
||||||
security.setuidOwners = [ {
|
|
||||||
program = "unix_chkpwd";
|
|
||||||
source = "${pkgs.pam}/sbin/unix_chkpwd.orig";
|
|
||||||
owner = "root";
|
|
||||||
setuid = true;
|
|
||||||
} ];
|
|
||||||
|
|
||||||
security.pam.services =
|
security.pam.services =
|
||||||
{ other.text =
|
{ other.text =
|
||||||
''
|
''
|
||||||
|
|
|
@ -37,20 +37,19 @@ in
|
||||||
[
|
[
|
||||||
{ program = "pmount";
|
{ program = "pmount";
|
||||||
source = "${pkgs.pmount.out}/bin/pmount";
|
source = "${pkgs.pmount.out}/bin/pmount";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ program = "pumount";
|
{ program = "pumount";
|
||||||
source = "${pkgs.pmount.out}/bin/pumount";
|
source = "${pkgs.pmount.out}/bin/pumount";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
setuidPrograms = [ "pmount" "pumount" ];
|
|
||||||
environment.systemPackages = [ pkgs.pmount ];
|
environment.systemPackages = [ pkgs.pmount ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,10 +3,17 @@ let
|
||||||
|
|
||||||
inherit (config.security) permissionsWrapperDir;
|
inherit (config.security) permissionsWrapperDir;
|
||||||
|
|
||||||
|
isNotNull = v: if v != null then true else false;
|
||||||
|
|
||||||
cfg = config.security.permissionsWrappers;
|
cfg = config.security.permissionsWrappers;
|
||||||
|
|
||||||
setcapWrappers = import ./setcap-wrapper-drv.nix { };
|
setcapWrappers = import ./setcap-wrapper-drv.nix {
|
||||||
setuidWrappers = import ./setuid-wrapper-drv.nix { };
|
inherit config lib pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
|
setuidWrappers = import ./setuid-wrapper-drv.nix {
|
||||||
|
inherit config lib pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
###### Activation script for the setcap wrappers
|
###### Activation script for the setcap wrappers
|
||||||
configureSetcapWrapper =
|
configureSetcapWrapper =
|
||||||
|
@ -16,8 +23,7 @@ let
|
||||||
, owner ? "nobody"
|
, owner ? "nobody"
|
||||||
, group ? "nogroup"
|
, group ? "nogroup"
|
||||||
, setcap ? false
|
, setcap ? false
|
||||||
}:
|
}: ''
|
||||||
''
|
|
||||||
cp ${setcapWrappers}/bin/${program}.wrapper ${permissionsWrapperDir}/${program}
|
cp ${setcapWrappers}/bin/${program}.wrapper ${permissionsWrapperDir}/${program}
|
||||||
|
|
||||||
# Prevent races
|
# Prevent races
|
||||||
|
@ -43,22 +49,22 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
###### Activation script for the setuid wrappers
|
###### Activation script for the setuid wrappers
|
||||||
makeSetuidWrapper =
|
configureSetuidWrapper =
|
||||||
{ program
|
{ program
|
||||||
, source ? null
|
, source ? null
|
||||||
, owner ? "nobody"
|
, owner ? "nobody"
|
||||||
|
# Legacy code I can't find :(
|
||||||
|
, user ? null
|
||||||
, group ? "nogroup"
|
, group ? "nogroup"
|
||||||
, setuid ? false
|
, setuid ? false
|
||||||
, setgid ? false
|
, setgid ? false
|
||||||
, permissions ? "u+rx,g+x,o+x"
|
, permissions ? "u+rx,g+x,o+x"
|
||||||
}:
|
}: ''
|
||||||
|
|
||||||
''
|
|
||||||
cp ${setuidWrappers}/bin/${program}.wrapper ${permissionsWrapperDir}/${program}
|
cp ${setuidWrappers}/bin/${program}.wrapper ${permissionsWrapperDir}/${program}
|
||||||
|
|
||||||
# Prevent races
|
# Prevent races
|
||||||
chmod 0000 ${permissionsWrapperDir}/${program}
|
chmod 0000 ${permissionsWrapperDir}/${program}
|
||||||
chown ${owner}.${group} ${permissionsWrapperDir}/${program}
|
chown ${if user != null then user else owner}.${group} ${permissionsWrapperDir}/${program}
|
||||||
|
|
||||||
chmod "u${if setuid then "+" else "-"}s,g${if setgid then "+" else "-"}s,${permissions}" ${permissionsWrapperDir}/${program}
|
chmod "u${if setuid then "+" else "-"}s,g${if setgid then "+" else "-"}s,${permissions}" ${permissionsWrapperDir}/${program}
|
||||||
'';
|
'';
|
||||||
|
@ -68,12 +74,12 @@ in
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
security.permissionsWrappers.setcap = mkOption {
|
security.permissionsWrappers.setcap = lib.mkOption {
|
||||||
type = types.listOf types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
default = [];
|
default = [];
|
||||||
example =
|
example =
|
||||||
[ { program = "ping";
|
[ { program = "ping";
|
||||||
source = "${pkgs.iputils.out}/bin/ping"
|
source = "${pkgs.iputils.out}/bin/ping";
|
||||||
owner = "nobody";
|
owner = "nobody";
|
||||||
group = "nogroup";
|
group = "nogroup";
|
||||||
setcap = true;
|
setcap = true;
|
||||||
|
@ -106,12 +112,12 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
security.permissionsWrappers.setuid = mkOption {
|
security.permissionsWrappers.setuid = lib.mkOption {
|
||||||
type = types.listOf types.attrs;
|
type = lib.types.listOf lib.types.attrs;
|
||||||
default = [];
|
default = [];
|
||||||
example =
|
example =
|
||||||
[ { program = "sendmail";
|
[ { program = "sendmail";
|
||||||
source = "${pkgs.sendmail.bin}/bin/sendmail";
|
source = "/nix/store/.../bin/sendmail";
|
||||||
owner = "nobody";
|
owner = "nobody";
|
||||||
group = "postdrop";
|
group = "postdrop";
|
||||||
setuid = false;
|
setuid = false;
|
||||||
|
@ -126,8 +132,8 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
security.permissionsWrapperDir = mkOption {
|
security.permissionsWrapperDir = lib.mkOption {
|
||||||
type = types.path;
|
type = lib.types.path;
|
||||||
default = "/var/permissions-wrappers";
|
default = "/var/permissions-wrappers";
|
||||||
internal = true;
|
internal = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -152,7 +158,7 @@ in
|
||||||
|
|
||||||
###### setcap activation script
|
###### setcap activation script
|
||||||
system.activationScripts.setcap =
|
system.activationScripts.setcap =
|
||||||
stringAfter [ "users" ]
|
lib.stringAfter [ "users" ]
|
||||||
''
|
''
|
||||||
# Look in the system path and in the default profile for
|
# Look in the system path and in the default profile for
|
||||||
# programs to be wrapped.
|
# programs to be wrapped.
|
||||||
|
@ -168,12 +174,12 @@ in
|
||||||
# Concatenate the generated shell slices to configure
|
# Concatenate the generated shell slices to configure
|
||||||
# wrappers for each program needing specialized capabilities.
|
# wrappers for each program needing specialized capabilities.
|
||||||
|
|
||||||
${concatMapStrings configureSetcapWrapper cfg.setcap}
|
${lib.concatMapStrings configureSetcapWrapper (builtins.filter isNotNull cfg.setcap)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
###### setuid activation script
|
###### setuid activation script
|
||||||
system.activationScripts.setuid =
|
system.activationScripts.setuid =
|
||||||
stringAfter [ "users" ]
|
lib.stringAfter [ "users" ]
|
||||||
''
|
''
|
||||||
# Look in the system path and in the default profile for
|
# Look in the system path and in the default profile for
|
||||||
# programs to be wrapped.
|
# programs to be wrapped.
|
||||||
|
@ -189,7 +195,7 @@ in
|
||||||
# Concatenate the generated shell slices to configure
|
# Concatenate the generated shell slices to configure
|
||||||
# wrappers for each program needing specialized capabilities.
|
# wrappers for each program needing specialized capabilities.
|
||||||
|
|
||||||
${concatMapStrings configureSetuidWrapper cfg.setuid}
|
${lib.concatMapStrings configureSetuidWrapper (builtins.filter isNotNull cfg.setuid)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
source=/nix/var/nix/profiles/default/bin/${program}
|
source=/nix/var/nix/profiles/default/bin/${program}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gcc -Wall -O2 -DWRAPPER_SETCAP=1 -DSOURCE_PROG=\"$source\" -DWRAPPER_DIR=\"${cfg.permissionsWrapperDir}\" \
|
gcc -Wall -O2 -DWRAPPER_SETCAP=1 -DSOURCE_PROG=\"$source\" -DWRAPPER_DIR=\"${config.security.permissionsWrapperDir}\" \
|
||||||
-lcap-ng -lcap ${./permissions-wrapper.c} -o $out/bin/${program}.wrapper
|
-lcap-ng -lcap ${./permissions-wrapper.c} -o $out/bin/${program}.wrapper
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
@ -32,6 +32,6 @@ pkgs.stdenv.mkDerivation {
|
||||||
|
|
||||||
# Concat together all of our shell splices to compile
|
# Concat together all of our shell splices to compile
|
||||||
# binary wrapper programs for all configured setcap programs.
|
# binary wrapper programs for all configured setcap programs.
|
||||||
${concatMapStrings mkSetcapWrapper cfg.setcap}
|
${lib.concatMapStrings mkSetcapWrapper cfg.setcap}
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
source=/nix/var/nix/profiles/default/bin/${program}
|
source=/nix/var/nix/profiles/default/bin/${program}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gcc -Wall -O2 -DWRAPPER_SETUID=1 -DSOURCE_PROG=\"$source\" -DWRAPPER_DIR=\"${cfg.permissionsWrapperDir}\" \
|
gcc -Wall -O2 -DWRAPPER_SETUID=1 -DSOURCE_PROG=\"$source\" -DWRAPPER_DIR=\"${config.security.permissionsWrapperDir}\" \
|
||||||
-lcap-ng -lcap ${./permissions-wrapper.c} -o $out/bin/${program}.wrapper
|
-lcap-ng -lcap ${./permissions-wrapper.c} -o $out/bin/${program}.wrapper
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
@ -31,6 +31,6 @@ pkgs.stdenv.mkDerivation {
|
||||||
|
|
||||||
# Concat together all of our shell splices to compile
|
# Concat together all of our shell splices to compile
|
||||||
# binary wrapper programs for all configured setcap programs.
|
# binary wrapper programs for all configured setcap programs.
|
||||||
${concatMapStrings mkSetuidWrapper cfg.setuid}
|
${lib.concatMapStrings mkSetuidWrapper cfg.setuid}
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
|
|
@ -87,20 +87,18 @@ in
|
||||||
[
|
[
|
||||||
{ program = "pkexec";
|
{ program = "pkexec";
|
||||||
source = "${pkgs.polkit.out}/bin/pkexec";
|
source = "${pkgs.polkit.out}/bin/pkexec";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
];
|
|
||||||
|
|
||||||
security.setuidOwners = [
|
{ program = "polkit-agent-helper-1";
|
||||||
{ program = "polkit-agent-helper-1";
|
owner = "root";
|
||||||
owner = "root";
|
group = "root";
|
||||||
group = "root";
|
setuid = true;
|
||||||
setuid = true;
|
source = "${pkgs.polkit.out}/lib/polkit-1/polkit-agent-helper-1";
|
||||||
source = "${pkgs.polkit.out}/lib/polkit-1/polkit-agent-helper-1";
|
}
|
||||||
}
|
];
|
||||||
];
|
|
||||||
|
|
||||||
system.activationScripts.polkit =
|
system.activationScripts.polkit =
|
||||||
''
|
''
|
||||||
|
|
|
@ -85,14 +85,14 @@ in
|
||||||
[
|
[
|
||||||
{ program = "sudo";
|
{ program = "sudo";
|
||||||
source = "${pkgs.sudo.out}/bin/sudo";
|
source = "${pkgs.sudo.out}/bin/sudo";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
{ program = "sudoedit"
|
{ program = "sudoedit";
|
||||||
source = "${pkgs.sudo.out}/bin/sudo";
|
source = "${pkgs.sudo.out}/bin/sudoedit";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
cronJob = ''
|
cronJob = ''
|
||||||
@reboot logcheck env PATH=/var/setuid-wrappers:$PATH nice -n10 ${pkgs.logcheck}/sbin/logcheck -R ${flags}
|
@reboot logcheck env PATH=/var/permissions-wrappers:$PATH nice -n10 ${pkgs.logcheck}/sbin/logcheck -R ${flags}
|
||||||
2 ${cfg.timeOfDay} * * * logcheck env PATH=/var/setuid-wrappers:$PATH nice -n10 ${pkgs.logcheck}/sbin/logcheck ${flags}
|
2 ${cfg.timeOfDay} * * * logcheck env PATH=/var/permissions-wrappers:$PATH nice -n10 ${pkgs.logcheck}/sbin/logcheck ${flags}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
writeIgnoreRule = name: {level, regex, ...}:
|
writeIgnoreRule = name: {level, regex, ...}:
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
''
|
''
|
||||||
base_dir = ${baseDir}
|
base_dir = ${baseDir}
|
||||||
protocols = ${concatStringsSep " " cfg.protocols}
|
protocols = ${concatStringsSep " " cfg.protocols}
|
||||||
sendmail_path = /var/setuid-wrappers/sendmail
|
sendmail_path = /var/permissions-wrappers/sendmail
|
||||||
''
|
''
|
||||||
|
|
||||||
(if isNull cfg.sslServerCert then ''
|
(if isNull cfg.sslServerCert then ''
|
||||||
|
|
|
@ -70,7 +70,7 @@ in
|
||||||
etc."exim.conf".text = ''
|
etc."exim.conf".text = ''
|
||||||
exim_user = ${cfg.user}
|
exim_user = ${cfg.user}
|
||||||
exim_group = ${cfg.group}
|
exim_group = ${cfg.group}
|
||||||
exim_path = /var/setuid-wrappers/exim
|
exim_path = /var/permissions-wrappers/exim
|
||||||
spool_directory = ${cfg.spoolDir}
|
spool_directory = ${cfg.spoolDir}
|
||||||
${cfg.config}
|
${cfg.config}
|
||||||
'';
|
'';
|
||||||
|
@ -93,11 +93,11 @@ in
|
||||||
[
|
[
|
||||||
{ program = "exim";
|
{ program = "exim";
|
||||||
source = "${pkgs.exim.out}/bin/exim";
|
source = "${pkgs.exim.out}/bin/exim";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|
||||||
systemd.services.exim = {
|
systemd.services.exim = {
|
||||||
description = "Exim Mail Daemon";
|
description = "Exim Mail Daemon";
|
||||||
|
|
|
@ -26,7 +26,7 @@ with lib;
|
||||||
|
|
||||||
config = mkIf (config.services.mail.sendmailSetuidWrapper != null) {
|
config = mkIf (config.services.mail.sendmailSetuidWrapper != null) {
|
||||||
|
|
||||||
security.setuidOwners = [ config.services.mail.sendmailSetuidWrapper ];
|
security.permissionsWrappers.setuid = [ config.services.mail.sendmailSetuidWrapper ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ let
|
||||||
cap=$(sed -nr 's/.*#%#\s+capabilities\s*=\s*(.+)/\1/p' $file)
|
cap=$(sed -nr 's/.*#%#\s+capabilities\s*=\s*(.+)/\1/p' $file)
|
||||||
|
|
||||||
wrapProgram $file \
|
wrapProgram $file \
|
||||||
--set PATH "/var/setuid-wrappers:/run/current-system/sw/bin:/run/current-system/sw/bin" \
|
--set PATH "/var/permissions-wrappers:/run/current-system/sw/bin:/run/current-system/sw/bin" \
|
||||||
--set MUNIN_LIBDIR "${pkgs.munin}/lib" \
|
--set MUNIN_LIBDIR "${pkgs.munin}/lib" \
|
||||||
--set MUNIN_PLUGSTATE "/var/run/munin"
|
--set MUNIN_PLUGSTATE "/var/run/munin"
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ in
|
||||||
|
|
||||||
mkdir -p /etc/munin/plugins
|
mkdir -p /etc/munin/plugins
|
||||||
rm -rf /etc/munin/plugins/*
|
rm -rf /etc/munin/plugins/*
|
||||||
PATH="/var/setuid-wrappers:/run/current-system/sw/bin:/run/current-system/sw/bin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
|
PATH="/var/permissions-wrappers:/run/current-system/sw/bin:/run/current-system/sw/bin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.munin}/sbin/munin-node --config ${nodeConf} --servicedir /etc/munin/plugins/";
|
ExecStart = "${pkgs.munin}/sbin/munin-node --config ${nodeConf} --servicedir /etc/munin/plugins/";
|
||||||
|
|
|
@ -124,7 +124,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
mailer = mkOption {
|
mailer = mkOption {
|
||||||
default = "/var/setuid-wrappers/sendmail";
|
default = "/var/permissions-wrappers/sendmail";
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = ''
|
description = ''
|
||||||
Sendmail-compatible binary to be used to send the messages.
|
Sendmail-compatible binary to be used to send the messages.
|
||||||
|
|
|
@ -30,7 +30,7 @@ let
|
||||||
''
|
''
|
||||||
[ global ]
|
[ global ]
|
||||||
security = ${cfg.securityType}
|
security = ${cfg.securityType}
|
||||||
passwd program = /var/setuid-wrappers/passwd %u
|
passwd program = /var/permissions-wrappers/passwd %u
|
||||||
pam password change = ${smbToString cfg.syncPasswordsByPam}
|
pam password change = ${smbToString cfg.syncPasswordsByPam}
|
||||||
invalid users = ${smbToString cfg.invalidUsers}
|
invalid users = ${smbToString cfg.invalidUsers}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ in
|
||||||
setgid = false;
|
setgid = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
security.setuidOwners = [ cfg.setuidWrapper ];
|
security.permissionsWrappers.setuid = [ cfg.setuidWrapper ];
|
||||||
|
|
||||||
systemd.services.gale-galed = {
|
systemd.services.gale-galed = {
|
||||||
description = "Gale messaging daemon";
|
description = "Gale messaging daemon";
|
||||||
|
|
|
@ -18,7 +18,7 @@ let
|
||||||
var_prefix = "${stateDir}"
|
var_prefix = "${stateDir}"
|
||||||
prayer_user = "${prayerUser}"
|
prayer_user = "${prayerUser}"
|
||||||
prayer_group = "${prayerGroup}"
|
prayer_group = "${prayerGroup}"
|
||||||
sendmail_path = "/var/setuid-wrappers/sendmail"
|
sendmail_path = "/var/permissions-wrappers/sendmail"
|
||||||
|
|
||||||
use_http_port ${cfg.port}
|
use_http_port ${cfg.port}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,10 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
security.setuidOwners = map (program: {
|
security.permissionsWrappers.setuid = map (program: {
|
||||||
inherit program;
|
inherit program;
|
||||||
|
|
||||||
|
source = "${pkgs.atd}/bin/${program}";
|
||||||
owner = "atd";
|
owner = "atd";
|
||||||
group = "atd";
|
group = "atd";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
|
|
|
@ -20,7 +20,7 @@ let
|
||||||
cronNixosPkg = pkgs.cron.override {
|
cronNixosPkg = pkgs.cron.override {
|
||||||
# The mail.nix nixos module, if there is any local mail system enabled,
|
# The mail.nix nixos module, if there is any local mail system enabled,
|
||||||
# should have sendmail in this path.
|
# should have sendmail in this path.
|
||||||
sendmailPath = "/var/setuid-wrappers/sendmail";
|
sendmailPath = "/var/permissions-wrappers/sendmail";
|
||||||
};
|
};
|
||||||
|
|
||||||
allFiles =
|
allFiles =
|
||||||
|
@ -61,7 +61,7 @@ in
|
||||||
A list of Cron jobs to be appended to the system-wide
|
A list of Cron jobs to be appended to the system-wide
|
||||||
crontab. See the manual page for crontab for the expected
|
crontab. See the manual page for crontab for the expected
|
||||||
format. If you want to get the results mailed you must setuid
|
format. If you want to get the results mailed you must setuid
|
||||||
sendmail. See <option>security.setuidOwners</option>
|
sendmail. See <option>security.permissionsWrappers.setuid</option>
|
||||||
|
|
||||||
If neither /var/cron/cron.deny nor /var/cron/cron.allow exist only root
|
If neither /var/cron/cron.deny nor /var/cron/cron.allow exist only root
|
||||||
will is allowed to have its own crontab file. The /var/cron/cron.deny file
|
will is allowed to have its own crontab file. The /var/cron/cron.deny file
|
||||||
|
@ -99,7 +99,7 @@ in
|
||||||
[
|
[
|
||||||
{ program = "crontab";
|
{ program = "crontab";
|
||||||
source = "${pkgs.cronNixosPkg.out}/bin/crontab";
|
source = "${pkgs.cronNixosPkg.out}/bin/crontab";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ in
|
||||||
fcronallow = /etc/fcron.allow
|
fcronallow = /etc/fcron.allow
|
||||||
fcrondeny = /etc/fcron.deny
|
fcrondeny = /etc/fcron.deny
|
||||||
shell = /bin/sh
|
shell = /bin/sh
|
||||||
sendmail = /var/setuid-wrappers/sendmail
|
sendmail = /var/permissions-wrappers/sendmail
|
||||||
editor = /run/current-system/sw/bin/vi
|
editor = /run/current-system/sw/bin/vi
|
||||||
'';
|
'';
|
||||||
target = "fcron.conf";
|
target = "fcron.conf";
|
||||||
|
@ -110,7 +110,7 @@ in
|
||||||
[
|
[
|
||||||
{ program = "fcrontab";
|
{ program = "fcrontab";
|
||||||
source = "${pkgs.fcron.out}/bin/fcrontab";
|
source = "${pkgs.fcron.out}/bin/fcrontab";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ let
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
sed '${./dbus-system-local.conf.in}' \
|
sed '${./dbus-system-local.conf.in}' \
|
||||||
-e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \
|
-e 's,@servicehelper@,${config.security.permissionsWrapperDir}/dbus-daemon-launch-helper,g' \
|
||||||
-e 's,@extra@,${systemExtraxml},' \
|
-e 's,@extra@,${systemExtraxml},' \
|
||||||
> "$out/system-local.conf"
|
> "$out/system-local.conf"
|
||||||
|
|
||||||
|
@ -102,9 +102,9 @@ in
|
||||||
|
|
||||||
systemd.packages = [ pkgs.dbus.daemon ];
|
systemd.packages = [ pkgs.dbus.daemon ];
|
||||||
|
|
||||||
security.setuidOwners = singleton
|
security.permissionsWrappers.setuid = singleton
|
||||||
{ program = "dbus-daemon-launch-helper";
|
{ program = "dbus-daemon-launch-helper";
|
||||||
source = "${pkgs.dbus_daemon.out}/libexec/dbus-daemon-launch-helper";
|
source = "${pkgs.dbus_daemon}/libexec/dbus-daemon-launch-helper";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = "messagebus";
|
group = "messagebus";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
|
|
|
@ -66,7 +66,7 @@ in
|
||||||
[
|
[
|
||||||
{ program = "e_freqset";
|
{ program = "e_freqset";
|
||||||
source = "${e.enlightenment.out}/bin/e_freqset";
|
source = "${e.enlightenment.out}/bin/e_freqset";
|
||||||
user = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
setuid = true;
|
setuid = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
security.setuidOwners = singleton
|
security.permissionsWrappers.setuid = singleton
|
||||||
{ program = "kcheckpass";
|
{ program = "kcheckpass";
|
||||||
source = "${kde_workspace}/lib/kde4/libexec/kcheckpass";
|
source = "${kde_workspace}/lib/kde4/libexec/kcheckpass";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
|
|
|
@ -47,7 +47,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
security.setuidOwners = [
|
security.permissionsWrappers.setuid = [
|
||||||
{
|
{
|
||||||
program = "kcheckpass";
|
program = "kcheckpass";
|
||||||
source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass";
|
source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass";
|
||||||
|
|
|
@ -63,7 +63,7 @@ in
|
||||||
boot.extraModulePackages = [ virtualbox ];
|
boot.extraModulePackages = [ virtualbox ];
|
||||||
environment.systemPackages = [ virtualbox ];
|
environment.systemPackages = [ virtualbox ];
|
||||||
|
|
||||||
security.setuidOwners = let
|
security.permissionsWrappers.setuid = let
|
||||||
mkSuid = program: {
|
mkSuid = program: {
|
||||||
inherit program;
|
inherit program;
|
||||||
source = "${virtualbox}/libexec/virtualbox/${program}";
|
source = "${virtualbox}/libexec/virtualbox/${program}";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ fetchurl, stdenv, glib, xorg, cairo, gtk, pango, makeWrapper, openssl, bzip2,
|
{ fetchurl, stdenv, glib, xorg, cairo, gtk, pango, makeWrapper, openssl, bzip2,
|
||||||
pkexecPath ? "/var/setuid-wrappers/pkexec", libredirect,
|
pkexecPath ? "/var/permissions-wrappers/pkexec", libredirect,
|
||||||
gksuSupport ? false, gksu}:
|
gksuSupport ? false, gksu}:
|
||||||
|
|
||||||
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
||||||
|
|
|
@ -26,7 +26,7 @@ index 50e8ad8..eec0ed2 100644
|
||||||
+ is_nixos=no
|
+ is_nixos=no
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
+if [ -u /var/setuid-wrappers/gksign ]; then
|
+if [ -u /var/permissions-wrappers/gksign ]; then
|
||||||
+ cat <<EOM
|
+ cat <<EOM
|
||||||
+
|
+
|
||||||
+Gale appears to have already been set up via the NixOS module system (check
|
+Gale appears to have already been set up via the NixOS module system (check
|
||||||
|
|
|
@ -4,7 +4,7 @@ Date: Thu, 26 Nov 2015 21:03:35 +0100
|
||||||
Subject: [PATCH] Lookup dumpcap in PATH
|
Subject: [PATCH] Lookup dumpcap in PATH
|
||||||
|
|
||||||
NixOS patch: Look for dumpcap in PATH first, because there may be a
|
NixOS patch: Look for dumpcap in PATH first, because there may be a
|
||||||
dumpcap setuid-wrapper that we want to use instead of the default
|
dumpcap permissions-wrapper that we want to use instead of the default
|
||||||
non-setuid dumpcap binary.
|
non-setuid dumpcap binary.
|
||||||
|
|
||||||
Also change execv() to execvp() because we've set argv[0] to "dumpcap"
|
Also change execv() to execvp() because we've set argv[0] to "dumpcap"
|
||||||
|
@ -27,7 +27,7 @@ index 970688e..49914d5 100644
|
||||||
- exename = g_strdup_printf("%s/dumpcap", progfile_dir);
|
- exename = g_strdup_printf("%s/dumpcap", progfile_dir);
|
||||||
+ /*
|
+ /*
|
||||||
+ * NixOS patch: Look for dumpcap in PATH first, because there may be a
|
+ * NixOS patch: Look for dumpcap in PATH first, because there may be a
|
||||||
+ * dumpcap setuid-wrapper that we want to use instead of the default
|
+ * dumpcap permissions-wrapper that we want to use instead of the default
|
||||||
+ * non-setuid dumpcap binary.
|
+ * non-setuid dumpcap binary.
|
||||||
+ */
|
+ */
|
||||||
+ if (system("command -v dumpcap >/dev/null") == 0) {
|
+ if (system("command -v dumpcap >/dev/null") == 0) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ index a9d8ac4..85f13f5 100644
|
||||||
- # # arguments: '-i -t'
|
- # # arguments: '-i -t'
|
||||||
- # # }
|
- # # }
|
||||||
+ config.action_mailer.sendmail_settings = {
|
+ config.action_mailer.sendmail_settings = {
|
||||||
+ location: '/var/setuid-wrappers/sendmail',
|
+ location: '/var/permissions-wrappers/sendmail',
|
||||||
+ arguments: '-i -t'
|
+ arguments: '-i -t'
|
||||||
+ }
|
+ }
|
||||||
config.action_mailer.perform_deliveries = true
|
config.action_mailer.perform_deliveries = true
|
||||||
|
|
|
@ -96,7 +96,7 @@ index 95dc9a7..39170bc 100644
|
||||||
/* get the path to the executable */
|
/* get the path to the executable */
|
||||||
char szPath[RTPATH_MAX];
|
char szPath[RTPATH_MAX];
|
||||||
- RTPathAppPrivateArch(szPath, sizeof(szPath) - 1);
|
- RTPathAppPrivateArch(szPath, sizeof(szPath) - 1);
|
||||||
+ RTStrCopy(szPath, sizeof(szPath) - 1, "/var/setuid-wrappers");
|
+ RTStrCopy(szPath, sizeof(szPath) - 1, "/var/permissions-wrappers");
|
||||||
size_t cchBufLeft = strlen(szPath);
|
size_t cchBufLeft = strlen(szPath);
|
||||||
szPath[cchBufLeft++] = RTPATH_DELIMITER;
|
szPath[cchBufLeft++] = RTPATH_DELIMITER;
|
||||||
szPath[cchBufLeft] = 0;
|
szPath[cchBufLeft] = 0;
|
||||||
|
@ -154,7 +154,7 @@ index be2ad8f..7ddf105 100644
|
||||||
|
|
||||||
+RTDECL(int) RTPathSuidDir(char *pszPath, size_t cchPath)
|
+RTDECL(int) RTPathSuidDir(char *pszPath, size_t cchPath)
|
||||||
+{
|
+{
|
||||||
+ return RTStrCopy(pszPath, cchPath, "/var/setuid-wrappers");
|
+ return RTStrCopy(pszPath, cchPath, "/var/permissions-wrappers");
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
|
@ -174,7 +174,7 @@ index 7bde6af..2656cae 100644
|
||||||
+ * will cut off everything after the rightmost / as this function is analogous
|
+ * will cut off everything after the rightmost / as this function is analogous
|
||||||
+ * to RTProcGetExecutablePath().
|
+ * to RTProcGetExecutablePath().
|
||||||
+ */
|
+ */
|
||||||
+#define SUIDDIR "/var/setuid-wrappers/"
|
+#define SUIDDIR "/var/permissions-wrappers/"
|
||||||
+
|
+
|
||||||
+RTR3DECL(char *) RTProcGetSuidPath(char *pszExecPath, size_t cbExecPath)
|
+RTR3DECL(char *) RTProcGetSuidPath(char *pszExecPath, size_t cbExecPath)
|
||||||
+{
|
+{
|
||||||
|
|
|
@ -51,7 +51,7 @@ let
|
||||||
export PS1='${name}-chrootenv:\u@\h:\w\$ '
|
export PS1='${name}-chrootenv:\u@\h:\w\$ '
|
||||||
export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
|
export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
|
||||||
export LD_LIBRARY_PATH='/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32'
|
export LD_LIBRARY_PATH='/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32'
|
||||||
export PATH='/var/setuid-wrappers:/usr/bin:/usr/sbin'
|
export PATH='/var/permissions-wrappers:/usr/bin:/usr/sbin'
|
||||||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
||||||
|
|
||||||
# Force compilers to look in default search paths
|
# Force compilers to look in default search paths
|
||||||
|
|
|
@ -57,8 +57,8 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# Fix some binary paths
|
# Fix some binary paths
|
||||||
sed -i -e 's|/usr/bin/xauth|${xauth}/bin/xauth|g' libgksu/gksu-run-helper.c libgksu/libgksu.c
|
sed -i -e 's|/usr/bin/xauth|${xauth}/bin/xauth|g' libgksu/gksu-run-helper.c libgksu/libgksu.c
|
||||||
sed -i -e 's|/usr/bin/sudo|/var/setuid-wrappers/sudo|g' libgksu/libgksu.c
|
sed -i -e 's|/usr/bin/sudo|/var/permissions-wrappers/sudo|g' libgksu/libgksu.c
|
||||||
sed -i -e 's|/bin/su\([^d]\)|/var/setuid-wrappers/su\1|g' libgksu/libgksu.c
|
sed -i -e 's|/bin/su\([^d]\)|/var/permissions-wrappers/su\1|g' libgksu/libgksu.c
|
||||||
|
|
||||||
touch NEWS README
|
touch NEWS README
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
let
|
let
|
||||||
|
|
||||||
system = "/var/run/current-system/sw";
|
system = "/var/run/current-system/sw";
|
||||||
setuid = "/var/setuid-wrappers"; #TODO: from <nixos> config.security.wrapperDir;
|
setuid = "/var/permissions-wrappers"; #TODO: from <nixos> config.security.wrapperDir;
|
||||||
|
|
||||||
foolVars = {
|
foolVars = {
|
||||||
SYSCONF = "/etc";
|
SYSCONF = "/etc";
|
||||||
|
|
|
@ -94,7 +94,7 @@ in stdenv.mkDerivation rec {
|
||||||
unitydir="$out/opt/Unity/Editor"
|
unitydir="$out/opt/Unity/Editor"
|
||||||
mkdir -p $unitydir
|
mkdir -p $unitydir
|
||||||
mv Editor/* $unitydir
|
mv Editor/* $unitydir
|
||||||
ln -sf /var/setuid-wrappers/${chromium.sandboxExecutableName} $unitydir/chrome-sandbox
|
ln -sf /var/permissions-wrappers/${chromium.sandboxExecutableName} $unitydir/chrome-sandbox
|
||||||
|
|
||||||
mkdir -p $out/share/applications
|
mkdir -p $out/share/applications
|
||||||
sed "/^Exec=/c\Exec=$out/bin/unity-editor" \
|
sed "/^Exec=/c\Exec=$out/bin/unity-editor" \
|
||||||
|
|
|
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
||||||
# Ensure that FUSE calls the setuid wrapper, not
|
# Ensure that FUSE calls the setuid wrapper, not
|
||||||
# $out/bin/fusermount. It falls back to calling fusermount in
|
# $out/bin/fusermount. It falls back to calling fusermount in
|
||||||
# $PATH, so it should also work on non-NixOS systems.
|
# $PATH, so it should also work on non-NixOS systems.
|
||||||
export NIX_CFLAGS_COMPILE="-DFUSERMOUNT_DIR=\"/var/setuid-wrappers\""
|
export NIX_CFLAGS_COMPILE="-DFUSERMOUNT_DIR=\"/var/permissions-wrappers\""
|
||||||
|
|
||||||
sed -e 's@/bin/@${utillinux}/bin/@g' -i lib/mount_util.c
|
sed -e 's@/bin/@${utillinux}/bin/@g' -i lib/mount_util.c
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
sed -e 's@/lib/udev@''${out}/lib/udev@' \
|
sed -e 's@/lib/udev@''${out}/lib/udev@' \
|
||||||
-e 's@ -Werror @ @' \
|
-e 's@ -Werror @ @' \
|
||||||
-e 's@/usr/sbin/sendmail@/var/setuid-wrappers/sendmail@' -i Makefile
|
-e 's@/usr/sbin/sendmail@/var/permissions-wrappers/sendmail@' -i Makefile
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mv -v $out/sbin/unix_chkpwd{,.orig}
|
mv -v $out/sbin/unix_chkpwd{,.orig}
|
||||||
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
|
ln -sv /var/permissions-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
|
||||||
''; /*
|
''; /*
|
||||||
rm -rf $out/etc
|
rm -rf $out/etc
|
||||||
mkdir -p $modules/lib
|
mkdir -p $modules/lib
|
||||||
|
|
|
@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
|
||||||
--enable-last
|
--enable-last
|
||||||
--enable-mesg
|
--enable-mesg
|
||||||
--disable-use-tty-group
|
--disable-use-tty-group
|
||||||
--enable-fs-paths-default=/var/setuid-wrappers:/var/run/current-system/sw/bin:/sbin
|
--enable-fs-paths-default=/var/permissions-wrappers:/var/run/current-system/sw/bin:/sbin
|
||||||
${if ncurses == null then "--without-ncurses" else ""}
|
${if ncurses == null then "--without-ncurses" else ""}
|
||||||
${if systemd == null then "" else ''
|
${if systemd == null then "" else ''
|
||||||
--with-systemd
|
--with-systemd
|
||||||
|
|
|
@ -30,7 +30,7 @@ buildGoPackage rec {
|
||||||
-e 's|/bin/chown|${coreutils}/bin/chown|' \
|
-e 's|/bin/chown|${coreutils}/bin/chown|' \
|
||||||
-e 's|/bin/date|${coreutils}/bin/date|' \
|
-e 's|/bin/date|${coreutils}/bin/date|' \
|
||||||
-e 's|/sbin/poweroff|${systemd}/sbin/poweroff|' \
|
-e 's|/sbin/poweroff|${systemd}/sbin/poweroff|' \
|
||||||
-e 's|/usr/bin/sudo|/var/setuid-wrappers/sudo|' \
|
-e 's|/usr/bin/sudo|/var/permissions-wrappers/sudo|' \
|
||||||
-e 's|/sbin/cryptsetup|${cryptsetup}/bin/cryptsetup|'
|
-e 's|/sbin/cryptsetup|${cryptsetup}/bin/cryptsetup|'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, flex, bison, sendmailPath ? "/var/setuid-wrappers/sendmail" }:
|
{ stdenv, fetchurl, flex, bison, sendmailPath ? "/var/permissions-wrappers/sendmail" }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "petidomo-4.3";
|
name = "petidomo-4.3";
|
||||||
|
|
|
@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
|
||||||
# configured on the build machine).
|
# configured on the build machine).
|
||||||
preConfigure= "
|
preConfigure= "
|
||||||
configureFlagsArray=(
|
configureFlagsArray=(
|
||||||
--with-ping-command='/var/setuid-wrappers/ping -n -U -w %d -c %d %s'
|
--with-ping-command='/var/permissions-wrappers/ping -n -U -w %d -c %d %s'
|
||||||
--with-ping6-command='/var/setuid-wrappers/ping6 -n -U -w %d -c %d %s'
|
--with-ping6-command='/var/permissions-wrappers/ping6 -n -U -w %d -c %d %s'
|
||||||
)
|
)
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@ stdenv.mkDerivation rec {
|
||||||
configureFlags="--mandir=$out/share/man"
|
configureFlags="--mandir=$out/share/man"
|
||||||
|
|
||||||
substituteInPlace x11vnc/unixpw.c \
|
substituteInPlace x11vnc/unixpw.c \
|
||||||
--replace '"/bin/su"' '"/var/setuid-wrappers/su"' \
|
--replace '"/bin/su"' '"/var/permissions-wrappers/su"' \
|
||||||
--replace '"/bin/true"' '"${coreutils}/bin/true"'
|
--replace '"/bin/true"' '"${coreutils}/bin/true"'
|
||||||
|
|
||||||
sed -i -e '/#!\/bin\/sh/a"PATH=${xorg.xdpyinfo}\/bin:${xorg.xauth}\/bin:$PATH\\n"' -e 's|/bin/su|/var/setuid-wrappers/su|g' x11vnc/ssltools.h
|
sed -i -e '/#!\/bin\/sh/a"PATH=${xorg.xdpyinfo}\/bin:${xorg.xauth}\/bin:$PATH\\n"' -e 's|/bin/su|/var/permissions-wrappers/su|g' x11vnc/ssltools.h
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
@ -29,7 +29,7 @@ pythonPackages.buildPythonApplication rec {
|
||||||
buildInputs = [ dialog ] ++ (with pythonPackages; [ nose mock gnureadline ]);
|
buildInputs = [ dialog ] ++ (with pythonPackages; [ nose mock gnureadline ]);
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
substituteInPlace certbot/notify.py --replace "/usr/sbin/sendmail" "/var/setuid-wrappers/sendmail"
|
substituteInPlace certbot/notify.py --replace "/usr/sbin/sendmail" "/var/permissions-wrappers/sendmail"
|
||||||
substituteInPlace certbot/le_util.py --replace "sw_vers" "/usr/bin/sw_vers"
|
substituteInPlace certbot/le_util.py --replace "sw_vers" "/usr/bin/sw_vers"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
, FileDesktopEntry, libxslt, docbook_xsl, makeWrapper
|
, FileDesktopEntry, libxslt, docbook_xsl, makeWrapper
|
||||||
, python3Packages
|
, python3Packages
|
||||||
, perlPackages, curl, gnupg, diffutils
|
, perlPackages, curl, gnupg, diffutils
|
||||||
, sendmailPath ? "/var/setuid-wrappers/sendmail"
|
, sendmailPath ? "/var/permissions-wrappers/sendmail"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
|
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: replace wrapperDir below with from <nixos> config.security.wrapperDir;
|
# TODO: replace wrapperDir below with from <nixos> config.security.wrapperDir;
|
||||||
wrapperDir = "/var/setuid-wrappers";
|
wrapperDir = "/var/permissions-wrappers";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
FILES="$(grep -r '/bin/sh' src/utils -l; find src -name \*.c)"
|
FILES="$(grep -r '/bin/sh' src/utils -l; find src -name \*.c)"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchurl, coreutils, pam, groff
|
{ stdenv, fetchurl, coreutils, pam, groff
|
||||||
, sendmailPath ? "/var/setuid-wrappers/sendmail"
|
, sendmailPath ? "/var/permissions-wrappers/sendmail"
|
||||||
, withInsults ? false
|
, withInsults ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ fetchurl, stdenv, bison, flex, pam, sendmailPath ? "/var/setuid-wrappers/sendmail" }:
|
{ fetchurl, stdenv, bison, flex, pam, sendmailPath ? "/var/permissions-wrappers/sendmail" }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "at-3.1.16";
|
name = "at-3.1.16";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{stdenv, fetchurl,
|
{stdenv, fetchurl,
|
||||||
sendmailPath ? "/var/setuid-wrappers/sendmail" }:
|
sendmailPath ? "/var/permissions-wrappers/sendmail" }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue