1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00

slurm: add patch to allow full path lengths in --get-user-env

Fix fallout from https://github.com/NixOS/nixpkgs/pull/90041
and 5d8f61f3bf, which fixes
the crash of slurmd but "sbatch --get-user-env" did not work
properly.
This commit is contained in:
Markus Kowalewski 2020-06-23 13:08:55 +02:00
parent 335c487686
commit b8703b4a92
No known key found for this signature in database
GPG key ID: D865C8A91D7025EB
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,13 @@
diff --git a/src/common/env.c b/src/common/env.c
index 987846d..73d3b3b 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -1941,7 +1941,7 @@ char **env_array_user_default(const char *username, int timeout, int mode,
char **env = NULL;
char *starttoken = "XXXXSLURMSTARTPARSINGHEREXXXX";
char *stoptoken = "XXXXSLURMSTOPPARSINGHEREXXXXX";
- char cmdstr[256], *env_loc = NULL;
+ char cmdstr[MAXPATHLEN], *env_loc = NULL;
char *stepd_path = NULL;
int fd1, fd2, fildes[2], found, fval, len, rc, timeleft;
int buf_read, buf_rem, config_timeout;

View file

@ -22,6 +22,12 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
patches = [
# increase string length to allow for full
# path of 'echo' in nix store
./common-env-echo.patch
];
prePatch = ''
substituteInPlace src/common/env.c \
--replace "/bin/echo" "${coreutils}/bin/echo"