Add torque-buffer-overrun.patch rhbz#711463

This commit is contained in:
Steve Traylen 2011-06-08 19:10:05 +02:00
parent f463b40067
commit ef7485e5d6
2 changed files with 180 additions and 1 deletions

View File

@ -0,0 +1,173 @@
diff -uNr torque-2.5.5.ORIG/src/lib/Libnet/get_hostaddr.c torque-2.5.5/src/lib/Libnet/get_hostaddr.c
--- torque-2.5.5.ORIG/src/lib/Libnet/get_hostaddr.c 2011-06-08 18:40:00.251913002 +0200
+++ torque-2.5.5/src/lib/Libnet/get_hostaddr.c 2011-06-08 18:41:06.651911946 +0200
@@ -147,7 +147,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 -uNr torque-2.5.5.ORIG/src/server/req_quejob.c torque-2.5.5/src/server/req_quejob.c
--- torque-2.5.5.ORIG/src/server/req_quejob.c 2011-06-08 18:40:00.315913002 +0200
+++ torque-2.5.5/src/server/req_quejob.c 2011-06-08 18:49:36.449912391 +0200
@@ -1053,17 +1053,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);
@@ -1264,9 +1266,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,
@@ -1382,9 +1385,11 @@
{
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);
@@ -1408,9 +1413,11 @@
{
/* 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);
@@ -1700,11 +1707,12 @@
/* need to format message first, before request goes away */
- sprintf(log_buffer, msg_jobnew,
- preq->rq_user, preq->rq_host,
- pj->ji_wattr[(int)JOB_ATR_job_owner].at_val.at_str,
- pj->ji_wattr[(int)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 */
@@ -1739,8 +1747,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,
@@ -1861,7 +1871,7 @@
if (!user_account_read_user(arguser))
{
- sprintf(log_buffer, "user_account_verify(%s, %s) -> USER NOT FOUND",
+ snprintf(log_buffer,sizeof(log_buffer), "user_account_verify(%s, %s) -> USER NOT FOUND",
arguser,
argaccount);
@@ -1872,7 +1882,7 @@
{
if (strcmp(argaccount, UserAcct.ActAdr[i]) == 0)
{
- sprintf(log_buffer, "user_account_verify(%s, %s) -> SUCCESS",
+ snprintf(log_buffer,sizeof(log_buffer), "user_account_verify(%s, %s) -> SUCCESS",
arguser,
argaccount);
@@ -1882,7 +1892,7 @@
}
} /* END for (i) */
- sprintf(log_buffer, "user_account_verify(%s, %s) -> FAILED",
+ snprintf(log_buffer, sizeof(log_buffer) "user_account_verify(%s, %s) -> FAILED",
arguser,
argaccount);
@@ -1909,7 +1919,7 @@
if (!user_account_read_user(arguser))
{
- sprintf(log_buffer, "user_account_default(%s) = USER NOT FOUND",
+ snprintf(log_buffer,sizeof(log_buffer), "user_account_default(%s) = USER NOT FOUND",
arguser);
goto user_account_default_done;
@@ -1917,7 +1927,7 @@
if (UserAcct.ActCnt < 1)
{
- sprintf(log_buffer, "user_account_default(%s) = NO PROJECT FOUND",
+ snprintf(log_buffer, sizeof(log_buffer), "user_account_default(%s) = NO PROJECT FOUND",
arguser);
goto user_account_default_done;
@@ -1925,7 +1935,7 @@
rc = UserAcct.ActAdr[0];
- sprintf(log_buffer, "user_account_default(%s) = %s",
+ snprintf(log_buffer, sizeof(log_buffer), "user_account_default(%s) = %s",
arguser,
rc);

View File

@ -68,7 +68,7 @@
Name: torque
Version: 2.5.5
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
@ -77,6 +77,8 @@ Source4: xpbs.png
Source5: xpbsmon.png
Source6: README.Fedora
Source8: config
# https://bugzilla.redhat.com/show_bug.cgi?id=711463
Patch0: torque-buffer-overrun-2.5.5.patch
License: OpenPBS and TORQUEv1.1
Group: System Environment/Daemons
@ -328,6 +330,7 @@ DRMAA is "Distributed Resource Management Application API"
%prep
%setup -q
%%patch0 -p1
install -pm 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \
%{SOURCE6} %{SOURCE8} .
# rm x bit on some documentation.
@ -767,6 +770,9 @@ fi
%endif
%changelog
* Wed Jun 11 2011 Steve Traylen <steve.traylen@cern.ch> - 2.5.5-2
- Add torque-buffer-overrun.patch rhbz#711463
* Tue Mar 8 2011 Steve Traylen <steve.traylen@cern.ch> - 2.5.5-1
- New upstream 2.5.5
Drop torque-create-request.patch since fixed upstream.