summaryrefslogtreecommitdiff
path: root/sys-cluster/torque/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /sys-cluster/torque/files
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'sys-cluster/torque/files')
-rw-r--r--sys-cluster/torque/files/CVE-2013-4495.4.1.patch343
-rw-r--r--sys-cluster/torque/files/torque-4.1.5.1-tcl8.6.patch93
-rw-r--r--sys-cluster/torque/files/torque-4.2-dont-mess-with-cflags.patch27
-rw-r--r--sys-cluster/torque/files/torque-4.2-use-NULL-instead-of-char0.patch140
-rw-r--r--sys-cluster/torque/files/torque-4.2.9-tcl8.6.patch99
-rw-r--r--sys-cluster/torque/files/torque-6.0.4-pthreads-deux.patch13
6 files changed, 13 insertions, 702 deletions
diff --git a/sys-cluster/torque/files/CVE-2013-4495.4.1.patch b/sys-cluster/torque/files/CVE-2013-4495.4.1.patch
deleted file mode 100644
index 810a4f0944a5..000000000000
--- a/sys-cluster/torque/files/CVE-2013-4495.4.1.patch
+++ /dev/null
@@ -1,343 +0,0 @@
-From 2aad72c3d2ac612ecbb66828ac6ed5ab51eff5f3 Mon Sep 17 00:00:00 2001
-From: David Beer <dbeer@adaptivecomputing.com>
-Date: Mon, 11 Nov 2013 11:55:58 -0700
-Subject: [PATCH] Fix CVE 2013-4495. Note: this patch has been verified as
- fixing this security hole but has not received other regression testing.
- Could not cherry-pick as 2.5 and 4.1 are very different.
-
----
- src/server/svr_mail.c | 265 ++++++++++++++++++++++++++++++++------------------
- 1 file changed, 170 insertions(+), 95 deletions(-)
-
-diff --git a/src/server/svr_mail.c b/src/server/svr_mail.c
-index b269e82..52f2f1f 100644
---- a/src/server/svr_mail.c
-+++ b/src/server/svr_mail.c
-@@ -89,6 +89,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
- #include "list_link.h"
- #include "attribute.h"
- #include "server_limits.h"
-@@ -136,6 +137,77 @@ void free_mail_info(
-
-
-
-+void add_body_info(
-+
-+ char *bodyfmtbuf /* I */,
-+ mail_info *mi /* I */)
-+
-+ {
-+ char *bodyfmt = NULL;
-+ bodyfmt = strcpy(bodyfmtbuf, "PBS Job Id: %i\n"
-+ "Job Name: %j\n");
-+ if (mi->exec_host != NULL)
-+ {
-+ strcat(bodyfmt, "Exec host: %h\n");
-+ }
-+
-+ strcat(bodyfmt, "%m\n");
-+
-+ if (mi->text != NULL)
-+ {
-+ strcat(bodyfmt, "%d\n");
-+ }
-+ }
-+
-+
-+/*
-+ * write_email()
-+ *
-+ * In emailing, the mail body is written to a pipe connected to
-+ * standard input for sendmail. This function supplies the body
-+ * of the message.
-+ *
-+ */
-+void write_email(
-+
-+ FILE *outmail_input,
-+ mail_info *mi)
-+
-+ {
-+ char *bodyfmt = NULL;
-+ char *subjectfmt = NULL;
-+
-+ /* Pipe in mail headers: To: and Subject: */
-+ fprintf(outmail_input, "To: %s\n", mi->mailto);
-+
-+ /* mail subject line formating statement */
-+ get_svr_attr_str(SRV_ATR_MailSubjectFmt, (char **)&subjectfmt);
-+ if (subjectfmt == NULL)
-+ {
-+ subjectfmt = "PBS JOB %i";
-+ }
-+
-+ fprintf(outmail_input, "Subject: ");
-+ svr_format_job(outmail_input, mi, subjectfmt);
-+ fprintf(outmail_input, "\n");
-+
-+ /* Set "Precedence: bulk" to avoid vacation messages, etc */
-+ fprintf(outmail_input, "Precedence: bulk\n\n");
-+
-+ /* mail body formating statement */
-+ get_svr_attr_str(SRV_ATR_MailBodyFmt, &bodyfmt);
-+ if (bodyfmt == NULL)
-+ {
-+ char bodyfmtbuf[MAXLINE];
-+ add_body_info(bodyfmtbuf, mi);
-+ bodyfmt = bodyfmtbuf;
-+ }
-+
-+ /* Now pipe in the email body */
-+ svr_format_job(outmail_input, mi, bodyfmt);
-+
-+ } /* write_email() */
-+
-
-
- void *send_the_mail(
-@@ -143,15 +215,19 @@ void *send_the_mail(
- void *vp)
-
- {
-- mail_info *mi = (mail_info *)vp;
--
-- int i;
-- char *mailfrom = NULL;
-- char *subjectfmt = NULL;
-- char *bodyfmt = NULL;
-- char *cmdbuf = NULL;
-- char bodyfmtbuf[MAXLINE];
-- FILE *outmail;
-+ mail_info *mi = (mail_info *)vp;
-+
-+ int status = 0;
-+ int numargs = 0;
-+ int pipes[2];
-+ int counter;
-+ pid_t pid;
-+ char *mailptr;
-+ char *mailfrom = NULL;
-+ char tmpBuf[LOG_BUF_SIZE];
-+ // We call sendmail with cmd_name + 2 arguments + # of mailto addresses + 1 for null
-+ char *sendmail_args[100];
-+ FILE *stream;
-
- /* Who is mail from, if SRV_ATR_mailfrom not set use default */
- get_svr_attr_str(SRV_ATR_mailfrom, &mailfrom);
-@@ -173,124 +249,123 @@ void *send_the_mail(
- mailfrom = PBS_DEFAULT_MAIL;
- }
-
-- /* mail subject line formating statement */
-- get_svr_attr_str(SRV_ATR_MailSubjectFmt, &subjectfmt);
-- if (subjectfmt == NULL)
-- {
-- subjectfmt = "PBS JOB %i";
-- }
-+ sendmail_args[numargs++] = (char *)SENDMAIL_CMD;
-+ sendmail_args[numargs++] = (char *)"-f";
-+ sendmail_args[numargs++] = (char *)mailfrom;
-
-- /* mail body formating statement */
-- get_svr_attr_str(SRV_ATR_MailBodyFmt, &bodyfmt);
-- if (bodyfmt == NULL)
-+ /* Add the e-mail addresses to the command line */
-+ mailptr = strdup(mi->mailto);
-+ sendmail_args[numargs++] = mailptr;
-+ for (counter=0; counter < (int)strlen(mailptr); counter++)
- {
-- bodyfmt = strcpy(bodyfmtbuf, "PBS Job Id: %i\n"
-- "Job Name: %j\n");
-- if (mi->exec_host != NULL)
-+ if (mailptr[counter] == ',')
- {
-- strcat(bodyfmt, "Exec host: %h\n");
-- }
--
-- strcat(bodyfmt, "%m\n");
--
-- if (mi->text != NULL)
-- {
-- strcat(bodyfmt, "%d\n");
-+ mailptr[counter] = '\0';
-+ sendmail_args[numargs++] = mailptr + counter + 1;
-+ if (numargs >= 99)
-+ break;
- }
- }
-
-- /* setup sendmail command line with -f from_whom */
-- i = strlen(SENDMAIL_CMD) + strlen(mailfrom) + strlen(mi->mailto) + 6;
--
-- if ((cmdbuf = calloc(1, i + 1)) == NULL)
-+ sendmail_args[numargs] = NULL;
-+
-+ /* Create a pipe to talk to the sendmail process we are about to fork */
-+ if (pipe(pipes) == -1)
- {
-- char tmpBuf[LOG_BUF_SIZE];
--
-- snprintf(tmpBuf,sizeof(tmpBuf),
-- "Unable to popen() command '%s' for writing: '%s' (error %d)\n",
-- SENDMAIL_CMD,
-- strerror(errno),
-- errno);
-+ snprintf(tmpBuf, sizeof(tmpBuf), "Unable to pipes for sending e-mail\n");
- log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
- PBS_EVENTCLASS_JOB,
- mi->jobid,
- tmpBuf);
--
-- free_mail_info(mi);
-
-+ free_mail_info(mi);
-+ free(mailptr);
- return(NULL);
- }
-
-- sprintf(cmdbuf, "%s -f %s %s",
-- SENDMAIL_CMD,
-- mailfrom,
-- mi->mailto);
--
-- outmail = popen(cmdbuf, "w");
--
-- if (outmail == NULL)
-+ if ((pid=fork()) == -1)
- {
-- char tmpBuf[LOG_BUF_SIZE];
--
-- snprintf(tmpBuf,sizeof(tmpBuf),
-- "Unable to popen() command '%s' for writing: '%s' (error %d)\n",
-- cmdbuf,
-- strerror(errno),
-- errno);
-+ snprintf(tmpBuf, sizeof(tmpBuf), "Unable to fork for sending e-mail\n");
- log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
- PBS_EVENTCLASS_JOB,
- mi->jobid,
- tmpBuf);
-
- free_mail_info(mi);
-- free(cmdbuf);
--
-+ free(mailptr);
-+ close(pipes[0]);
-+ close(pipes[1]);
- return(NULL);
- }
-+ else if (pid == 0)
-+ {
-+ /* CHILD */
-
-- /* Pipe in mail headers: To: and Subject: */
-- fprintf(outmail, "To: %s\n", mi->mailto);
-+ /* Make stdin the read end of the pipe */
-+ dup2(pipes[0], 0);
-
-- fprintf(outmail, "Subject: ");
-- svr_format_job(outmail, mi, subjectfmt);
-- fprintf(outmail, "\n");
-+ /* Close the rest of the open file descriptors */
-+ int numfds = sysconf(_SC_OPEN_MAX);
-+ while (--numfds > 0)
-+ close(numfds);
-
-- /* Set "Precedence: bulk" to avoid vacation messages, etc */
-- fprintf(outmail, "Precedence: bulk\n\n");
-+ execv(SENDMAIL_CMD, sendmail_args);
-+ /* This never returns, but if the execv fails the child should exit */
-+ exit(1);
-+ }
-+ else
-+ {
-+ /* This is the parent */
-
-- /* Now pipe in the email body */
-- svr_format_job(outmail, mi, bodyfmt);
-+ /* Close the read end of the pipe */
-+ close(pipes[0]);
-
-- errno = 0;
-- if ((i = pclose(outmail)) != 0)
-- {
-- char tmpBuf[LOG_BUF_SIZE];
-+ /* Write the body to the pipe */
-+ stream = fdopen(pipes[1], "w");
-+ write_email(stream, mi);
-
-- snprintf(tmpBuf,sizeof(tmpBuf),
-- "Email '%c' to %s failed: Child process '%s' %s %d (errno %d:%s)\n",
-- mi->mail_point,
-- mi->mailto,
-- cmdbuf,
-- ((WIFEXITED(i)) ? ("returned") : ((WIFSIGNALED(i)) ? ("killed by signal") : ("croaked"))),
-- ((WIFEXITED(i)) ? (WEXITSTATUS(i)) : ((WIFSIGNALED(i)) ? (WTERMSIG(i)) : (i))),
-- errno,
-- strerror(errno));
-- log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
-- PBS_EVENTCLASS_JOB,
-- mi->jobid,
-- tmpBuf);
-- }
-- else if (LOGLEVEL >= 4)
-- {
-- log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
-- PBS_EVENTCLASS_JOB,
-- mi->jobid,
-- "Email sent successfully\n");
-- }
-+ fflush(stream);
-+
-+ /* Close and wait for the command to finish */
-+ if (fclose(stream) != 0)
-+ {
-+ snprintf(tmpBuf,sizeof(tmpBuf),
-+ "Piping mail body to sendmail closed: errno %d:%s\n",
-+ errno, strerror(errno));
-+
-+ log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
-+ PBS_EVENTCLASS_JOB,
-+ mi->jobid,
-+ tmpBuf);
-+ }
-+
-+ // we aren't going to block in order to find out whether or not sendmail worked
-+ if ((waitpid(pid, &status, WNOHANG) != 0) &&
-+ (status != 0))
-+ {
-+ snprintf(tmpBuf,sizeof(tmpBuf),
-+ "Sendmail command returned %d. Mail may not have been sent\n",
-+ status);
-+
-+ log_event(PBSEVENT_ERROR | PBSEVENT_ADMIN | PBSEVENT_JOB,
-+ PBS_EVENTCLASS_JOB,
-+ mi->jobid,
-+ tmpBuf);
-+ }
-
-- free_mail_info(mi);
-- free(cmdbuf);
-+ // don't leave zombies
-+ while (waitpid(-1, &status, WNOHANG) != 0)
-+ {
-+ // zombie reaped, NO-OP
-+ }
-+
-+ free_mail_info(mi);
-+ free(mailptr);
-+ return(NULL);
-+ }
-
-+ /* NOT REACHED */
-+
- return(NULL);
- } /* END send_the_mail() */
-
---
-1.8.3.2
-
diff --git a/sys-cluster/torque/files/torque-4.1.5.1-tcl8.6.patch b/sys-cluster/torque/files/torque-4.1.5.1-tcl8.6.patch
deleted file mode 100644
index 2e8a8ed8f359..000000000000
--- a/sys-cluster/torque/files/torque-4.1.5.1-tcl8.6.patch
+++ /dev/null
@@ -1,93 +0,0 @@
- src/cmds/qstat.c | 18 ++++++++++++++++++
- src/scheduler.tcl/pbs_tclWrap.c | 13 +++++++++++++
- 2 files changed, 31 insertions(+)
-
-diff --git a/src/cmds/qstat.c b/src/cmds/qstat.c
-index 4e1c6b6..07ed448 100644
---- a/src/cmds/qstat.c
-+++ b/src/cmds/qstat.c
-@@ -1795,8 +1795,13 @@ tcl_init(void)
-
- if (Tcl_Init(interp) == TCL_ERROR)
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- fprintf(stderr, "Tcl_Init error: %s",
- interp->result);
-+#else
-+ fprintf(stderr, "Tcl_Init error: %s",
-+ Tcl_GetStringResult(interp));
-+#endif
- }
-
- #if TCLX
-@@ -1808,8 +1813,14 @@ tcl_init(void)
- if (Tclx_Init(interp) == TCL_ERROR)
- {
- #endif
-+
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- fprintf(stderr, "Tclx_Init error: %s",
- interp->result);
-+#else
-+ fprintf(stderr, "Tclx_Init error: %s",
-+ Tcl_GetStringResult(interp));
-+#endif
- }
-
- #endif /* TCLX */
-@@ -1920,10 +1931,17 @@ void tcl_run(
- trace = (char *)Tcl_GetVar(interp, "errorInfo", 0);
-
- if (trace == NULL)
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- trace = interp->result;
-
- fprintf(stderr, "%s: TCL error @ line %d: %s\n",
- script, interp->errorLine, trace);
-+#else
-+ trace = Tcl_GetStringResult(interp);
-+
-+ fprintf(stderr, "%s: TCL error @ line %d: %s\n",
-+ script, Tcl_GetErrorLine(interp), trace);
-+#endif
- }
-
- Tcl_DeleteInterp(interp);
-diff --git a/src/scheduler.tcl/pbs_tclWrap.c b/src/scheduler.tcl/pbs_tclWrap.c
-index a85e8ff..46c1012 100644
---- a/src/scheduler.tcl/pbs_tclWrap.c
-+++ b/src/scheduler.tcl/pbs_tclWrap.c
-@@ -900,8 +900,13 @@ char *argv[];
-
- if (argc != 2)
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- sprintf(interp->result,
- "%s: wrong # args: job_id", argv[0]);
-+#else
-+ sprintf(Tcl_GetStringResult(interp),
-+ "%s: wrong # args: job_id", argv[0]);
-+#endif
- return TCL_ERROR;
- }
-
-@@ -912,11 +917,19 @@ char *argv[];
- return TCL_OK;
- }
-
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- interp->result = "0";
-+#else
-+ Tcl_SetResult(interp, "0", TCL_STATIC);
-+#endif
-
- if (pbs_rerunjob_err(connector, argv[1], extend, &local_errno))
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- interp->result = "-1";
-+#else
-+ Tcl_SetResult(interp, "-1", TCL_STATIC);
-+#endif
- msg = pbs_geterrmsg(connector);
- sprintf(log_buffer, "%s (%d)", msg ? msg : fail, local_errno);
- log_err(-1, argv[0], log_buffer);
diff --git a/sys-cluster/torque/files/torque-4.2-dont-mess-with-cflags.patch b/sys-cluster/torque/files/torque-4.2-dont-mess-with-cflags.patch
deleted file mode 100644
index aec54aff030f..000000000000
--- a/sys-cluster/torque/files/torque-4.2-dont-mess-with-cflags.patch
+++ /dev/null
@@ -1,27 +0,0 @@
---- a/configure.ac 2014-09-10 21:06:26.000000000 -0400
-+++ b/configure.ac 2017-05-23 10:43:59.051759539 -0400
-@@ -703,24 +703,6 @@
- AC_HELP_STRING([--with-debug], [compile with debugging symbols]),
- DEBUG_SYMBOLS=$withval, DEBUG_SYMBOLS="yes")
- AC_MSG_RESULT([DEBUG_SYMBOLS=$DEBUG_SYMBOLS])
--dnl remove -O* and add -g
--if test "$DEBUG_SYMBOLS" = 'yes'; then
-- AC_MSG_RESULT([before tweak CFLAGS=$CFLAGS])
-- CFLAGS=`echo $CFLAGS | sed 's/ \?-O[[^ ]]*//g'`
-- AC_MSG_RESULT([mid tweak CFLAGS=$CFLAGS])
-- case $CFLAGS in
-- *-g*)
-- ;;
-- *)
-- if test "$CFLAGS" = ''; then
-- CFLAGS="-g"
-- else
-- CFLAGS="-g $CFLAGS"
-- fi
-- ;;
-- esac
-- AC_MSG_RESULT([after tweak CFLAGS=$CFLAGS])
--fi
-
- dnl if using gcc, we can be very strict
- AC_ARG_ENABLE(gcc_warnings, [
diff --git a/sys-cluster/torque/files/torque-4.2-use-NULL-instead-of-char0.patch b/sys-cluster/torque/files/torque-4.2-use-NULL-instead-of-char0.patch
deleted file mode 100644
index a1cb85327d71..000000000000
--- a/sys-cluster/torque/files/torque-4.2-use-NULL-instead-of-char0.patch
+++ /dev/null
@@ -1,140 +0,0 @@
---- a/src/cmds/pbsnodes.c 2015-03-17 16:43:36.000000000 -0400
-+++ b/src/cmds/pbsnodes.c 2019-02-25 12:33:37.824638386 -0500
-@@ -693,7 +693,7 @@
- /* -N n is the same as -N "" -- it clears the note */
-
- if (!strcmp(note, "n"))
-- *note = '\0';
-+ *note = NULL;
-
- if (strlen(note) > MAX_NOTE)
- {
-@@ -821,7 +821,7 @@
- {
- nodeargs = (char **)calloc(2, sizeof(char **));
- nodeargs[0] = strdup("");
-- nodeargs[1] = '\0';
-+ nodeargs[1] = NULL;
- }
- }
- }
-@@ -901,7 +901,7 @@
-
- MXMLCreateE(&DE, "Data");
-
-- for (lindex = 0;nodeargs[lindex] != '\0';lindex++)
-+ for (lindex = 0;nodeargs[lindex] != NULL;lindex++)
- {
- bstatus = statnode(con, nodeargs[lindex]);
-
-@@ -922,7 +922,7 @@
- }
- else
- {
-- for (lindex = 0;nodeargs[lindex] != '\0';lindex++)
-+ for (lindex = 0;nodeargs[lindex] != NULL;lindex++)
- {
- bstatus = statnode(con, nodeargs[lindex]);
-
-@@ -946,7 +946,7 @@
-
- /* list any node that is DOWN, OFFLINE, or UNKNOWN */
-
-- for (lindex = 0;nodeargs[lindex] != '\0';lindex++)
-+ for (lindex = 0;nodeargs[lindex] != NULL;lindex++)
- {
- bstatus = statnode(con, nodeargs[lindex]);
-
---- a/src/cmds/qsub_functions.c 2015-03-17 16:43:36.000000000 -0400
-+++ b/src/cmds/qsub_functions.c 2019-02-25 12:32:00.442982091 -0500
-@@ -542,7 +542,7 @@
- static char tmpLine[65536];
-
- /* we've reached the end */
-- if ((start == NULL) && (*tok_ptr == '\0'))
-+ if ((start == NULL) && (*tok_ptr == NULL))
- return(0);
-
- if (start != NULL)
-@@ -554,7 +554,7 @@
- return(0);
-
- if ((*curr_ptr == '=') ||
-- (*curr_ptr == '\0'))
-+ (*curr_ptr == NULL))
- {
- /* no name, fail */
- return(-1);
-@@ -574,18 +574,18 @@
-
- /* strip blanks */
- while ((*equals) && (isspace((int)*equals)))
-- *equals++ = '\0';
-+ *equals++ = NULL;
-
- if (*equals != '=')
- return (-1); /* should have found a = as first non blank */
-
-- *equals++ = '\0';
-+ *equals++ = NULL;
-
- /* skip leading white space */
- while (isspace((int)*equals) && *equals)
- equals++;
-
-- if (*equals == '\0')
-+ if (*equals == NULL)
- return(-1);
-
- *value = equals;
-@@ -872,7 +872,7 @@
- else
- {
- char *tmp_host = pbs_default();
-- if (tmp_host == '\0')
-+ if (tmp_host == NULL)
- hash_add_or_exit(mm, job_attr, ATTR_pbs_o_server, qsub_host, LOGIC_DATA);
- else
- hash_add_or_exit(mm, job_attr, ATTR_pbs_o_server, tmp_host, LOGIC_DATA);
---- a/src/include/attribute.h 2015-03-17 16:43:36.000000000 -0400
-+++ b/src/include/attribute.h 2019-02-22 16:47:40.507695453 -0500
-@@ -445,7 +445,7 @@
- extern int parse_equal_string(char *, char **, char **);
- extern char *parse_comma_string(char *,char **);
-
--#define NULL_FUNC '\0'
-+#define NULL_FUNC NULL
-
- /* other associated funtions */
- struct dynamic_string;
---- a/src/resmom/mom_main.c 2015-03-17 16:43:36.000000000 -0400
-+++ b/src/resmom/mom_main.c 2019-02-22 14:01:26.573890840 -0500
-@@ -4224,7 +4224,7 @@
- goto done;
- }
-
-- name[i] = '\0';
-+ name[i] = NULL;
-
- for (d = ret_string, resline++;*resline;)
- {
---- a/src/server/job_attr_def.c 2015-03-17 16:43:36.000000000 -0400
-+++ b/src/server/job_attr_def.c 2019-02-22 16:43:05.653007840 -0500
-@@ -1193,7 +1193,7 @@
- },
-
- /* JOB_ATR_system_start_time */
-- {ATTR_system_start_time, /* start time as encoded in the proc/pid directory */
-+ { (char *)ATTR_system_start_time, /* start time as encoded in the proc/pid directory */
- decode_l,
- encode_l,
- set_l,
-@@ -1205,7 +1205,7 @@
- PARENT_TYPE_JOB},
-
- /* JOB_ATR_nppcu */
-- {ATTR_nppcu, /* how to handle compute units (on Cray system) */
-+ { (char *)ATTR_nppcu, /* how to handle compute units (on Cray system) */
- decode_l,
- encode_l,
- set_l,
diff --git a/sys-cluster/torque/files/torque-4.2.9-tcl8.6.patch b/sys-cluster/torque/files/torque-4.2.9-tcl8.6.patch
deleted file mode 100644
index 3a2a28ce4a2b..000000000000
--- a/sys-cluster/torque/files/torque-4.2.9-tcl8.6.patch
+++ /dev/null
@@ -1,99 +0,0 @@
- src/cmds/qstat.c | 20 +++++++++++++++++++-
- src/scheduler.tcl/pbs_tclWrap.c | 13 +++++++++++++
- 2 files changed, 32 insertions(+), 1 deletion(-)
-
-diff --git a/src/cmds/qstat.c b/src/cmds/qstat.c
-index f275cf8..23414b8 100644
---- a/src/cmds/qstat.c
-+++ b/src/cmds/qstat.c
-@@ -2203,8 +2203,13 @@ tcl_init(void)
-
- if (Tcl_Init(interp) == TCL_ERROR)
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- fprintf(stderr, "Tcl_Init error: %s",
- interp->result);
-+#else
-+ fprintf(stderr, "Tcl_Init error: %s",
-+ Tcl_GetStringResult(interp));
-+#endif
- }
-
- #if TCLX
-@@ -2216,8 +2221,14 @@ tcl_init(void)
- if (Tclx_Init(interp) == TCL_ERROR)
- {
- #endif
-+
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- fprintf(stderr, "Tclx_Init error: %s",
- interp->result);
-+#else
-+ fprintf(stderr, "Tclx_Init error: %s",
-+ Tcl_GetStringResult(interp));
-+#endif
- }
-
- #endif /* TCLX */
-@@ -2328,15 +2339,22 @@ void tcl_run(
-
- if (f_opt && Tcl_EvalFile(interp, script) != TCL_OK)
- {
-- char *trace;
-+ const char *trace;
-
- trace = (char *)Tcl_GetVar(interp, "errorInfo", 0);
-
- if (trace == NULL)
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- trace = interp->result;
-
- fprintf(stderr, "%s: TCL error @ line %d: %s\n",
- script, interp->errorLine, trace);
-+#else
-+ trace = Tcl_GetStringResult(interp);
-+
-+ fprintf(stderr, "%s: TCL error @ line %d: %s\n",
-+ script, Tcl_GetErrorLine(interp), trace);
-+#endif
- }
-
- Tcl_DeleteInterp(interp);
-diff --git a/src/scheduler.tcl/pbs_tclWrap.c b/src/scheduler.tcl/pbs_tclWrap.c
-index 3eea0b0..7d0d610 100644
---- a/src/scheduler.tcl/pbs_tclWrap.c
-+++ b/src/scheduler.tcl/pbs_tclWrap.c
-@@ -935,8 +935,13 @@ int PBS_ReRun(
-
- if (argc != 2)
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- sprintf(interp->result,
- "%s: wrong # args: job_id", argv[0]);
-+#else
-+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
-+ "%s: wrong # args: job_id", argv[0]));
-+#endif
- return TCL_ERROR;
- }
-
-@@ -947,11 +952,19 @@ int PBS_ReRun(
- return TCL_OK;
- }
-
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- interp->result = strdup("0");
-+#else
-+ Tcl_SetResult(interp, "0", TCL_STATIC);
-+#endif
-
- if (pbs_rerunjob_err(connector, strdup(argv[1]), extend, &local_errno))
- {
-+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
- interp->result = strdup("-1");
-+#else
-+ Tcl_SetResult(interp, "-1", TCL_STATIC);
-+#endif
- msg = pbs_geterrmsg(connector);
- sprintf(log_buffer, "%s (%d)", msg ? msg : fail, local_errno);
- log_err(-1, argv[0], log_buffer);
diff --git a/sys-cluster/torque/files/torque-6.0.4-pthreads-deux.patch b/sys-cluster/torque/files/torque-6.0.4-pthreads-deux.patch
new file mode 100644
index 000000000000..f9b7046daeac
--- /dev/null
+++ b/sys-cluster/torque/files/torque-6.0.4-pthreads-deux.patch
@@ -0,0 +1,13 @@
+Additional pthread/glibc 2.34 patch.
+
+https://bugs.gentoo.org/827474
+--- a/src/lib/Libpbs/Makefile.am
++++ b/src/lib/Libpbs/Makefile.am
+@@ -7,6 +7,7 @@ CLEANFILES = *.gcda *.gcno *.gcov
+ lib_LTLIBRARIES = libtorque.la
+
+ libtorque_la_LDFLAGS = -version-info 2:0:0
++libtorque_la_LIBADD = $(PTHREAD_LIBS)
+
+ libtorque_la_SOURCES = ../Libcsv/csv.c ../Libdis/dis.c \
+ ../Libdis/discui_.c ../Libdis/discul_.c \