forked from mirrors/nixpkgs
Add a patch to dmtcp to allow the restart of checkpointed programs with a different uid.
(This is required in order to generate hol_light_binaries). Also do a bit of cleanup. svn path=/nixpkgs/trunk/; revision=23684
This commit is contained in:
parent
f802a70d87
commit
a280a31f56
|
@ -1,25 +1,21 @@
|
||||||
{stdenv, fetchurl, perl, python}:
|
{stdenv, fetchurl, perl, python}:
|
||||||
|
# Perl and Python required by the test suite.
|
||||||
|
|
||||||
# Perl and python are needed in order to run the test suite.
|
stdenv.mkDerivation rec {
|
||||||
|
name = "dmtcp-${version}";
|
||||||
|
|
||||||
let
|
|
||||||
pname = "dmtcp";
|
|
||||||
version = "1.1.8";
|
version = "1.1.8";
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "${pname}-${version}";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "mirror://sourceforge/${pname}/${pname}_${version}.tar.gz";
|
|
||||||
sha256 = "05klyml5maw3f5rxl3i20fqyvpmx69bh09h7a48y19q3r4nqd8f2";
|
|
||||||
};
|
|
||||||
|
|
||||||
buildInputs = [ perl python ];
|
buildInputs = [ perl python ];
|
||||||
|
|
||||||
doCheck = true;
|
src = fetchurl {
|
||||||
|
url = "mirror://sourceforge/dmtcp/dmtcp_${version}.tar.gz";
|
||||||
|
sha256 = "05klyml5maw3f5rxl3i20fqyvpmx69bh09h7a48y19q3r4nqd8f2";
|
||||||
|
};
|
||||||
|
|
||||||
preCheck = ''
|
patches = [ ./dont_check_uid.patch ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
substituteInPlace dmtcp/src/dmtcp_coordinator.cpp \
|
substituteInPlace dmtcp/src/dmtcp_coordinator.cpp \
|
||||||
--replace /bin/bash /bin/sh
|
--replace /bin/bash /bin/sh
|
||||||
substituteInPlace utils/gdb-add-symbol-file \
|
substituteInPlace utils/gdb-add-symbol-file \
|
||||||
|
@ -31,6 +27,8 @@ stdenv.mkDerivation {
|
||||||
--replace /usr/bin/python $(type -p python)
|
--replace /usr/bin/python $(type -p python)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
doCheck = true;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Distributed MultiThreaded Checkpointing";
|
description = "Distributed MultiThreaded Checkpointing";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
|
|
35
pkgs/os-specific/linux/dmtcp/dont_check_uid.patch
Normal file
35
pkgs/os-specific/linux/dmtcp/dont_check_uid.patch
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
diff -Nuar dmtcp_1.1.8/dmtcp/src/dmtcp_restart.cpp dmtcp_1.1.8.dont_check_uid/dmtcp/src/dmtcp_restart.cpp
|
||||||
|
--- dmtcp_1.1.8/dmtcp/src/dmtcp_restart.cpp 2010-07-01 06:42:54.000000000 +0200
|
||||||
|
+++ dmtcp_1.1.8.dont_check_uid/dmtcp/src/dmtcp_restart.cpp 2010-09-06 23:50:51.000000000 +0200
|
||||||
|
@@ -662,14 +662,6 @@
|
||||||
|
sprintf(error_msg, "\ndmtcp_restart: ckpt image %s", restorename);
|
||||||
|
perror(error_msg);
|
||||||
|
doAbort = true;
|
||||||
|
- } else if (buf.st_uid != getuid()) { /*Could also run if geteuid() matches*/
|
||||||
|
- printf("\nProcess uid (%d) doesn't match uid (%d) of\n" \
|
||||||
|
- "checkpoint image (%s).\n" \
|
||||||
|
- "This is dangerous. Aborting for security reasons.\n" \
|
||||||
|
- "If you still want to do this (at your own risk),\n" \
|
||||||
|
- " then modify dmtcp/src/%s:%d and re-compile.\n",
|
||||||
|
- getuid(), buf.st_uid, restorename, __FILE__, __LINE__ - 6);
|
||||||
|
- doAbort = true;
|
||||||
|
}
|
||||||
|
if (doAbort)
|
||||||
|
abort();
|
||||||
|
diff -Nuar dmtcp_1.1.8/mtcp/mtcp_restart.c dmtcp_1.1.8.dont_check_uid/mtcp/mtcp_restart.c
|
||||||
|
--- dmtcp_1.1.8/mtcp/mtcp_restart.c 2010-07-01 06:42:53.000000000 +0200
|
||||||
|
+++ dmtcp_1.1.8.dont_check_uid/mtcp/mtcp_restart.c 2010-09-07 01:49:20.000000000 +0200
|
||||||
|
@@ -157,13 +157,6 @@
|
||||||
|
sprintf(error_msg, "\nmtcp_restart: ckpt image %s", restorename);
|
||||||
|
perror(error_msg);
|
||||||
|
abort();
|
||||||
|
- } else if (buf.st_uid != getuid()) { /*Could also run if geteuid() matches*/
|
||||||
|
- mtcp_printf("\nProcess uid (%d) doesn't match uid (%d) of\n" \
|
||||||
|
- "checkpoint image (%s).\n" \
|
||||||
|
- "This is dangerous. Aborting for security reasons.\n" \
|
||||||
|
- "If you still want to do this, modify mtcp/%s:%d and re-compile.\n",
|
||||||
|
- getuid(), buf.st_uid, restorename, __FILE__, __LINE__ - 5);
|
||||||
|
- abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue