dmlb2000 pushed to torque (el5). "Add torque-buffer-overrun.patch patch, rhbz#711463"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed Apr 8 06:03:16 UTC 2015


>From 5a5d6ce543f40bd610e430c75eeb9f6860ec34b4 Mon Sep 17 00:00:00 2001
From: Steve Traylen <steve.traylen at cern.ch>
Date: Wed, 8 Jun 2011 16:37:54 +0200
Subject: Add torque-buffer-overrun.patch patch, rhbz#711463


diff --git a/torque-buffer-overrun.patch b/torque-buffer-overrun.patch
new file mode 100644
index 0000000..58e2921
--- /dev/null
+++ b/torque-buffer-overrun.patch
@@ -0,0 +1,119 @@
+Index: src/server/req_quejob.c
+===================================================================
+--- src/server/req_quejob.c	(revision 4680)
++++ src/server/req_quejob.c	(revision 4681)
+@@ -1307,17 +1307,19 @@
+     {
+     if (errno == 0)
+       {
+-      sprintf(log_buffer, "job %s in unexpected state '%s'",
+-              pj->ji_qs.ji_jobid,
+-              PJobSubState[pj->ji_qs.ji_substate]);
++      snprintf(log_buffer, sizeof(log_buffer),
++        "job %s in unexpected state '%s'",
++        pj->ji_qs.ji_jobid,
++        PJobSubState[pj->ji_qs.ji_substate]);
+       }
+     else
+       {
+-      sprintf(log_buffer, "job %s in unexpected state '%s' (errno=%d - %s)",
+-              pj->ji_qs.ji_jobid,
+-              PJobSubState[pj->ji_qs.ji_substate],
+-              errno,
+-              strerror(errno));
++      snprintf(log_buffer, sizeof(log_buffer),
++        "job %s in unexpected state '%s' (errno=%d - %s)",
++        pj->ji_qs.ji_jobid,
++        PJobSubState[pj->ji_qs.ji_substate],
++        errno,
++        strerror(errno));
+       }
+ 
+     log_err(errno, id, log_buffer);
+@@ -1555,9 +1557,10 @@
+ 
+   if (LOGLEVEL >= 6)
+     {
+-    sprintf(log_buffer, "successfully moved file '%s' for job '%s'",
+-            namebuf,
+-            preq->rq_ind.rq_jobfile.rq_jobid);
++    snprintf(log_buffer, sizeof(log_buffer),
++      "successfully moved file '%s' for job '%s'",
++      namebuf,
++      preq->rq_ind.rq_jobfile.rq_jobid);
+ 
+     log_record(
+       PBSEVENT_JOB,
+@@ -1684,9 +1687,10 @@
+     {
+     char tmpLine[1024];
+ 
+-    sprintf(tmpLine, "cannot save job - errno=%d - %s",
+-            errno,
+-            strerror(errno));
++    snprintf(tmpLine, sizeof(tmpLine),
++      "cannot save job - errno=%d - %s",
++      errno,
++      strerror(errno));
+ 
+     log_err(errno, id, tmpLine);
+ 
+@@ -1719,9 +1723,10 @@
+     {
+     /* reply failed, purge the job and close the connection */
+ 
+-    sprintf(log_buffer, "cannot report jobid - errno=%d - %s",
+-            errno,
+-            strerror(errno));
++    snprintf(log_buffer, sizeof(log_buffer),
++      "cannot report jobid - errno=%d - %s",
++      errno,
++      strerror(errno));
+ 
+     log_err(errno, id, log_buffer);
+ 
+@@ -2026,11 +2031,12 @@
+ 
+   /* need to format message first, before request goes away */
+ 
+-  sprintf(log_buffer, msg_jobnew,
+-          preq->rq_user, preq->rq_host,
+-          pj->ji_wattr[JOB_ATR_job_owner].at_val.at_str,
+-          pj->ji_wattr[JOB_ATR_jobname].at_val.at_str,
+-          pj->ji_qhdr->qu_qs.qu_name);
++  snprintf(log_buffer, sizeof(log_buffer),
++    msg_jobnew,
++    preq->rq_user, preq->rq_host,
++    pj->ji_wattr[JOB_ATR_job_owner].at_val.at_str,
++    pj->ji_wattr[JOB_ATR_jobname].at_val.at_str,
++    pj->ji_qhdr->qu_qs.qu_name);
+ 
+   /* acknowledge the request with the job id */
+ 
+@@ -2069,8 +2075,10 @@
+     {
+     if (LOGLEVEL >= 7)
+       {
+-      sprintf(log_buffer, "Trying to AUTORUN job %s",
+-              pj->ji_qs.ji_jobid);
++      snprintf(log_buffer, sizeof(log_buffer),
++        "Trying to AUTORUN job %s",
++        pj->ji_qs.ji_jobid);
++
+       log_record(
+         PBSEVENT_JOB,
+         PBS_EVENTCLASS_JOB,
+Index: src/lib/Libnet/get_hostaddr.c
+===================================================================
+--- src/lib/Libnet/get_hostaddr.c	(revision 4680)
++++ src/lib/Libnet/get_hostaddr.c	(revision 4681)
+@@ -183,7 +183,8 @@
+ 
+   if (hp == NULL)
+     {
+-    sprintf(log_buffer,"cannot resolve IP address for host '%s' herror=%d: %s",
++    snprintf(log_buffer, sizeof(log_buffer),
++      "cannot resolve IP address for host '%s' herror=%d: %s",
+       hostname,
+       h_errno,
+       hstrerror(h_errno));
diff --git a/torque.spec b/torque.spec
index 42d2a60..b36fb2e 100644
--- a/torque.spec
+++ b/torque.spec
@@ -71,7 +71,7 @@
 
 Name:        torque
 Version:     3.0.1
-Release:     1%{?dist}
+Release:     2%{?dist}
 Summary:     Tera-scale Open-source Resource and QUEue manager
 Source0:     http://www.clusterresources.com/downloads/%{name}/%{name}-%{version}.tar.gz
 Source2:     xpbs.desktop
@@ -86,6 +86,9 @@ Source8:     config
 # Fedora approval of TORQUEv1.1
 # http://lists.fedoraproject.org/pipermail/legal/2011-February/001530.html
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=711463
+Patch0:      torque-buffer-overrun.patch
+
 License:     OpenPBS and TORQUEv1.1
 Group:       System Environment/Daemons
 URL:         http://www.clusterresources.com/products/torque/
@@ -335,6 +338,7 @@ DRMAA is "Distributed Resource Management Application API"
 
 %prep
 %setup -q -n torque-%{version}
+%patch0 
 install -pm 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \
    %{SOURCE6} %{SOURCE8} .
 # rm x bit on some documentation.
@@ -773,6 +777,9 @@ fi
 %endif
 
 %changelog
+* Wed Jun 8 2011 Steve Traylen <steve.traylen at cern.ch> - 3.0.1-2
+- Add torque-buffer-overrun.patch patch, rhbz#711463
+
 * Thu Apr 21 2011 Steve Traylen <steve.traylen at cern.ch> - 3.0.1-1
 - Update to 3.0.1.
   License file name change.
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/torque.git/commit/?h=el5&id=5a5d6ce543f40bd610e430c75eeb9f6860ec34b4


More information about the scm-commits mailing list