nixpkgs-suyu/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch
Eelco Dolstra 256438659c util-linux: Update to 2.27
This version is required by systemd 227.

CVE-2015-5224
2015-10-07 20:15:00 +02:00

30 lines
1.2 KiB
Diff

Search $PATH for the shutdown binary instead of hard-coding /sbin/shutdown,
which isn't valid on NixOS (and a compatibility link on most other modern
distros anyway).
-- nckx <tobias.geerinckx.rice@gmail.com>
diff -ru util-linux-2.27-orig/include/pathnames.h util-linux-2.27/include/pathnames.h
--- util-linux-2.27-orig/include/pathnames.h 2015-06-29 13:13:14.669847478 +0200
+++ util-linux-2.27/include/pathnames.h 2015-10-07 20:09:17.401022602 +0200
@@ -54,7 +54,7 @@
#define _PATH_INITTAB "/etc/inittab"
#define _PATH_RC "/etc/rc"
#define _PATH_REBOOT "/sbin/reboot"
-#define _PATH_SHUTDOWN "/sbin/shutdown"
+#define _PATH_SHUTDOWN "shutdown"
#define _PATH_SINGLE "/etc/singleboot"
#define _PATH_SHUTDOWN_CONF "/etc/shutdown.conf"
diff -ru util-linux-2.27-orig/sys-utils/rtcwake.c util-linux-2.27/sys-utils/rtcwake.c
--- util-linux-2.27-orig/sys-utils/rtcwake.c 2015-08-05 11:32:44.453821232 +0200
+++ util-linux-2.27/sys-utils/rtcwake.c 2015-10-07 20:09:37.834032536 +0200
@@ -576,7 +576,7 @@
arg[i++] = "now";
arg[i] = NULL;
if (!ctl.dryrun) {
- execv(arg[0], arg);
+ execvp(arg[0], arg);
warn(_("failed to execute %s"), _PATH_SHUTDOWN);
rc = EXIT_FAILURE;
}