Add torque-buffer-overrun.patch patch, rhbz#711463

This commit is contained in:
Steve Traylen 2011-06-08 16:37:54 +02:00
parent 08215d1613
commit 5a5d6ce543
2 changed files with 127 additions and 1 deletions

119
torque-buffer-overrun.patch Normal file
View File

@ -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));

View File

@ -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@cern.ch> - 3.0.1-2
- Add torque-buffer-overrun.patch patch, rhbz#711463
* Thu Apr 21 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.1-1
- Update to 3.0.1.
License file name change.