fix memory leaks from LSPP
Resolves: RHEL-6526
This commit is contained in:
parent
600a0d705d
commit
520fa88ae2
@ -415,7 +415,7 @@ index d251abb..8afff4a 100644
|
||||
|
||||
/*
|
||||
diff --git a/scheduler/client.c b/scheduler/client.c
|
||||
index cef4115..229b308 100644
|
||||
index cef4115..e186e4c 100644
|
||||
--- a/scheduler/client.c
|
||||
+++ b/scheduler/client.c
|
||||
@@ -19,12 +19,20 @@
|
||||
@ -499,7 +499,19 @@ index cef4115..229b308 100644
|
||||
#ifdef AF_LOCAL
|
||||
if (httpAddrFamily(httpGetAddress(con->http)) == AF_LOCAL)
|
||||
{
|
||||
@@ -556,6 +617,13 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
@@ -517,6 +578,11 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */
|
||||
}
|
||||
#endif /* HAVE_AUTHORIZATION_H */
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+ if (con->scon)
|
||||
+ cupsdClearString(&con->scon);
|
||||
+#endif /* WITH_LSPP */
|
||||
+
|
||||
/*
|
||||
* Re-enable new client connections if we are going back under the
|
||||
* limit...
|
||||
@@ -556,6 +622,13 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
struct stat filestats; /* File information */
|
||||
mime_type_t *type; /* MIME type of file */
|
||||
static unsigned request_id = 0; /* Request ID for temp files */
|
||||
@ -513,7 +525,7 @@ index cef4115..229b308 100644
|
||||
|
||||
|
||||
status = HTTP_STATUS_CONTINUE;
|
||||
@@ -1675,7 +1743,73 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
@@ -1675,7 +1748,73 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
fchmod(con->file, 0640);
|
||||
fchown(con->file, RunUser, Group);
|
||||
fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC);
|
||||
@ -587,7 +599,7 @@ index cef4115..229b308 100644
|
||||
|
||||
if (httpGetState(con->http) != HTTP_STATE_POST_SEND)
|
||||
{
|
||||
@@ -3173,6 +3307,49 @@ is_path_absolute(const char *path) /* I - Input path */
|
||||
@@ -3173,6 +3312,49 @@ is_path_absolute(const char *path) /* I - Input path */
|
||||
return (1);
|
||||
}
|
||||
|
||||
@ -834,7 +846,7 @@ index bc1350e..64d57d1 100644
|
||||
|
||||
#if defined(HAVE_CDSASSL)
|
||||
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
|
||||
index 19d6608..835f52d 100644
|
||||
index 19d6608..728d164 100644
|
||||
--- a/scheduler/ipp.c
|
||||
+++ b/scheduler/ipp.c
|
||||
@@ -12,6 +12,9 @@
|
||||
@ -1092,7 +1104,7 @@ index 19d6608..835f52d 100644
|
||||
}
|
||||
}
|
||||
else if (strcmp(attr->values[0].string.text, Classification) &&
|
||||
@@ -1872,9 +2057,53 @@ add_job(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -1872,9 +2057,55 @@ add_job(cupsd_client_t *con, /* I - Client connection */
|
||||
"job-sheets=\"%s\", "
|
||||
"job-originating-user-name=\"%s\"",
|
||||
Classification, job->username);
|
||||
@ -1134,19 +1146,21 @@ index 19d6608..835f52d 100644
|
||||
+ cupsdClearString(&audit_message);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+#endif /* WITH_LSPP */
|
||||
}
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+ if (userheader)
|
||||
+ free(userheader);
|
||||
+ if (userfooter)
|
||||
+ free(userfooter);
|
||||
+#endif /* WITH_LSPP */
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
/*
|
||||
* See if we need to add the starting sheet...
|
||||
*/
|
||||
@@ -3649,6 +3878,128 @@ check_rss_recipient(
|
||||
@@ -3649,6 +3880,128 @@ check_rss_recipient(
|
||||
}
|
||||
|
||||
|
||||
@ -1275,7 +1289,7 @@ index 19d6608..835f52d 100644
|
||||
/*
|
||||
* 'check_quotas()' - Check quotas for a printer and user.
|
||||
*/
|
||||
@@ -4104,6 +4455,15 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -4104,6 +4457,15 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
char attrname[255], /* Name of attribute */
|
||||
*s; /* Pointer into name */
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
@ -1291,7 +1305,7 @@ index 19d6608..835f52d 100644
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
@@ -4139,6 +4499,85 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -4139,6 +4501,85 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
|
||||
fchmod(cupsFileNumber(out), 0640);
|
||||
fchown(cupsFileNumber(out), RunUser, Group);
|
||||
@ -1377,7 +1391,7 @@ index 19d6608..835f52d 100644
|
||||
|
||||
/*
|
||||
* Try the localized banner file under the subdirectory...
|
||||
@@ -4233,6 +4672,24 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -4233,6 +4674,24 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */
|
||||
else
|
||||
s = attrname;
|
||||
|
||||
@ -1402,7 +1416,7 @@ index 19d6608..835f52d 100644
|
||||
if (!strcmp(s, "printer-name"))
|
||||
{
|
||||
cupsFilePuts(out, job->dest);
|
||||
@@ -6443,6 +6900,22 @@ get_job_attrs(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -6443,6 +6902,22 @@ get_job_attrs(cupsd_client_t *con, /* I - Client connection */
|
||||
|
||||
exclude = cupsdGetPrivateAttrs(policy, con, printer, job->username);
|
||||
|
||||
@ -1425,7 +1439,7 @@ index 19d6608..835f52d 100644
|
||||
/*
|
||||
* Copy attributes...
|
||||
*/
|
||||
@@ -6840,6 +7313,11 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
|
||||
@@ -6840,6 +7315,11 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
|
||||
if (username[0] && _cups_strcasecmp(username, job->username))
|
||||
continue;
|
||||
|
||||
@ -1437,7 +1451,7 @@ index 19d6608..835f52d 100644
|
||||
if (count > 0)
|
||||
ippAddSeparator(con->response);
|
||||
|
||||
@@ -11441,6 +11919,11 @@ validate_user(cupsd_job_t *job, /* I - Job */
|
||||
@@ -11441,6 +11921,11 @@ validate_user(cupsd_job_t *job, /* I - Job */
|
||||
|
||||
strlcpy(username, get_username(con), userlen);
|
||||
|
||||
@ -1450,7 +1464,7 @@ index 19d6608..835f52d 100644
|
||||
* Check the username against the owner...
|
||||
*/
|
||||
diff --git a/scheduler/job.c b/scheduler/job.c
|
||||
index 834e170..6cf86df 100644
|
||||
index 834e170..dbc64c3 100644
|
||||
--- a/scheduler/job.c
|
||||
+++ b/scheduler/job.c
|
||||
@@ -8,6 +8,9 @@
|
||||
@ -1559,7 +1573,19 @@ index 834e170..6cf86df 100644
|
||||
if (Classification && !banner_page)
|
||||
{
|
||||
if ((attr = ippFindAttribute(job->attrs, "job-sheets",
|
||||
@@ -1844,6 +1922,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */
|
||||
@@ -1400,6 +1478,11 @@ cupsdDeleteJob(cupsd_job_t *job, /* I - Job */
|
||||
|
||||
cupsdClearString(&job->username);
|
||||
cupsdClearString(&job->dest);
|
||||
+
|
||||
+#ifdef WITH_LSPP
|
||||
+ cupsdClearString(&job->scon);
|
||||
+#endif
|
||||
+
|
||||
for (i = 0;
|
||||
i < (int)(sizeof(job->auth_env) / sizeof(job->auth_env[0]));
|
||||
i ++)
|
||||
@@ -1844,6 +1927,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */
|
||||
ippSetString(job->attrs, &job->reasons, 0, "none");
|
||||
}
|
||||
|
||||
@ -1582,7 +1608,7 @@ index 834e170..6cf86df 100644
|
||||
job->impressions = ippFindAttribute(job->attrs, "job-impressions-completed", IPP_TAG_INTEGER);
|
||||
job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER);
|
||||
job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME);
|
||||
@@ -2259,6 +2353,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - Job */
|
||||
@@ -2259,6 +2358,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - Job */
|
||||
{
|
||||
char filename[1024]; /* Job control filename */
|
||||
cups_file_t *fp; /* Job file */
|
||||
@ -1597,7 +1623,7 @@ index 834e170..6cf86df 100644
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p",
|
||||
@@ -2281,6 +2383,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - Job */
|
||||
@@ -2281,6 +2388,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - Job */
|
||||
|
||||
fchown(cupsFileNumber(fp), RunUser, Group);
|
||||
|
||||
@ -1676,7 +1702,7 @@ index 834e170..6cf86df 100644
|
||||
job->attrs->state = IPP_IDLE;
|
||||
|
||||
if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL,
|
||||
@@ -3981,6 +4155,19 @@ get_options(cupsd_job_t *job, /* I - Job */
|
||||
@@ -3981,6 +4160,19 @@ get_options(cupsd_job_t *job, /* I - Job */
|
||||
banner_page)
|
||||
continue;
|
||||
|
||||
@ -1696,7 +1722,7 @@ index 834e170..6cf86df 100644
|
||||
/*
|
||||
* Otherwise add them to the list...
|
||||
*/
|
||||
@@ -4791,6 +4978,18 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
@@ -4791,6 +4983,18 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
cupsd_printer_t *printer) /* I - Printer to print job */
|
||||
{
|
||||
const char *filename; /* Support filename */
|
||||
@ -1715,7 +1741,7 @@ index 834e170..6cf86df 100644
|
||||
ipp_attribute_t *cancel_after = ippFindAttribute(job->attrs,
|
||||
"job-cancel-after",
|
||||
IPP_TAG_INTEGER);
|
||||
@@ -4979,6 +5178,113 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
@@ -4979,6 +5183,113 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
fcntl(job->side_pipes[1], F_SETFD,
|
||||
fcntl(job->side_pipes[1], F_GETFD) | FD_CLOEXEC);
|
||||
|
||||
|
@ -864,6 +864,7 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%changelog
|
||||
* Thu Aug 15 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-30
|
||||
- RHEL-6526 cups source rpm doesn't actually build lspp support
|
||||
- fix memory leaks from LSPP
|
||||
|
||||
* Wed Jun 19 2024 Pavol Zacik <pzacik@redhat.com> - 1:2.3.3op2-29
|
||||
- Revert the cups-libs license identifier to the "legacy" format
|
||||
|
Loading…
Reference in New Issue
Block a user