]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Check the return value of rename() (STR #4589)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 May 2015 21:00:19 +0000 (21:00 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 May 2015 21:00:19 +0000 (21:00 +0000)
Add some & in front of function names.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12619 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
cups/auth.c
scheduler/colorman.c
scheduler/ipp.c

index 6d521e17b7e3c2cc1e28c2010ef7a7ff78869f53..3196a0629e2af7a9994c0dbc84ce49178bf2b21e 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES.txt - 2.1b1 - 2015-02-27
+CHANGES.txt - 2.1b1 - 2015-05-06
 --------------------------------
 
 CHANGES IN CUPS V2.1b1
@@ -26,3 +26,4 @@ CHANGES IN CUPS V2.1b1
          (<rdar://problem/19024491>)
        - The cupstestppd program did not handle "maxsize(nnn)" entries in
          cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
+       - Now check the return value of rename() calls (STR #4589)
\ No newline at end of file
index 1593953d0d86f4323621996b674ef0e5739fceb2..ce9fce694c38f9f52b85e155769b8ccd9f7153ee 100644 (file)
@@ -311,7 +311,7 @@ _cupsSetNegotiateAuthString(
   * to use it...
   */
 
-  if (gss_init_sec_context == NULL)
+  if (&gss_init_sec_context == NULL)
   {
     DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
                "framework is not present");
index ec6507b6bf2ad5213f338597bd68868b2b44701f..8926212c45efa416b96631be9591a88d357c123d 100644 (file)
@@ -368,7 +368,7 @@ apple_register_profiles(
   * Make sure ColorSync is available...
   */
 
-  if (ColorSyncRegisterDevice == NULL)
+  if (&ColorSyncRegisterDevice == NULL)
     return;
 
  /*
@@ -868,7 +868,7 @@ apple_unregister_profiles(
   * Make sure ColorSync is available...
   */
 
-  if (ColorSyncUnregisterDevice != NULL)
+  if (&ColorSyncUnregisterDevice != NULL)
   {
     CFUUIDRef deviceUUID;              /* Device UUID */
 
index d775fb7ee6ae0b07ad07e3ba71ee19d71e1ed091..5b68a494eded3eff0f27ee81b0e0e43e4b132253 100644 (file)
@@ -8255,9 +8255,15 @@ print_job(cupsd_client_t  *con,          /* I - Client connection */
   if (add_file(con, job, filetype, compression))
     return;
 
-  snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id,
-           job->num_files);
-  rename(con->filename, filename);
+  snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id, job->num_files);
+  if (rename(con->filename, filename))
+  {
+    cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to rename job document file \"%s\": %s", filename, strerror(errno));
+
+    send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to rename job document file."));
+    return;
+  }
+
   cupsdClearString(&con->filename);
 
  /*
@@ -9483,9 +9489,14 @@ send_document(cupsd_client_t  *con,      /* I - Client connection */
   if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL)
     attr->values[0].integer += kbytes;
 
-  snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id,
-           job->num_files);
-  rename(con->filename, filename);
+  snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id, job->num_files);
+  if (rename(con->filename, filename))
+  {
+    cupsdLogJob(job, CUPSD_LOG_ERROR, "Unable to rename job document file \"%s\": %s", filename, strerror(errno));
+
+    send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to rename job document file."));
+    return;
+  }
 
   cupsdClearString(&con->filename);