at: fix permission errors with "batch" on NixOS
Fixes https://github.com/NixOS/nixpkgs/issues/12392
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
{ fetchurl, stdenv, bison, flex, pam, sendmailPath ? "/run/wrappers/bin/sendmail" }:
|
{ fetchurl, stdenv, bison, flex, pam
|
||||||
|
, sendmailPath ? "/run/wrappers/bin/sendmail"
|
||||||
|
, atWrapperPath ? "/run/wrappers/bin/at"
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "at-${version}";
|
name = "at-${version}";
|
||||||
@@ -30,6 +33,13 @@ stdenv.mkDerivation rec {
|
|||||||
--with-daemon_username=atd --with-daemon_groupname=atd
|
--with-daemon_username=atd --with-daemon_groupname=atd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Ensure that "batch" can invoke the setuid "at" wrapper, if it exists, or
|
||||||
|
# else we get permission errors (on NixOS). "batch" is a shell script, so
|
||||||
|
# when the kernel executes it it drops setuid perms.
|
||||||
|
postInstall = ''
|
||||||
|
sed -i "6i test -x ${atWrapperPath} && exec ${atWrapperPath} -qb now # exec doesn't return" "$out/bin/batch"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = ''The classical Unix `at' job scheduling command'';
|
description = ''The classical Unix `at' job scheduling command'';
|
||||||
license = stdenv.lib.licenses.gpl2Plus;
|
license = stdenv.lib.licenses.gpl2Plus;
|
||||||
|
|||||||
Reference in New Issue
Block a user