summaryrefslogtreecommitdiff
path: root/sys-cluster/torque
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
commitbd4aeefe33e63f613512604e47bfca7b2187697d (patch)
treeadb35b5a9a00ee7ea591ab0c987f70167c23b597 /sys-cluster/torque
parent48ece6662cbd443015f5a57ae6d8cbdbd69ef37c (diff)
gentoo resync : 03.11.2019
Diffstat (limited to 'sys-cluster/torque')
-rw-r--r--sys-cluster/torque/Manifest7
-rw-r--r--sys-cluster/torque/files/torque-6.0.3-fix-emptystring-comparison.patch49
-rw-r--r--sys-cluster/torque/files/torque-6.0.4-error_buf_overflow_prevent.patch11
-rw-r--r--sys-cluster/torque/files/torque-6.0.4-gcc7.patch1606
-rw-r--r--sys-cluster/torque/torque-6.0.4-r1.ebuild4
-rw-r--r--sys-cluster/torque/torque-6.0.4.ebuild177
6 files changed, 1674 insertions, 180 deletions
diff --git a/sys-cluster/torque/Manifest b/sys-cluster/torque/Manifest
index eb31a38a5a60..df6e3d3d1779 100644
--- a/sys-cluster/torque/Manifest
+++ b/sys-cluster/torque/Manifest
@@ -8,7 +8,9 @@ AUX torque-4.1.5.1-tcl8.6.patch 2546 BLAKE2B f0c1c2d5df20c53a58a47de3fc0e226d2e9
AUX torque-4.2-dont-mess-with-cflags.patch 806 BLAKE2B d4be6b841f354c5ab9eca24cd2ee330607f83000f1d7086d2cd885427f67537a9c75105b1afa9bdb1a8475bfa408d1aff903cc1d9bd5c7dfbe3d9aaf5f2fddaa SHA512 23aeb87fc75ec8b916817264501240b9f0fae7b3e81662496824dcccc21d1a07b2b58221ea22ca6551b6830e76347416a09da6c22de4aea173a32fe13c90c7ff
AUX torque-4.2-use-NULL-instead-of-char0.patch 3898 BLAKE2B 9d693f6fc8a7dc4d9a3e3517c41ece9cde8f4567cf75439b47bfbf1041cf043b69c7666eb44a477ca6dac79415bd396782ee62535f7f4c32aa3caac4431d2347 SHA512 af6bb3e257f8f4c232c83ed8d0a4a4b8a451acb42bfec36aa1caa3191ab242109f1712bbd639219254e5ab42fa518990343b917ebf9d21406eb23e8b7c9141f3
AUX torque-4.2.9-tcl8.6.patch 2702 BLAKE2B c1444b5f4da1d37e21fe5a8970e188926080805db83406f5caca2cf27dddebf069d9d9747c33e3a1e2b0ec5f36e95d80d1c69151129967d432cd2d11c5e1ecf8 SHA512 9844a1f633f049a66cf31d3721f6a5e205ede26186da1357e0b0aa2c0c4d064cbdff45e2f7e685d6c4afd09d961e59ff1759163e4a2ae349fa866e960c1bcf77
-AUX torque-6.0.3-fix-emptystring-comparison.patch 542 BLAKE2B c5acba0cfb1a4ca40a77710563fe42b928052253c3569d9e130357142a0456601bbf671d61db32f54881498f4bc77b588d0cfef3431a35b30c3e3858a6aed002 SHA512 0303c49ef2a407773b9cd14f15e825d13e9a5c9ae91118ed770d81ccb59bbe01fb3614e6865b1be81e6f9618fba3a09cc4fe447a0e6684f1e142c49e17970189
+AUX torque-6.0.3-fix-emptystring-comparison.patch 2062 BLAKE2B d8186eebb69669ac67141183370f8959945db295956c686107471f9e29bfdcd08fd0a6c659f3bb80a6a152cc2a2319089b4a7c17eb29d873c257a559753efec7 SHA512 d2bc25899337f799652b5f02d7fc5d7e894fb6e2eefa201853a2695a5140c85aff670f8af3f8cf1b77988ea51d5f296d0073287316cfb52dcc208acc42161099
+AUX torque-6.0.4-error_buf_overflow_prevent.patch 736 BLAKE2B ade2f842fd04d323aead973423c29a24237e189f0badf6033632a5245a243c55435a21fbec0434afc5cada34d72581f51a7d1a1b8c89b25aacb22aeb7e1ab98a SHA512 40aea81d470f485cc4330435c90e41ecaef911e73be17a8f0eb3277965c72d67275221f0c2d8ab5fde25448db93087fc02ef09625052dc80320f51d8fcdfed9c
+AUX torque-6.0.4-gcc7.patch 50412 BLAKE2B 43748e9bfd3811abdfeb56f93dd517fcb07a6902194120e2c9e16bbe5bbe0f04afd3f898616d46e0310902a6376671be0c8f3865e8f7dd5381fca46e7ad62fc8 SHA512 430ae6a80ebbfb2066831326f8ce25a34cb6fc17c1fbe4a202c495baceb2b7011c9f6782da31b78c34287f26765c76c587611d689791523b8bd53d634e3681b6
AUX torque-6.0.4-no-openssl.patch 1926 BLAKE2B 387843f6117ebdb1a9ca0f9fe3363dd2b2ab45aced82e3e9c60cb11009fef1dd97afeb9e525a3a5d70885b6cd19cc20333dc9d009453ade63bad8c39fb82d578 SHA512 1370c280860eb31d2a7e09b7bef6d9f2d6d7651ba0c67db7c7c912ec72b78f6ca33f7f5b716afc69a10f8c3efd55d5702f8e894596de78a91a346ec28d83e5dc
AUX torque-conf.d 649 BLAKE2B 819a53a96a35d77b45d3c536278a088845cbbbd4ac1606b7d822ae36909477428c692975edcd69b519e348fa2cfc7d01c013db33daae65b9a0ba169456324443 SHA512 b82f6c1d661bed03a32c3761530c4b303715167a317e467371091b11d3ae0e19e9784b1588577ee5f65397cb0699818ed5f621aeb66d3f2d218df12d0cf39bde
AUX torque-conf.d-munge 784 BLAKE2B fe4fc64377da0ed0232961462bd92fea4fae68760dd698cf2759105f75686c5c77c3cff2c3fac3531c4b4905244cbc9df0fe67fe62a410a63b35008429dd1261 SHA512 a78634a6f2bdf3c24e8c99d3cd7a9634daa32d69244a9ddfcc26199f4d04e901abbfa79ad057f5a4e4c492c9e21bc0c65edd8465ac6935fb7c67c8c639e75d68
@@ -19,6 +21,5 @@ DIST torque-4.2.10-gh-20150517.tar.gz 5836286 BLAKE2B 7108f1adcb6f674526b7db97df
DIST torque-6.0.4-gh-20170829.tar.gz 6182495 BLAKE2B f9156ae4ffe388a7f3fa0df142e5f2d48c16fd7b8c148a3a80cd1c977eb0c1ef4a455da275f993100867be043422526ed05c53734e707851083d6d23ee1a2cc4 SHA512 8f1101adb89e06617de501f7956e126633b78b495baeb7980d3c534d34537cc604a3cf0a7c23c48eb2554b26cc13672b0e00c75d0f722d63ac4d42d57388ed94
EBUILD torque-4.1.7-r1.ebuild 7491 BLAKE2B d4c4a0be3c07eca1ae0a79fbe52ea153c4c013155426aa9cba4d4f2cc70086883c3b5345026450cd5608ae4e26773dabb9a70742cf9e7cf7dc968a7cc8210380 SHA512 e7213e0df29564fa24a48bf8b96e59a69fbd56abf5c470b794eb19fbdefe705ead880d9d908f006c9c79eeab325b0f6ccc3ae64973cb1e50061c2020c64aa816
EBUILD torque-4.2.10-r1.ebuild 6086 BLAKE2B c685ce4e6b5b7f58c040f0b16779bb59540aa0c80fe9a55b76d603e336e63a5186d543d664caa0f6184c3145c9608b31fed379b2e827bdcd62e6e53f8334b5cc SHA512 2c64f7dfaa26e1648e32283c1dcc31df0dba8bf3c4177fdafbe713d408d931ca83c2386d3548b47e1d6d90552e4c5ceeadf96c50089f2d17eb56d79312dc70f8
-EBUILD torque-6.0.4-r1.ebuild 5428 BLAKE2B cc1a8ada29520b3af36457e25f639ed70d9c8d9f724702be6bf8cdad5c125ed8303fec67450c79f233a890340d5ff904982e89b2e2b22003bc69d81b197b915f SHA512 21fabe1c45f965af746e722b54478a183d48f4f3934f65e312bb57b1ada6024044cc966e0d729e05b3c3e83b75092687b2a5bd20acf47376deeb58b38503b0fb
-EBUILD torque-6.0.4.ebuild 5463 BLAKE2B b6202d1c5679637d7d305bef8ec3a5f6d09d6e61eb0dc42093fade8349bd014f30304b6d82f0dcab6267d5d1f5102c3c3246e41e68329e3c9219ccdc9ad5126c SHA512 710971b3b72dc388b7631cba09a46096b45022a803bd1570774cc276d416c6f6426bbb8304d56a30d49de9c940cac6574d1e20e324c42d5aa95813ceda035fdf
+EBUILD torque-6.0.4-r1.ebuild 5543 BLAKE2B ee956490a4cc94d9b6be9000b9886f0a04b5a1324a1447240f25de90abeedb78e237e98f6ff520a34eb6ae145cfc3a4f3e6d7bbac5de6620b10aeafa3fa198c2 SHA512 07a22cabbd04268d1a035aed2aba774a7bacb831879062e9f9f9c5638d13605a1e5716aeaded6ab3abe4417a9391aeed7c92426640045a60cab0d8b0c95e8f47
MISC metadata.xml 988 BLAKE2B 257e838c8bde7ceea876a84631c248fce2e3a347794459bbfd4ae23210c779f69e606e120438351783ebf1cdeab7bd5e5df196ee9af31306bebd6130a08bb46f SHA512 46f2eb41303c17e84aacf5b8548b645772ab923bf9a4847892260cc5c6aaf354acc0bb0128186acf312ed77a24d9429c97f18914d759c7c5c97c19ad62489a43
diff --git a/sys-cluster/torque/files/torque-6.0.3-fix-emptystring-comparison.patch b/sys-cluster/torque/files/torque-6.0.3-fix-emptystring-comparison.patch
index 0666eda15937..6584f0ea8b33 100644
--- a/sys-cluster/torque/files/torque-6.0.3-fix-emptystring-comparison.patch
+++ b/sys-cluster/torque/files/torque-6.0.3-fix-emptystring-comparison.patch
@@ -19,3 +19,52 @@
while ((current != NULL) &&
(*current != '\0'))
{
+--- a/src/cmds/qsub_functions.c 2017-01-24 18:35:27.000000000 -0500
++++ b/src/cmds/qsub_functions.c 2017-11-21 13:40:27.201964749 -0500
+@@ -900,7 +900,7 @@
+ else
+ {
+ char *tmp_host = pbs_default();
+- if (tmp_host == '\0')
++ if (*tmp_host == '\0')
+ hash_add_or_exit(job_attr, ATTR_pbs_o_server, qsub_host, LOGIC_DATA);
+ else
+ hash_add_or_exit(job_attr, ATTR_pbs_o_server, tmp_host, LOGIC_DATA);
+--- a/src/cmds/pbsnodes.c 2017-01-24 18:35:27.000000000 -0500
++++ b/src/cmds/pbsnodes.c 2017-11-21 13:40:27.201964749 -0500
+@@ -900,7 +900,7 @@
+ {
+ nodeargs = (char **)calloc(2, sizeof(char *));
+ nodeargs[0] = strdup("");
+- nodeargs[1] = '\0';
++ nodeargs[1] = NULL;
+ }
+ }
+ }
+@@ -1020,7 +1020,7 @@
+
+ MXMLCreateE(&DE, "Data");
+
+- for (lindex = 0;nodeargs[lindex] != '\0';lindex++)
++ for (lindex = 0;nodeargs[lindex] != NULL;lindex++)
+ {
+ bstatus = statnode(con, nodeargs[lindex]);
+
+@@ -1041,7 +1041,7 @@
+ }
+ else
+ {
+- for (lindex = 0;nodeargs[lindex] != '\0';lindex++)
++ for (lindex = 0;nodeargs[lindex] != NULL;lindex++)
+ {
+ bstatus = statnode(con, nodeargs[lindex]);
+
+@@ -1065,7 +1065,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]);
+
diff --git a/sys-cluster/torque/files/torque-6.0.4-error_buf_overflow_prevent.patch b/sys-cluster/torque/files/torque-6.0.4-error_buf_overflow_prevent.patch
new file mode 100644
index 000000000000..639f4f0662f7
--- /dev/null
+++ b/sys-cluster/torque/files/torque-6.0.4-error_buf_overflow_prevent.patch
@@ -0,0 +1,11 @@
+--- a/src/daemon_client/trq_auth_daemon.c 2017-08-29 18:25:11.000000000 -0400
++++ b/src/daemon_client/trq_auth_daemon.c 2019-10-21 13:58:47.441212099 -0400
+@@ -134,7 +134,7 @@
+ {
+ openlog("daemonize_trqauthd", LOG_PID | LOG_NOWAIT, LOG_DAEMON);
+ syslog(LOG_ALERT, "Failed to create client_logs directory: %s errno: %d error message: %s", path_log, errno, strerror(errno));
+- sprintf(error_buf,"Failed to create client_logs directory: %s, error message: %s",path_log,strerror(errno));
++ snprintf(error_buf,sizeof(error_buf),"Failed to create client_logs directory: %s, error message: %s",path_log,strerror(errno));
+ log_err(errno,__func__,error_buf);
+ closelog();
+ return(PBSE_SYSTEM);
diff --git a/sys-cluster/torque/files/torque-6.0.4-gcc7.patch b/sys-cluster/torque/files/torque-6.0.4-gcc7.patch
new file mode 100644
index 000000000000..340eb9e1bfc0
--- /dev/null
+++ b/sys-cluster/torque/files/torque-6.0.4-gcc7.patch
@@ -0,0 +1,1606 @@
+From 8a0b748d3644dde30372ee25c4fe05bec10b2166 Mon Sep 17 00:00:00 2001
+From: Chad Vizino <cvizino@adaptivecomputing.com>
+Date: Fri, 29 Mar 2019 09:23:08 -0600
+Subject: [PATCH] TRQ-4330 - fix gcc/g++ 7 compile issues
+
+---
+ src/cmds/qdel.c | 6 +-
+ src/cmds/qsub_functions.c | 12 ++--
+ src/cmds/qterm.c | 2 +
+ src/include/array.h | 2 +-
+ src/include/attribute.h | 4 +-
+ src/lib/Libattr/attr_fn_acl.c | 4 +-
+ src/lib/Libattr/attr_fn_arst.c | 4 +-
+ src/lib/Libcmds/cvtdate.c | 8 +--
+ src/lib/Libdis/disrsc.c | 2 +
+ src/lib/Libdis/disrsi.c | 2 +
+ src/lib/Libdis/disrsl.c | 2 +
+ src/lib/Libdis/disrss.c | 2 +
+ src/lib/Libnet/net_client.c | 4 +-
+ src/lib/Libnet/net_common.c | 1 +
+ src/lib/Libutils/jsoncpp.cpp | 9 +++
+ src/lib/Libutils/numa_chip.cpp | 10 +--
+ src/resmom/checkpoint.c | 59 ++++++++++------
+ src/resmom/generate_alps_status.c | 7 +-
+ src/resmom/linux/mom_mach.c | 79 +++++++++++++--------
+ src/resmom/mom_main.c | 16 ++---
+ src/resmom/mom_req_quejob.c | 12 ++--
+ src/resmom/mom_server.c | 41 +++++------
+ src/resmom/parse_config.c | 4 +-
+ src/resmom/requests.c | 8 +--
+ src/scheduler.cc/samples/fifo/dedtime.c | 2 +-
+ src/server/array_func.c | 6 +-
+ src/server/array_func.h | 2 +-
+ src/server/geteusernam.c | 2 +-
+ src/server/job_func.c | 28 ++++++--
+ src/server/node_attr_def.c | 16 ++---
+ src/server/node_manager.c | 5 +-
+ src/server/pbsd_init.c | 2 +
+ src/server/process_request.c | 18 ++---
+ src/server/req_jobobit.c | 16 ++++-
+ src/server/req_quejob.c | 2 +-
+ src/server/req_runjob.c | 10 ++-
+ src/server/req_stat.c | 2 +-
+ src/server/svr_chk_owner.c | 47 +++++++++----
+ src/server/svr_jobfunc.c | 80 +++++++++++++++-------
+ src/test/catch_child/scaffolding.c | 1 +
+ src/test/geteusernam/scaffolding.c | 2 +-
+ src/test/node_manager/test_uut.c | 4 +-
+ src/test/pbs_log/scaffolding.c | 3 +-
+ src/test/pbsd_main/scaffolding.c | 2 +-
+ src/test/process_alps_status/scaffolding.c | 2 +
+ src/test/process_request/scaffolding.c | 6 +-
+ src/test/req_stat/scaffolding.c | 4 +-
+ src/test/svr_chk_owner/scaffolding.c | 2 +-
+ torque.setup.in | 2 +-
+ 49 files changed, 358 insertions(+), 208 deletions(-)
+
+diff --git a/src/cmds/qdel.c b/src/cmds/qdel.c
+index 909018da66..d7e64f6289 100644
+--- a/src/cmds/qdel.c
++++ b/src/cmds/qdel.c
+@@ -49,7 +49,7 @@ void process_config_file(
+
+
+
+-bool is_array(
++bool is_job_array(
+
+ char *job_id)
+
+@@ -66,7 +66,7 @@ bool is_array(
+ }
+
+ return(false);
+- } /* END is_array() */
++ } /* END is_job_array() */
+
+
+
+@@ -289,7 +289,7 @@ int qdel_main(
+ snprintf(job_id, sizeof(job_id), "%s", argv[optind]);
+
+ if ((dash_t == true) &&
+- (is_array(job_id) == false))
++ (is_job_array(job_id) == false))
+ {
+ fprintf(stderr, "qdel: Error: job id '%s' isn't a job array but -t was specified.\n",
+ job_id);
+diff --git a/src/cmds/qsub_functions.c b/src/cmds/qsub_functions.c
+index 4fdfac0a7b..9799c831f4 100644
+--- a/src/cmds/qsub_functions.c
++++ b/src/cmds/qsub_functions.c
+@@ -3363,14 +3363,14 @@ void process_opts(
+ if (add_verify_resources(ji->res_attr, optarg, data_type) != 0)
+ print_qsub_usage_exit("qsub: illegal -l value");
+
+- //If cpuclock gets set we need to set the node exclusive flag
++ //If cpuclock gets set we need to set the node exclusive flag
++ {
++ job_data *pData = NULL;
++ if (hash_find(ji->res_attr,"cpuclock",&pData))
+ {
+- job_data *pData = NULL;
+- if (hash_find(ji->res_attr,"cpuclock",&pData))
+- {
+- hash_add_or_exit(ji->job_attr, ATTR_node_exclusive, "TRUE", data_type);
+- }
++ hash_add_or_exit(ji->job_attr, ATTR_node_exclusive, "TRUE", data_type);
+ }
++ }
+
+ break;
+
+diff --git a/src/cmds/qterm.c b/src/cmds/qterm.c
+index d05bd42d4e..0519328c01 100644
+--- a/src/cmds/qterm.c
++++ b/src/cmds/qterm.c
+@@ -89,6 +89,8 @@ int main(
+
+ local = true;
+
++ break;
++
+ case 't':
+
+ type = optarg;
+diff --git a/src/include/array.h b/src/include/array.h
+index 74050d0a25..d53dec1d3a 100644
+--- a/src/include/array.h
++++ b/src/include/array.h
+@@ -176,7 +176,7 @@
+ #define TOKENS_TAG "tokens"
+ #define TOKEN_TAG "token"
+
+-int is_array(char *id);
++int is_id_array(char *id);
+ int array_delete(job_array *pa);
+ int array_save(job_array *pa);
+ int array_save(job_array *pa);
+diff --git a/src/include/attribute.h b/src/include/attribute.h
+index 8fbff163b8..3d025ab66f 100644
+--- a/src/include/attribute.h
++++ b/src/include/attribute.h
+@@ -512,12 +512,12 @@ int to_size(const char *val, struct size_value *psize);
+ void from_size(struct size_value *psize, char *cvnbuf);
+ void create_size_string(char *buf, struct size_value values);
+
+-#define NULL_FUNC '\0'
++#define NULL_FUNC NULL
+
+ /* other associated funtions */
+
+ int acl_check(pbs_attribute *, char *canidate, int type);
+-int acl_check_my_array_string(struct array_strings *, char *, int);
++int acl_check_my_array_string(struct array_strings *, const char *, int);
+ char *arst_string(const char *str, pbs_attribute *pattr);
+ void attrl_fixlink(tlist_head *svrattrl);
+ void recov_acl(pbs_attribute *, attribute_def *, const char *, const char *);
+diff --git a/src/lib/Libattr/attr_fn_acl.c b/src/lib/Libattr/attr_fn_acl.c
+index ebb2775bf4..a7368b9f3b 100644
+--- a/src/lib/Libattr/attr_fn_acl.c
++++ b/src/lib/Libattr/attr_fn_acl.c
+@@ -232,7 +232,7 @@ fptr_int get_my_match_func(
+ int acl_check_my_array_string(
+
+ struct array_strings *pas,
+- char *name,
++ const char *name,
+ int type)
+
+ {
+@@ -503,6 +503,8 @@ int set_allacl(
+
+ /* No break, "Set" falls into "Incr" to add strings */
+
++ // fall through
++
+ case INCR_OLD:
+ case INCR:
+
+diff --git a/src/lib/Libattr/attr_fn_arst.c b/src/lib/Libattr/attr_fn_arst.c
+index c63281637e..9d82e873a3 100644
+--- a/src/lib/Libattr/attr_fn_arst.c
++++ b/src/lib/Libattr/attr_fn_arst.c
+@@ -532,7 +532,8 @@ int encode_arst(
+
+ *pc++ = '\\';
+
+- // escape sequence added. Fall through.
++ // escape sequence added.
++ // fall through
+
+ default:
+
+@@ -735,6 +736,7 @@ int set_arst(
+ pas->as_next = pas->as_buf;
+
+ /* no break, "SET" falls into "MERGE" to add strings */
++ // fall through
+
+ case INCR_OLD:
+ case MERGE:
+diff --git a/src/lib/Libcmds/cvtdate.c b/src/lib/Libcmds/cvtdate.c
+index e936c6fbed..0e24639619 100644
+--- a/src/lib/Libcmds/cvtdate.c
++++ b/src/lib/Libcmds/cvtdate.c
+@@ -167,7 +167,7 @@ time_t cvtdate(
+ year = atoi(buf) * 100;
+ datestr += 2;
+
+- /* no break, fall into next case */
++ // fall through
+
+ case 10: /* YYMMDDhhmm */
+ buf[0] = datestr[0];
+@@ -187,7 +187,7 @@ time_t cvtdate(
+
+ datestr += 2;
+
+- /* no break, fall into next case */
++ // fall through
+
+ case 8: /* MMDDhhmm */
+ buf[0] = datestr[0];
+@@ -209,7 +209,7 @@ time_t cvtdate(
+
+ datestr += 2;
+
+- /* no break, fall into next case */
++ // fall through
+
+ case 6: /* DDhhmm */
+ buf[0] = datestr[0];
+@@ -229,7 +229,7 @@ time_t cvtdate(
+
+ datestr += 2;
+
+- /* no break, fall into next case */
++ // fall through
+
+ case 4: /* hhmm */
+ buf[0] = datestr[0];
+diff --git a/src/lib/Libdis/disrsc.c b/src/lib/Libdis/disrsc.c
+index ac7fec6cbb..2baf87b2b9 100644
+--- a/src/lib/Libdis/disrsc.c
++++ b/src/lib/Libdis/disrsc.c
+@@ -141,6 +141,8 @@ signed char disrsc(
+ else
+ locret = DIS_OVERFLOW;
+
++ // fall through
++
+ case DIS_OVERFLOW:
+ value = negate ? SCHAR_MIN : SCHAR_MAX;
+ }
+diff --git a/src/lib/Libdis/disrsi.c b/src/lib/Libdis/disrsi.c
+index a2417725fe..dd073b1bb0 100644
+--- a/src/lib/Libdis/disrsi.c
++++ b/src/lib/Libdis/disrsi.c
+@@ -141,6 +141,8 @@ int disrsi(
+ *retval = locret;
+ }
+
++ // fall through
++
+ case DIS_OVERFLOW:
+
+ value = negate ? INT_MIN : INT_MAX;
+diff --git a/src/lib/Libdis/disrsl.c b/src/lib/Libdis/disrsl.c
+index 9853056fcf..5fba4a4ba0 100644
+--- a/src/lib/Libdis/disrsl.c
++++ b/src/lib/Libdis/disrsl.c
+@@ -139,6 +139,8 @@ long disrsl(
+ else
+ locret = DIS_OVERFLOW;
+
++ // fall through
++
+ case DIS_OVERFLOW:
+ value = negate ? LONG_MIN : LONG_MAX;
+ }
+diff --git a/src/lib/Libdis/disrss.c b/src/lib/Libdis/disrss.c
+index 80eb98109b..e2496b8adf 100644
+--- a/src/lib/Libdis/disrss.c
++++ b/src/lib/Libdis/disrss.c
+@@ -140,6 +140,8 @@ short disrss(
+ else
+ locret = DIS_OVERFLOW;
+
++ // fall through
++
+ case DIS_OVERFLOW:
+ value = negate ? SHRT_MIN : SHRT_MAX;
+ }
+diff --git a/src/lib/Libnet/net_client.c b/src/lib/Libnet/net_client.c
+index 8f8542320b..a324c08197 100644
+--- a/src/lib/Libnet/net_client.c
++++ b/src/lib/Libnet/net_client.c
+@@ -532,7 +532,7 @@ int client_to_svr(
+ break;
+ }/* Interrupted system call */
+
+- /* fall through to next case */
++ // fall through
+
+ case EINVAL: /* Invalid argument */
+
+@@ -583,6 +583,8 @@ int client_to_svr(
+
+ goto retry;
+ }
++
++ // fall through
+
+ default:
+
+diff --git a/src/lib/Libnet/net_common.c b/src/lib/Libnet/net_common.c
+index 7b36d31aa1..80bb78bee5 100644
+--- a/src/lib/Libnet/net_common.c
++++ b/src/lib/Libnet/net_common.c
+@@ -405,6 +405,7 @@ int socket_connect_addr(
+ }
+
+ /* essentially, only fall through for a transient failure */
++ // fall through
+
+ /* socket not ready for writing after 5 timeout */
+ case EINVAL: /* Invalid argument */
+diff --git a/src/resmom/checkpoint.c b/src/resmom/checkpoint.c
+index f178f48408..7e94b8b00a 100644
+--- a/src/resmom/checkpoint.c
++++ b/src/resmom/checkpoint.c
+@@ -51,6 +51,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <string>
++#include <sstream>
+ #include <unistd.h>
+ #include <assert.h>
+ #include <dirent.h>
+@@ -950,6 +952,7 @@ int blcr_checkpoint_job(
+ char sid[20];
+ char *arg[20];
+ char buf[1024];
++ std::string err_msg;
+ int len;
+ char **ap;
+ FILE *fs;
+@@ -1107,9 +1110,10 @@ int blcr_checkpoint_job(
+
+ /* remove checkpoint directory that was created for this checkpoint attempt */
+
+- sprintf(buf, "Checkpoint failed for job %s, removing checkpoint directory\n",
+- pjob->ji_qs.ji_jobid);
+- log_ext(-1, __func__, buf, LOG_DEBUG);
++ err_msg = "Checkpoint failed for job ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += ", removing checkpoint directory\n";
++ log_ext(-1, __func__, err_msg.c_str(), LOG_DEBUG);
+
+ delete_blcr_checkpoint_files(pjob);
+
+@@ -1123,9 +1127,12 @@ int blcr_checkpoint_job(
+
+ if (err != 0)
+ {
+- sprintf(buf, "pbs_alterjob requested on job %s failed (%d-%s)\n",
+- pjob->ji_qs.ji_jobid, err, pbs_strerror(err));
+- log_err(-1, __func__, buf);
++ std::ostringstream buf_s;
++
++ buf_s << "pbs_alterjob requested on job " << pjob->ji_qs.ji_jobid <<
++ " failed (" << err << "-" << pbs_strerror(err) << ")\n";
++ err_msg = buf_s.str();
++ log_err(-1, __func__, err_msg.c_str());
+ if (err == PBSE_UNKJOBID)
+ {
+ /* TODO: GB - can the job exit while waiting for the checkpoint
+@@ -1190,9 +1197,12 @@ int blcr_checkpoint_job(
+
+ if (err != 0)
+ {
+- sprintf(buf, "pbs_alterjob requested on job %s failed (%d-%s)\n",
+- pjob->ji_qs.ji_jobid, err, pbs_strerror(err));
+- log_err(-1, __func__, buf);
++ std::ostringstream buf_s;
++
++ buf_s << "pbs_alterjob requested on job " << pjob->ji_qs.ji_jobid <<
++ " failed (" << err << "-" << pbs_strerror(err) << ")\n";
++ err_msg = buf_s.str();
++ log_err(-1, __func__, err_msg.c_str());
+ if (err == PBSE_UNKJOBID)
+ {
+ /* TODO: GB - can the job exit while waiting for the checkpoint
+@@ -1527,6 +1537,8 @@ int start_checkpoint(
+ pid_t pid;
+ int rc = PBSE_NONE;
+ char name_buffer[MAXPATHLEN + 1];
++ std::ostringstream buf_s;
++ std::string buf;
+ time_t time_now;
+
+ time_now = time((time_t *)0);
+@@ -1548,11 +1560,10 @@ int start_checkpoint(
+ * to the pbs_server until the checkpoint has completed successfully.
+ */
+
+- sprintf(name_buffer,"ckpt.%s.%d",
+- pjob->ji_qs.ji_jobid,
+- (int)time_now);
++ buf_s << "ckpt." << pjob->ji_qs.ji_jobid << "." << time_now;
++ buf = buf_s.str();
+
+- decode_str(&pjob->ji_wattr[JOB_ATR_checkpoint_name], NULL, NULL, name_buffer, 0);
++ decode_str(&pjob->ji_wattr[JOB_ATR_checkpoint_name], NULL, NULL, buf.c_str(), 0);
+
+ pjob->ji_wattr[JOB_ATR_checkpoint_name].at_flags =
+ ATR_VFLAG_SET | ATR_VFLAG_MODIFY;
+@@ -1760,8 +1771,8 @@ int blcr_restart_job(
+ int pid;
+ char sid[20];
+ char *arg[20];
++ std::string err_msg;
+ extern char restart_script_name[MAXPATHLEN + 1];
+- char buf[1024];
+ char namebuf[MAXPATHLEN + 1];
+ char restartfile[MAXPATHLEN + 1];
+ char script_buf[MAXPATHLEN + 1];
+@@ -1886,14 +1897,18 @@ int blcr_restart_job(
+ arg[6] = SET_ARG(pjob->ji_wattr[JOB_ATR_checkpoint_name].at_val.at_str);
+ arg[7] = NULL;
+
+- snprintf(buf, sizeof(buf), "restart args: %s %s %s %s %s %s %s",
+- restart_script_name, sid, pjob->ji_qs.ji_jobid,
+- SET_ARG(pjob->ji_wattr[JOB_ATR_euser].at_val.at_str),
+- SET_ARG(pjob->ji_wattr[JOB_ATR_egroup].at_val.at_str),
+- namebuf,
+- SET_ARG(pjob->ji_wattr[JOB_ATR_checkpoint_name].at_val.at_str));
+-
+- log_ext(-1, __func__, buf, LOG_DEBUG);
++ err_msg = "restart args: ";
++ err_msg += restart_script_name;
++ err_msg += " ";
++ err_msg += SET_ARG(pjob->ji_wattr[JOB_ATR_euser].at_val.at_str);
++ err_msg += " ";
++ err_msg += SET_ARG(pjob->ji_wattr[JOB_ATR_egroup].at_val.at_str);
++ err_msg += " ";
++ err_msg += namebuf;
++ err_msg += " ";
++ err_msg += SET_ARG(pjob->ji_wattr[JOB_ATR_checkpoint_name].at_val.at_str);
++
++ log_ext(-1, __func__, err_msg.c_str(), LOG_DEBUG);
+
+ log_close(0);
+
+diff --git a/src/resmom/generate_alps_status.c b/src/resmom/generate_alps_status.c
+index 305d603874..286d6b02ef 100644
+--- a/src/resmom/generate_alps_status.c
++++ b/src/resmom/generate_alps_status.c
+@@ -87,6 +87,7 @@
+ #include "alps_constants.h"
+ #include "alps_functions.h"
+ #include <string>
++#include <sstream>
+ #include <vector>
+ #include <set>
+ #include <time.h>
+@@ -586,9 +587,9 @@ int process_node(
+ ani.features += features.c_str();
+ }
+
+- char node_index_buf[MAXLINE];
+- snprintf(node_index_buf, sizeof(node_index_buf), "node_index=%lu", alps_nodes.size());
+- ani.node_index = node_index_buf;
++ std::ostringstream ostr;
++ ostr << "node_index=" << alps_nodes.size();
++ ani.node_index = ostr.str();
+
+ alps_nodes[nid] = ani;
+
+diff --git a/src/resmom/linux/mom_mach.c b/src/resmom/linux/mom_mach.c
+index acaf81d467..8d8011a868 100644
+--- a/src/resmom/linux/mom_mach.c
++++ b/src/resmom/linux/mom_mach.c
+@@ -3,6 +3,7 @@
+ #include "lib_mom.h" /* header */
+
+ #include <string>
++#include <sstream>
+ #include <vector>
+ #include <assert.h>
+ #include <limits.h>
+@@ -1221,6 +1222,7 @@ unsigned long cput_sum(
+ int fd;
+ int rc;
+ char buf[LOCAL_BUF_SIZE];
++ std::string err_msg;
+
+ pbs_attribute *pattr;
+ pattr = &pjob->ji_wattr[JOB_ATR_req_information];
+@@ -1234,8 +1236,11 @@ unsigned long cput_sum(
+ rc = cr->get_req_index_for_host(mom_alias, req_index);
+ if (rc != PBSE_NONE)
+ {
+- sprintf(buf, "Could not find req for host %s, job_id %s", mom_alias, pjob->ji_qs.ji_jobid);
+- log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf);
++ err_msg = "Could not find req for host ";
++ err_msg += mom_alias;
++ err_msg += ", job_id ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, err_msg.c_str());
+ return(cputime);
+ }
+
+@@ -1272,8 +1277,11 @@ unsigned long cput_sum(
+ {
+ if (pjob->ji_cgroups_created == true)
+ {
+- sprintf(buf, "failed to open %s: %s", full_cgroup_path.c_str(), strerror(errno));
+- log_err(-1, __func__, buf);
++ err_msg = "failed to open ";
++ err_msg += full_cgroup_path;
++ err_msg += ": ";
++ err_msg += strerror(errno);
++ log_err(-1, __func__, err_msg.c_str());
+ }
+ return(0);
+ }
+@@ -1281,8 +1289,11 @@ unsigned long cput_sum(
+ rc = read(fd, buf, LOCAL_BUF_SIZE);
+ if (rc == -1)
+ {
+- sprintf(buf, "failed to read %s: %s", full_cgroup_path.c_str(), strerror(errno));
+- log_err(-1, __func__, buf);
++ err_msg = "failed to read ";
++ err_msg += full_cgroup_path;
++ err_msg += ": ";
++ err_msg += strerror(errno);
++ log_err(-1, __func__, err_msg.c_str());
+ close(fd);
+ return(0);
+ }
+@@ -1567,6 +1578,7 @@ unsigned long long resi_sum(
+ char buf[LOCAL_BUF_SIZE];
+ int fd;
+ int rc;
++ std::string err_msg;
+
+ pbs_attribute *pattr;
+ pattr = &pjob->ji_wattr[JOB_ATR_req_information];
+@@ -1579,8 +1591,11 @@ unsigned long long resi_sum(
+ rc = cr->get_req_index_for_host(mom_alias, req_index);
+ if (rc != PBSE_NONE)
+ {
+- sprintf(buf, "Could not find req for host %s, job_id %s", mom_alias, pjob->ji_qs.ji_jobid);
+- log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf);
++ err_msg = "Could not find req for host ";
++ err_msg += mom_alias;
++ err_msg += ", job_id ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, err_msg.c_str());
+ return(resisize);
+ }
+
+@@ -1614,8 +1629,11 @@ unsigned long long resi_sum(
+ {
+ if (pjob->ji_cgroups_created == true)
+ {
+- sprintf(buf, "failed to open %s: %s", full_cgroup_path.c_str(), strerror(errno));
+- log_err(-1, __func__, buf);
++ err_msg = "failed to open ";
++ err_msg += full_cgroup_path;
++ err_msg += ": ";
++ err_msg += strerror(errno);
++ log_err(-1, __func__, err_msg.c_str());
+ }
+
+ return(0);
+@@ -1624,8 +1642,11 @@ unsigned long long resi_sum(
+ rc = read(fd, buf, LOCAL_BUF_SIZE);
+ if (rc == -1)
+ {
+- sprintf(buf, "failed to read %s: %s", full_cgroup_path.c_str(), strerror(errno));
+- log_err(-1, __func__, buf);
++ err_msg = "failed to read ";
++ err_msg += full_cgroup_path;
++ err_msg += ": ";
++ err_msg += strerror(errno);
++ log_err(-1, __func__, err_msg.c_str());
+ close(fd);
+ return(0);
+ }
+@@ -1637,8 +1658,9 @@ unsigned long long resi_sum(
+ buf2 = strstr(buf, "\nrss ");
+ if (buf2 == NULL)
+ {
+- sprintf(buf, "read failed finding rss %s", full_cgroup_path.c_str());
+- log_err(errno, __func__, buf);
++ err_msg = "read failed finding rss ";
++ err_msg += full_cgroup_path;
++ log_err(errno, __func__, err_msg.c_str());
+ close(fd);
+ return(0);
+ }
+@@ -4983,16 +5005,17 @@ void scan_non_child_tasks(void)
+
+ if (!found)
+ {
+- char buf[MAXLINE];
++ std::ostringstream sbuf;
++ std::string buf;
+
+ extern int exiting_tasks;
+
+- sprintf(buf, "found exited session %d for task %d in job %s",
+- pTask->ti_qs.ti_sid,
+- pTask->ti_qs.ti_task,
+- pJob->ji_qs.ji_jobid);
++ sbuf << "found exited session " << pTask->ti_qs.ti_sid <<
++ " for task " << pTask->ti_qs.ti_task << " in job " <<
++ pJob->ji_qs.ji_jobid;
++ buf = sbuf.str();
+
+- log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf);
++ log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf.c_str());
+
+ pTask->ti_qs.ti_exitstat = 0; /* actually unknown */
+ pTask->ti_qs.ti_status = TI_STATE_EXITED;
+@@ -5006,10 +5029,11 @@ void scan_non_child_tasks(void)
+
+ if (LOGLEVEL >= 7)
+ {
+- sprintf(buf, "marking job as MOM_JOB_RECOVERY for task %d",
+- pTask->ti_qs.ti_task);
++ sbuf << "marking job as MOM_JOB_RECOVERY for task " <<
++ pTask->ti_qs.ti_task);
++ buf = sbuf.str();
+
+- log_event(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pJob->ji_qs.ji_jobid, buf);
++ log_event(PBSEVENT_DEBUG, PBS_EVENTCLASS_JOB, pJob->ji_qs.ji_jobid, buf.c_str());
+ }
+ }
+ #endif /* USESAVEDRESOURCES */
+@@ -5075,7 +5099,6 @@ const char *idletime(
+ DIR *dp;
+
+ struct dirent *de;
+- char ttyname[50];
+ time_t curtm;
+
+ if (attrib)
+@@ -5104,16 +5127,18 @@ const char *idletime(
+
+ while ((de = readdir(dp)) != NULL)
+ {
++ std::string ttyname;
++
+ if (maxtm >= curtm)
+ break;
+
+ if (strncmp(de->d_name, "tty", 3))
+ continue;
+
+- sprintf(ttyname, "/dev/%s",
+- de->d_name);
++ ttyname = "/dev/";
++ ttyname += de->d_name;
+
+- setmax(ttyname);
++ setmax(ttyname.c_str());
+ }
+
+ closedir(dp);
+diff --git a/src/resmom/mom_main.c b/src/resmom/mom_main.c
+index 2d8453a15f..35896e58b1 100644
+--- a/src/resmom/mom_main.c
++++ b/src/resmom/mom_main.c
+@@ -1067,7 +1067,7 @@ char *conf_res(
+ goto done;
+ }
+
+- name[i] = '\0';
++ name[i] = NULL;
+
+ for (d = ret_string, resline++;*resline;)
+ {
+@@ -6519,17 +6519,17 @@ void prepare_child_tasks_for_delete()
+ for (unsigned int i = 0; i < pJob->ji_tasks->size(); i++)
+ {
+ task *pTask = pJob->ji_tasks->at(i);
+-
+- char buf[128];
++ std::ostringstream sbuf;
++ std::string buf;
+
+ extern int exiting_tasks;
+
+- sprintf(buf, "preparing exited session %d for task %d in job %s for deletion",
+- pTask->ti_qs.ti_sid,
+- pTask->ti_qs.ti_task,
+- pJob->ji_qs.ji_jobid);
++ sbuf << "preparing exited session " << pTask->ti_qs.ti_sid <<
++ " for task " << pTask->ti_qs.ti_task << " in job " <<
++ pJob->ji_qs.ji_jobid << " for deletion";
++ buf = sbuf.str();
+
+- log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf);
++ log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, buf.c_str());
+
+ pTask->ti_qs.ti_exitstat = 0; /* actually unknown */
+ pTask->ti_qs.ti_status = TI_STATE_EXITED;
+diff --git a/src/resmom/mom_req_quejob.c b/src/resmom/mom_req_quejob.c
+index 2211f52d55..4e10581184 100644
+--- a/src/resmom/mom_req_quejob.c
++++ b/src/resmom/mom_req_quejob.c
+@@ -743,11 +743,15 @@ void req_mvjobfile(
+
+ if (pj == NULL)
+ {
+- snprintf(log_buffer, 1024, "cannot find job %s for move of %s file",
+- preq->rq_ind.rq_jobfile.rq_jobid,
+- TJobFileType[jft]);
++ std::string err_msg;
+
+- log_err(-1, __func__, log_buffer);
++ err_msg = "cannot find job ";
++ err_msg += preq->rq_ind.rq_jobfile.rq_jobid;
++ err_msg += " for move of ";
++ err_msg += TJobFileType[jft];
++ err_msg += " file";
++
++ log_err(-1, __func__, err_msg.c_str());
+
+ req_reject(PBSE_UNKJOBID, 0, preq, NULL, NULL);
+
+diff --git a/src/resmom/mom_server.c b/src/resmom/mom_server.c
+index f90c2cd227..e03395225a 100644
+--- a/src/resmom/mom_server.c
++++ b/src/resmom/mom_server.c
+@@ -1900,7 +1900,6 @@ void mom_server_diag(
+ std::stringstream &output)
+
+ {
+- char tmpLine[1024];
+ time_t Now;
+
+ if (pms->pbs_servername[0] == '\0')
+@@ -1910,22 +1909,18 @@ void mom_server_diag(
+
+ time(&Now);
+
+- sprintf(tmpLine, "Server[%d]: %s (%s)\n",
+- sindex,
+- pms->pbs_servername,
+- netaddr(&(pms->sock_addr)));
+-
+- output << tmpLine;
++ output << "Server[" << sindex << "]: " << pms->pbs_servername <<
++ " (" << netaddr(&(pms->sock_addr)) << ")\n";
+
+ if (pms->MOMSendStatFailure[0] != '\0')
+ {
+- sprintf(tmpLine, " WARNING: could not open connection to server, %s%s\n",
+- pms->MOMSendStatFailure,
+- (strstr(pms->MOMSendStatFailure, "cname") != NULL) ?
+- " (check name resolution - /etc/hosts?)" :
+- "");
++ output << " WARNING: could not open connection to server, " <<
++ pms->MOMSendStatFailure;
++
++ if (strstr(pms->MOMSendStatFailure, "cname") != NULL)
++ output << " (check name resolution - /etc/hosts?)";
+
+- output << tmpLine;
++ output << "\n";
+ }
+
+ if (TMOMRejectConn[0] != '\0')
+@@ -1935,30 +1930,26 @@ void mom_server_diag(
+
+ if (pms->MOMLastRecvFromServerTime > 0)
+ {
+- sprintf(tmpLine, " Last Msg From Server: %ld seconds (%s)\n",
+- (long)Now - pms->MOMLastRecvFromServerTime,
+- (pms->MOMLastRecvFromServerCmd[0] != '\0') ?
+- pms->MOMLastRecvFromServerCmd : "N/A");
++ output << " Last Msg From Server: " <<
++ ((long)Now - pms->MOMLastRecvFromServerTime) << " seconds (" <<
++ ((pms->MOMLastRecvFromServerCmd[0] != '\0') ?
++ pms->MOMLastRecvFromServerCmd : "N/A") << "\n";
+ }
+ else
+ {
+- sprintf(tmpLine, " WARNING: no messages received from server\n");
++ output << " WARNING: no messages received from server\n";
+ }
+
+- output << tmpLine;
+-
+ if (pms->MOMLastSendToServerTime > 0)
+ {
+- sprintf(tmpLine, " Last Msg To Server: %ld seconds\n",
+- (long)Now - pms->MOMLastSendToServerTime);
++ output << " Last Msg To Server: " <<
++ ((long)Now - pms->MOMLastSendToServerTime) << " seconds\n";
+ }
+ else
+ {
+- sprintf(tmpLine, " WARNING: no messages sent to server\n");
++ output << " WARNING: no messages sent to server\n";
+ }
+
+- output << tmpLine;
+-
+ return;
+ } /* END mom_server_diag() */
+
+diff --git a/src/resmom/parse_config.c b/src/resmom/parse_config.c
+index 8c4bb8585d..35efb7880e 100644
+--- a/src/resmom/parse_config.c
++++ b/src/resmom/parse_config.c
+@@ -2385,14 +2385,14 @@ void reset_config_vars()
+ mom_host[0] = '\0';
+ hostname_specified = 0;
+ MOMConfigRReconfig = 0;
+- TNoSpoolDirList[0] = '\0';
++ TNoSpoolDirList[0] = NULL;
+ is_reporter_mom = FALSE;
+ is_login_node = FALSE;
+ job_exit_wait_time = DEFAULT_JOB_EXIT_WAIT_TIME;
+ jobstarter_exe_name[0] = '\0';
+ jobstarter_set = 0;
+ server_alias = NULL;
+- TRemChkptDirList[0] = '\0';
++ TRemChkptDirList[0] = NULL;
+ tmpdir_basename[0] = '\0'; /* for $TMPDIR */
+ rcp_path[0] = '\0';
+ rcp_args[0] = '\0';
+diff --git a/src/resmom/requests.c b/src/resmom/requests.c
+index 588905e4e3..6fce46cdfb 100644
+--- a/src/resmom/requests.c
++++ b/src/resmom/requests.c
+@@ -1490,16 +1490,16 @@ void req_modifyjob(
+ int rc;
+ unsigned int momport = 0;
+
+- char tmpLine[1024];
++ std::string tmpLine;
+
+ pjob = mom_find_job(preq->rq_ind.rq_modify.rq_objname);
+
+ if (pjob == NULL)
+ {
+- sprintf(tmpLine, "modify job failed, unknown job %s",
+- preq->rq_ind.rq_modify.rq_objname);
++ tmpLine = "modify job failed, unknown job ";
++ tmpLine += preq->rq_ind.rq_modify.rq_objname;
+
+- req_reject(PBSE_UNKJOBID, 0, preq, mom_host, tmpLine);
++ req_reject(PBSE_UNKJOBID, 0, preq, mom_host, tmpLine.c_str());
+
+ return;
+ }
+diff --git a/src/scheduler.cc/samples/fifo/dedtime.c b/src/scheduler.cc/samples/fifo/dedtime.c
+index b919ec8946..246bd4f8af 100644
+--- a/src/scheduler.cc/samples/fifo/dedtime.c
++++ b/src/scheduler.cc/samples/fifo/dedtime.c
+@@ -118,7 +118,7 @@ int parse_ded_file(const char *filename)
+
+ i = 0;
+
+- memset(conf.ded_time, 0, MAX_DEDTIME_SIZE);
++ memset(conf.ded_time, 0, sizeof(struct timegap) * MAX_DEDTIME_SIZE);
+
+ while (fgets(line, 256, fp) != NULL)
+ {
+diff --git a/src/server/array_func.c b/src/server/array_func.c
+index fabe4541fa..8f5caf0520 100644
+--- a/src/server/array_func.c
++++ b/src/server/array_func.c
+@@ -4,7 +4,7 @@
+
+ included functions:
+
+- is_array() determine if jobnum is actually an array identifyer
++ is_id_array() determine if jobnum is actually an array identifyer
+ get_array() return array struct for given "parent id"
+ array_save() save array struct to disk
+ array_get_parent_id() return id of parent job if job belongs to a job array
+@@ -90,7 +90,7 @@ void force_purge_work(job *pjob);
+
+ /* search job array list to determine if id is a job array */
+
+-int is_array(
++int is_id_array(
+
+ char *id)
+
+@@ -154,7 +154,7 @@ int is_array(
+ allarrays.unlock();
+
+ return(rc);
+- } /* END is_array() */
++ } /* END is_id_array() */
+
+
+
+diff --git a/src/server/array_func.h b/src/server/array_func.h
+index 6cb1b84c9c..70e3d326f7 100644
+--- a/src/server/array_func.h
++++ b/src/server/array_func.h
+@@ -8,7 +8,7 @@
+ #include "batch_request.h" /* batch_request */
+
+
+-int is_array(char *id);
++int is_id_array(char *id);
+
+ int array_save(job_array *pa);
+
+diff --git a/src/server/job_func.c b/src/server/job_func.c
+index dbc47de458..8922deab35 100644
+--- a/src/server/job_func.c
++++ b/src/server/job_func.c
+@@ -2387,22 +2387,36 @@ int fix_cray_exec_hosts(
+
+
+
++// change job id from x.y to x-0.y
+
+ int change_external_job_name(
+
+ job *pjob)
+
+ {
+- char tmp_jobid[PBS_MAXSVRJOBID + 1];
+- char *dot = strchr(pjob->ji_qs.ji_jobid, '.');
++ std::string jobid_new;
++ size_t pos;
+
+- if (dot != NULL)
+- *dot = '\0';
++ // null job pointer
++ if (pjob == NULL)
++ return(-1);
+
+- snprintf(tmp_jobid, sizeof(tmp_jobid), "%s-0.%s",
+- pjob->ji_qs.ji_jobid, dot + 1);
++ // copy original job id
++ jobid_new = pjob->ji_qs.ji_jobid;
++
++ // make sure job id has a .
++ if ((pos = jobid_new.find('.', 0)) == std::string::npos)
++ return(-1);
++
++ // change "." to "-0."
++ jobid_new.replace(pos, 1, "-0.");
++
++ // confirm new string will fit
++ if (jobid_new.length() > PBS_MAXSVRJOBID)
++ return(-1);
+
+- strcpy(pjob->ji_qs.ji_jobid, tmp_jobid);
++ // update original
++ strncpy(pjob->ji_qs.ji_jobid, jobid_new.c_str(), PBS_MAXSVRJOBID);
+
+ return(PBSE_NONE);
+ } /* END change_external_job_name() */
+diff --git a/src/server/node_attr_def.c b/src/server/node_attr_def.c
+index 37aa121ca2..386f12b32d 100644
+--- a/src/server/node_attr_def.c
++++ b/src/server/node_attr_def.c
+@@ -380,7 +380,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -392,7 +392,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -404,7 +404,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -416,7 +416,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -428,7 +428,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -440,7 +440,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -452,7 +452,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+@@ -464,7 +464,7 @@ attribute_def node_attr_def[] =
+ set_l,
+ comp_null,
+ free_null,
+- NULL_FUNC,
++ NULL_FUNC,
+ NO_USER_SET,
+ ATR_TYPE_LONG,
+ PARENT_TYPE_NODE,
+diff --git a/src/server/node_manager.c b/src/server/node_manager.c
+index 663b741da6..92c4d73f8a 100644
+--- a/src/server/node_manager.c
++++ b/src/server/node_manager.c
+@@ -924,9 +924,10 @@ void process_legacy_job_attribute_information(
+ {
+ char *attr_name = threadsafe_tokenizer(&attr_val, "=");
+
+- if ((attr_name != NULL) &&
+- (attr_val != '\0'))
++ if ((attr_name != NULL) && (*attr_name != '\0') &&
++ (attr_val != NULL) && (*attr_val != '\0'))
+ {
++ // convert attr_name, attr_val strings to an attribute
+ if (str_to_attr(attr_name, attr_val, pjob->ji_wattr, job_attr_def, JOB_ATR_LAST) == ATTR_NOT_FOUND)
+ {
+ // should be resources used if not found as attribute
+diff --git a/src/server/pbsd_init.c b/src/server/pbsd_init.c
+index 0233800586..1a639ab2dc 100644
+--- a/src/server/pbsd_init.c
++++ b/src/server/pbsd_init.c
+@@ -2667,6 +2667,8 @@ int pbsd_init_job(
+
+ svr_setjobstate(pjob, JOB_STATE_COMPLETE, JOB_SUBSTATE_COMPLETE, FALSE);
+
++ // fall through
++
+
+ case JOB_SUBSTATE_COMPLETE:
+
+diff --git a/src/server/process_request.c b/src/server/process_request.c
+index e7f243f58e..ec1935cca4 100644
+--- a/src/server/process_request.c
++++ b/src/server/process_request.c
+@@ -795,7 +795,7 @@ int dispatch_request(
+ * req_deletejob() function.
+ */
+
+- if (is_array(request->rq_ind.rq_delete.rq_objname))
++ if (is_id_array(request->rq_ind.rq_delete.rq_objname))
+ rc = req_deletearray(request);
+ else
+ rc = req_deletejob(request);
+@@ -803,7 +803,7 @@ int dispatch_request(
+ break;
+
+ case PBS_BATCH_HoldJob:
+- if (is_array(request->rq_ind.rq_hold.rq_orig.rq_objname))
++ if (is_id_array(request->rq_ind.rq_hold.rq_orig.rq_objname))
+ rc = req_holdarray(request);
+ else
+ rc = req_holdjob(request);
+@@ -843,7 +843,7 @@ int dispatch_request(
+ case PBS_BATCH_AsyModifyJob:
+
+ case PBS_BATCH_ModifyJob:
+- if (is_array(request->rq_ind.rq_delete.rq_objname))
++ if (is_id_array(request->rq_ind.rq_delete.rq_objname))
+ rc = req_modifyarray(request);
+ else
+ req_modifyjob(request);
+@@ -888,7 +888,7 @@ int dispatch_request(
+
+ case PBS_BATCH_ReleaseJob:
+
+- if (is_array(request->rq_ind.rq_delete.rq_objname))
++ if (is_id_array(request->rq_ind.rq_delete.rq_objname))
+ rc = req_releasearray(request);
+ else
+ rc = req_releasejob(request);
+@@ -972,7 +972,7 @@ int dispatch_request(
+
+ case PBS_BATCH_RegistDep:
+
+- if (is_array(request->rq_ind.rq_register.rq_parent))
++ if (is_id_array(request->rq_ind.rq_register.rq_parent))
+ {
+ rc = req_registerarray(request);
+ }
+diff --git a/src/server/req_quejob.c b/src/server/req_quejob.c
+index e30acbb59d..5ce1ec3fdf 100644
+--- a/src/server/req_quejob.c
++++ b/src/server/req_quejob.c
+@@ -326,7 +326,7 @@ void sum_select_mem_request(
+ tmp = atoi(current);
+
+ /* advance past the digits to the units */
+- while ((current != '\0') &&
++ while ((*current != '\0') &&
+ (isdigit(*current)))
+ current++;
+
+diff --git a/src/server/req_runjob.c b/src/server/req_runjob.c
+index 8b128b8dba..59dbe77b48 100644
+--- a/src/server/req_runjob.c
++++ b/src/server/req_runjob.c
+@@ -1676,8 +1676,14 @@ job *chk_job_torun(
+
+ if ((pjob->ji_qs.ji_state != JOB_STATE_QUEUED) && (pjob->ji_qs.ji_state != JOB_STATE_HELD))
+ {
+- sprintf(EMsg, "job %s state %s", pjob->ji_qs.ji_jobid, PJobState[pjob->ji_qs.ji_state]);
+- req_reject(PBSE_BADSTATE, 0, preq, NULL, EMsg);
++ std::string err_msg;
++
++ err_msg = "job ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += " state ";
++ err_msg += PJobState[pjob->ji_qs.ji_state];
++
++ req_reject(PBSE_BADSTATE, 0, preq, NULL, err_msg.c_str());
+ return(NULL);
+ }
+
+diff --git a/src/server/req_stat.c b/src/server/req_stat.c
+index 21a608aeee..392f22772e 100644
+--- a/src/server/req_stat.c
++++ b/src/server/req_stat.c
+@@ -241,7 +241,7 @@ int req_stat_job(
+ {
+ /* status a single job */
+
+- if (is_array(name))
++ if (is_id_array(name))
+ {
+ if (type != tjstSummarizeArraysServer)
+ {
+diff --git a/src/server/svr_chk_owner.c b/src/server/svr_chk_owner.c
+index 4b33c57226..b98135710e 100644
+--- a/src/server/svr_chk_owner.c
++++ b/src/server/svr_chk_owner.c
+@@ -413,9 +413,8 @@ int authenticate_user(
+
+ {
+ int rc;
+- char uath[PBS_MAXUSER + PBS_MAXHOSTNAME + 1];
+ time_t time_now = time(NULL);
+- char error_msg[1024];
++ std::string error_msg;
+ long acl_enabled = FALSE;
+
+ #ifdef MUNGE_AUTH
+@@ -437,9 +436,14 @@ int authenticate_user(
+ if ((acl_check_my_array_string(my_acl, uh, ACL_User_Host)) == 0)
+ {
+ *autherr = strdup("User not in authorized user list.");
+- sprintf(error_msg, "%s Requested user %s: requested from host %s",
+- *autherr, preq->rq_user, preq->rq_host);
+- log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg);
++
++ error_msg = *autherr;
++ error_msg += " Requested user ";
++ error_msg += preq->rq_user;
++ error_msg += ": requested from host ";
++ error_msg += preq->rq_host;
++
++ log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg.c_str());
+ return(PBSE_BADCRED);
+ }
+ }
+@@ -447,9 +451,16 @@ int authenticate_user(
+ if (strncmp(preq->rq_user, pcred->username, PBS_MAXUSER))
+ {
+ *autherr = strdup("Users do not match");
+- sprintf(error_msg, "%s: Requested user %s: credential user %s: requested from host %s",
+- *autherr, preq->rq_user, pcred->username, preq->rq_host);
+- log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg);
++
++ error_msg = *autherr;
++ error_msg += " Requested user ";
++ error_msg += preq->rq_user;
++ error_msg += ": credential user ";
++ error_msg += pcred->username;
++ error_msg += ": requested from host ";
++ error_msg += preq->rq_host;
++
++ log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg.c_str());
+ return(PBSE_BADCRED);
+ }
+ #endif
+@@ -481,10 +492,14 @@ int authenticate_user(
+ (memcmp(sai1, sai2, sizeof(struct sockaddr_in))))
+ {
+ *autherr = strdup("Hosts do not match");
+-
+- sprintf(error_msg, "%s: Requested host %s: credential host: %s",
+- *autherr, preq->rq_host, pcred->hostname);
+- log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg);
++
++ error_msg = *autherr;
++ error_msg += ": Requested host ";
++ error_msg += preq->rq_host;
++ error_msg += ": credential host: ";
++ error_msg += pcred->hostname;
++
++ log_event(PBSEVENT_ADMIN, PBS_EVENTCLASS_SERVER, __func__, error_msg.c_str());
+
+ return(PBSE_BADCRED);
+ }
+@@ -520,10 +535,14 @@ int authenticate_user(
+ if (acl_enabled)
+ {
+ struct array_strings *acl_users = NULL;
+- snprintf(uath, sizeof(uath), "%s@%s", preq->rq_user, preq->rq_host);
++ std::string uath;
++
++ uath = preq->rq_user;
++ uath += "@";
++ uath = preq->rq_host;
+
+ get_svr_attr_arst(SRV_ATR_AclUsers, &acl_users);
+- if (acl_check_my_array_string(acl_users, uath, ACL_User) == 0)
++ if (acl_check_my_array_string(acl_users, uath.c_str(), ACL_User) == 0)
+ {
+ int my_err;
+ pbs_net_t connect_addr = get_hostaddr(&my_err, preq->rq_host);
+diff --git a/src/test/catch_child/scaffolding.c b/src/test/catch_child/scaffolding.c
+index 7db1077854..f08383d01e 100644
+--- a/src/test/catch_child/scaffolding.c
++++ b/src/test/catch_child/scaffolding.c
+@@ -1012,6 +1012,7 @@ int DIS_reply_read(struct tcp_chan *chan, struct batch_reply *preply)
+ {
+ case 1:
+ rc = 1;
++ // fall through
+ case 2:
+ preply->brp_code = PBSE_NONE;
+ LOGLEVEL = 4;
+diff --git a/src/test/geteusernam/scaffolding.c b/src/test/geteusernam/scaffolding.c
+index ec849ab6df..f2cb83be16 100644
+--- a/src/test/geteusernam/scaffolding.c
++++ b/src/test/geteusernam/scaffolding.c
+@@ -64,7 +64,7 @@ void get_jobowner(char *from, char *to)
+ exit(1);
+ }
+
+-int acl_check_my_array_string(struct array_strings *pas, char *name, int type)
++int acl_check_my_array_string(struct array_strings *pas, const char *name, int type)
+ {
+ return(0);
+ }
+diff --git a/src/test/node_manager/test_uut.c b/src/test/node_manager/test_uut.c
+index 75c23b39af..b4aa98912f 100644
+--- a/src/test/node_manager/test_uut.c
++++ b/src/test/node_manager/test_uut.c
+@@ -284,12 +284,12 @@ END_TEST
+ START_TEST(test_kill_job_on_mom)
+ {
+ struct pbsnode pnode;
+- char job_id[20];
++ char *job_id;
+ int rc;
+ unsigned long addr = 4567;
+
+ memset(&pnode, 0, sizeof(pnode));
+- strcpy(job_id, "33.torque-devtest-03");
++ job_id = strdup("33.torque-devtest-03");
+
+ pnode.change_name("numa3.ac");
+ pnode.nd_mom_port = 1234;
+diff --git a/src/test/pbs_log/scaffolding.c b/src/test/pbs_log/scaffolding.c
+index fc5878c601..d63f053851 100644
+--- a/src/test/pbs_log/scaffolding.c
++++ b/src/test/pbs_log/scaffolding.c
+@@ -37,8 +37,7 @@ DIR *opendir(const char *name)
+
+ int closedir(DIR *dirp)
+ {
+- if (dirp != NULL)
+- free(dirp);
++ free(dirp);
+ return(0);
+ }
+
+diff --git a/src/test/pbsd_main/scaffolding.c b/src/test/pbsd_main/scaffolding.c
+index 90110e8fe8..0d7179a795 100644
+--- a/src/test/pbsd_main/scaffolding.c
++++ b/src/test/pbsd_main/scaffolding.c
+@@ -407,7 +407,7 @@ int get_svr_attr_arst(int index, struct array_strings **arst)
+ return(0);
+ }
+
+-int acl_check_my_array_string(struct array_strings *pas, char *name, int type)
++int acl_check_my_array_string(struct array_strings *pas, const char *name, int type)
+ {
+ return(0);
+ }
+diff --git a/src/test/process_alps_status/scaffolding.c b/src/test/process_alps_status/scaffolding.c
+index dd8ab2c577..3c6449aa70 100644
+--- a/src/test/process_alps_status/scaffolding.c
++++ b/src/test/process_alps_status/scaffolding.c
+@@ -713,6 +713,8 @@ int set_arst(
+ pas->as_next = pas->as_buf;
+
+ /* no break, "SET" falls into "MERGE" to add strings */
++ // fall through
++
+ case INCR_OLD:
+ case MERGE:
+
+diff --git a/src/test/process_request/scaffolding.c b/src/test/process_request/scaffolding.c
+index 66618f8900..36aff63746 100644
+--- a/src/test/process_request/scaffolding.c
++++ b/src/test/process_request/scaffolding.c
+@@ -373,9 +373,9 @@ int req_modify_node(struct batch_request *preq)
+ }
+
+
+-int is_array(char *id)
++int is_id_array(char *id)
+ {
+- fprintf(stderr, "The call to is_array needs to be mocked!!\n");
++ fprintf(stderr, "The call to is_id_array needs to be mocked!!\n");
+ exit(1);
+ }
+
+@@ -489,7 +489,7 @@ int get_svr_attr_b(int index, bool *b)
+ return(0);
+ }
+
+-int acl_check_my_array_string(struct array_strings *pas, char *name, int type)
++int acl_check_my_array_string(struct array_strings *pas, const char *name, int type)
+ {
+ return(0);
+ }
+diff --git a/src/test/req_stat/scaffolding.c b/src/test/req_stat/scaffolding.c
+index cbba4d809a..80f1956d61 100644
+--- a/src/test/req_stat/scaffolding.c
++++ b/src/test/req_stat/scaffolding.c
+@@ -221,9 +221,9 @@ int svr_connect(pbs_net_t hostaddr, unsigned int port, int *err, struct pbsnode
+ exit(1);
+ }
+
+-int is_array(char *id)
++int is_id_array(char *id)
+ {
+- fprintf(stderr, "The call to is_array to be mocked!!\n");
++ fprintf(stderr, "The call to is_id_array to be mocked!!\n");
+ exit(1);
+ }
+
+diff --git a/src/test/svr_chk_owner/scaffolding.c b/src/test/svr_chk_owner/scaffolding.c
+index 6d00f6e381..59a8c84e95 100644
+--- a/src/test/svr_chk_owner/scaffolding.c
++++ b/src/test/svr_chk_owner/scaffolding.c
+@@ -79,7 +79,7 @@ int get_svr_attr_arst(int index, struct array_strings **arst)
+ return(0);
+ }
+
+-int acl_check_my_array_string(struct array_strings *pas, char *name, int type)
++int acl_check_my_array_string(struct array_strings *pas, const char *name, int type)
+ {
+ return(0);
+ }
+diff --git a/torque.setup.in b/torque.setup.in
+index 15716c9b97..b0f2ee305f 100644
+--- a/torque.setup.in
++++ b/torque.setup.in
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # torque.setup - create pbs_server database and default queue
+ #
+--- a/src/server/svr_jobfunc.c 2017-08-29 22:25:11.000000000 -0000
++++ b/src/server/svr_jobfunc.c 2019-10-22 14:29:39.465723637 -0000
+@@ -4015,16 +4015,18 @@
+
+ {
+ int rc = PBSE_NONE;
+- char *err_msg = NULL;
+- char stub_msg[] = "no pos";
++ std::string err_msg;
+
+ if (logging >= 10)
+ {
+- err_msg = (char *)calloc(1, MSG_LEN_LONG);
+- if (msg == NULL)
+- msg = stub_msg;
+- snprintf(err_msg, MSG_LEN_LONG, "locking %s in method %s-%s", pjob->ji_qs.ji_jobid, id, msg);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "locking ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += " in method ";
++ err_msg += id;
++ err_msg += "-";
++ if (msg != NULL)
++ err_msg += msg;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+
+ if (pjob->ji_mutex != NULL)
+@@ -4033,9 +4035,11 @@
+ {
+ if (logging >= 20)
+ {
+- snprintf(err_msg, MSG_LEN_LONG, "ALERT: cannot lock job %s mutex in method %s",
+- pjob->ji_qs.ji_jobid, id);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "ALERT: cannot lock job ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += " mutex in method ";
++ err_msg += id;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+ rc = PBSE_MUTEX;
+ }
+@@ -4046,9 +4050,6 @@
+ log_err(rc, __func__, "Uninitialized mutex pass to pthread_mutex_lock!");
+ }
+
+- if (err_msg != NULL)
+- free(err_msg);
+-
+ return rc;
+ }
+
+@@ -4063,16 +4064,18 @@
+
+ {
+ int rc = PBSE_NONE;
+- char *err_msg = NULL;
+- char stub_msg[] = "no pos";
++ std::string err_msg;
+
+ if (logging >= 10)
+ {
+- err_msg = (char *)calloc(1, MSG_LEN_LONG);
+- if (msg == NULL)
+- msg = stub_msg;
+- snprintf(err_msg, MSG_LEN_LONG, "unlocking %s in method %s-%s", pjob->ji_qs.ji_jobid, id, msg);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "unlocking ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += " in method ";
++ err_msg += id;
++ err_msg += "-";
++ if (msg != NULL)
++ err_msg += msg;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+
+ if (pjob->ji_mutex != NULL)
+@@ -4081,9 +4084,11 @@
+ {
+ if (logging >= 20)
+ {
+- snprintf(err_msg, MSG_LEN_LONG, "ALERT: cannot unlock job %s mutex in method %s",
+- pjob->ji_qs.ji_jobid, id);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "ALERT: cannot unlock job ";
++ err_msg += pjob->ji_qs.ji_jobid;
++ err_msg += " mutex in method ";
++ err_msg += id;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+ rc = PBSE_MUTEX;
+ }
+@@ -4094,9 +4099,6 @@
+ log_err(rc, __func__, "Uninitialized mutex pass to pthread_mutex_unlock!");
+ }
+
+- if (err_msg != NULL)
+- free(err_msg);
+-
+ return rc;
+ }
+
+@@ -4110,32 +4112,33 @@
+
+ {
+ int rc = PBSE_NONE;
+- char *err_msg = NULL;
+- char stub_msg[] = "no pos";
++ std::string err_msg;
+
+ if (logging >= 10)
+ {
+- err_msg = (char *)calloc(1, MSG_LEN_LONG);
+- if (msg == NULL)
+- msg = stub_msg;
+- snprintf(err_msg, MSG_LEN_LONG, "locking %s in method %s-%s", pa->ai_qs.parent_id, id, msg);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "locking ";
++ err_msg += pa->ai_qs.parent_id,
++ err_msg += " in method ";
++ err_msg += id;
++ err_msg += "-";
++ if (msg != NULL)
++ err_msg += msg;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+
+ if (pthread_mutex_lock(pa->ai_mutex) != 0)
+ {
+ if (logging >= 20)
+ {
+- snprintf(err_msg, MSG_LEN_LONG, "ALERT: cannot lock job array %s mutex in method %s",
+- pa->ai_qs.parent_id, id);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "ALERT: cannot lock job array ";
++ err_msg += pa->ai_qs.parent_id,
++ err_msg += " mutex in method ";
++ err_msg += id;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+ rc = PBSE_MUTEX;
+ }
+
+- if (err_msg != NULL)
+- free(err_msg);
+-
+ return rc;
+ }
+
+@@ -4149,32 +4152,33 @@
+
+ {
+ int rc = PBSE_NONE;
+- char *err_msg = NULL;
+- char stub_msg[] = "no pos";
++ std::string err_msg;
+
+ if (logging >= 10)
+ {
+- err_msg = (char *)calloc(1, MSG_LEN_LONG);
+- if (msg == NULL)
+- msg = stub_msg;
+- snprintf(err_msg, MSG_LEN_LONG, "unlocking %s in method %s-%s", pa->ai_qs.parent_id, id, msg);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "unlocking ";
++ err_msg += pa->ai_qs.parent_id,
++ err_msg += " in method ";
++ err_msg += id;
++ err_msg += "-";
++ if (msg != NULL)
++ err_msg += msg;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+
+ if (pthread_mutex_unlock(pa->ai_mutex) != 0)
+ {
+ if (logging >= 20)
+ {
+- snprintf(err_msg, MSG_LEN_LONG, "ALERT: cannot unlock job array %s mutex in method %s",
+- pa->ai_qs.parent_id, id);
+- log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg);
++ err_msg = "ALERT: cannot unlock job array ";
++ err_msg += pa->ai_qs.parent_id,
++ err_msg += " mutex in method ";
++ err_msg += id;
++ log_record(PBSEVENT_DEBUG, PBS_EVENTCLASS_NODE, id, err_msg.c_str());
+ }
+ rc = PBSE_MUTEX;
+ }
+
+- if (err_msg != NULL)
+- free(err_msg);
+-
+ return rc;
+ }
+
diff --git a/sys-cluster/torque/torque-6.0.4-r1.ebuild b/sys-cluster/torque/torque-6.0.4-r1.ebuild
index bc520dc0ace3..93a88643f0d3 100644
--- a/sys-cluster/torque/torque-6.0.4-r1.ebuild
+++ b/sys-cluster/torque/torque-6.0.4-r1.ebuild
@@ -47,8 +47,10 @@ RDEPEND="${DEPEND_COMMON}
S="${WORKDIR}"/${PN}-6a0b37f85c7d644e9217cbab1542792d646f59a6
PATCHES=(
+ "${FILESDIR}"/${P}-gcc7.patch
"${FILESDIR}"/${PN}-6.0.3-fix-emptystring-comparison.patch
"${FILESDIR}"/${P}-no-openssl.patch
+ "${FILESDIR}"/${P}-error_buf_overflow_prevent.patch
)
pkg_setup() {
@@ -91,6 +93,8 @@ src_prepare() {
}
src_configure() {
+ append-cflags "-fpermissive"
+
econf \
$(use_enable tk gui) \
$(use_enable tk tcl-qstat) \
diff --git a/sys-cluster/torque/torque-6.0.4.ebuild b/sys-cluster/torque/torque-6.0.4.ebuild
deleted file mode 100644
index 42f1f078421e..000000000000
--- a/sys-cluster/torque/torque-6.0.4.ebuild
+++ /dev/null
@@ -1,177 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools flag-o-matic linux-info
-
-DESCRIPTION="Resource manager and queuing system based on OpenPBS"
-HOMEPAGE="http://www.adaptivecomputing.com/products/open-source/torque"
-SRC_URI="https://github.com/adaptivecomputing/torque/archive/6a0b37f85c7d644e9217cbab1542792d646f59a6.tar.gz -> ${P}-gh-20170829.tar.gz"
-
-LICENSE="torque-2.5"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
-IUSE="autorun cgroups cpusets +crypt doc drmaa kernel_linux libressl munge nvidia quickcommit server +syslog tk"
-
-DEPEND_COMMON="
- sys-libs/zlib
- sys-libs/readline:0=
- dev-libs/libxml2
- >=dev-libs/boost-1.41
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
- cpusets? ( sys-apps/hwloc )
- munge? ( sys-auth/munge )
- nvidia? ( >=x11-drivers/nvidia-drivers-275 )
- tk? (
- dev-lang/tk:0=
- dev-lang/tcl:0=
- )
- syslog? ( virtual/logger )
- !!games-util/qstat"
-
-# libncurses.so is only needed for configure check on readline
-DEPEND="${DEPEND_COMMON}
- sys-libs/ncurses:*
- !!sys-cluster/slurm"
-
-RDEPEND="${DEPEND_COMMON}
- crypt? ( net-misc/openssh )
- !crypt? ( net-misc/netkit-rsh )
- !dev-libs/uthash"
-
-# Torque should depend on dev-libs/uthash but that's pretty much impossible
-# to patch in as they ship with a broken configure such that files referenced
-# by the configure.ac and Makefile.am are missing.
-# http://www.supercluster.org/pipermail/torquedev/2014-October/004773.html
-
-S="${WORKDIR}"/${PN}-6a0b37f85c7d644e9217cbab1542792d646f59a6
-
-PATCHES=(
- "${FILESDIR}"/${PN}-6.0.3-fix-emptystring-comparison.patch
-)
-
-pkg_setup() {
- PBS_SERVER_HOME="${PBS_SERVER_HOME:-/var/spool/${PN}}"
-
- # Find a Torque server to use. Check environment, then
- # current setup (if any), and fall back on current hostname.
- if [ -z "${PBS_SERVER_NAME}" ]; then
- if [ -f "${ROOT}${PBS_SERVER_HOME}/server_name" ]; then
- PBS_SERVER_NAME="$(<${ROOT}${PBS_SERVER_HOME}/server_name)"
- else
- PBS_SERVER_NAME=$(hostname -f)
- fi
- fi
-
- if use cpusets || use cgroups; then
- if ! use kernel_linux; then
- einfo
- elog " Torque currently only has support for cpusets and cgroups in linux."
- elog "Assuming you didn't really want this USE flag and ignoring its state."
- einfo
- else
- linux-info_pkg_setup
- if ! linux_config_exists || ! linux_chkconfig_present CPUSETS; then
- einfo
- elog " Torque support for cpusets will require that you recompile"
- elog "your kernel with CONFIG_CPUSETS enabled."
- einfo
- fi
- fi
- fi
-}
-
-src_prepare() {
- default
- # We install to a valid location, no need to muck with ld.so.conf
- # --without-loadlibfile is supposed to do this for us...
- sed -i '/mk_default_ld_lib_file || return 1/d' buildutils/pbs_mkdirs.in || die
- eautoreconf
-}
-
-src_configure() {
- econf \
- $(use_enable tk gui) \
- $(use_enable tk tcl-qstat) \
- $(use_enable syslog) \
- $(use_enable server) \
- $(use_enable drmaa) \
- $(use_enable munge munge-auth) \
- $(use_enable nvidia nvidia-gpus) \
- $(usex crypt "--with-rcp=scp" "--with-rcp=mom_rcp") \
- $(usex kernel_linux $(use_enable cpusets cpuset) --disable-cpuset) \
- $(usex kernel_linux $(use_enable cpusets geometry-request) --disable-geometry-request) \
- $(usex kernel_linux $(use_enable cgroups) --disable-cgroups) \
- $(use_enable autorun) \
- $(use_enable quickcommit) \
- --with-server-home=${PBS_SERVER_HOME} \
- --with-environ=/etc/pbs_environment \
- --with-default-server=${PBS_SERVER_NAME} \
- --disable-gcc-warnings \
- --disable-silent-rules \
- --with-tcp-retry-limit=2 \
- --without-loadlibfile
-}
-
-src_install() {
- local dir
-
- DOCS=( CHANGELOG README.* Release_Notes )
- use doc && DOCS+=( doc/admin_guide.ps doc/*.pdf )
-
- default
-
- # The build script isn't alternative install location friendly,
- # So we have to fix some hard-coded paths in tclIndex for xpbs* to work
- for file in $(find "${ED}" -iname tclIndex); do
- sed \
- -e "s/${ED//\// }/ /" \
- -i "${file}" || die
- done
-
- for dir in $(find "${ED}/${PBS_SERVER_HOME}" -type d); do
- keepdir "${dir#${ED}}"
- done
-
- if use server; then
- newinitd "${FILESDIR}"/pbs_server-init.d-munge pbs_server
- newinitd "${FILESDIR}"/pbs_sched-init.d pbs_sched
- fi
- newinitd "${FILESDIR}"/pbs_mom-init.d-munge pbs_mom
- newconfd "${FILESDIR}"/${PN}-conf.d-munge ${PN}
- newinitd "${FILESDIR}"/trqauthd-init.d trqauthd
- newenvd "${FILESDIR}"/${PN}-env.d 25${PN}
-}
-
-pkg_preinst() {
- if [[ -f "${ROOT}etc/pbs_environment" ]]; then
- cp "${ROOT}etc/pbs_environment" "${ED}"/etc/pbs_environment || die
- fi
-
- if use server && [[ -f "${ROOT}${PBS_SERVER_HOME}/server_priv/nodes" ]]; then
- cp \
- "${EROOT}${PBS_SERVER_HOME}/server_priv/nodes" \
- "${ED}/${PBS_SERVER_HOME}/server_priv/nodes" || die
- fi
-
- echo "${PBS_SERVER_NAME}" > "${ED}${PBS_SERVER_HOME}/server_name" || die
-
- # Fix up the env.d file to use our set server home.
- sed \
- -e "s:/var/spool/${PN}:${PBS_SERVER_HOME}:g" \
- -i "${ED}"/etc/env.d/25${PN} || die
-
- if use munge; then
- sed -i 's,\(PBS_USE_MUNGE=\).*,\11,' "${ED}"/etc/conf.d/${PN} || die
- fi
-}
-
-pkg_postinst() {
- if [[ -z "${REPLACING_VERSIONS}" ]] ; then
- elog "If this is the first time torque has been installed, then you are not"
- elog "ready to start the server. Please refer to the documentation located at:"
- elog "http://docs.adaptivecomputing.com/torque/${PN//./-}/adminGuide/help.htm#topics/torque/1-installConfig/initializeConfigOnServer.htm"
- fi
-}