]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 30 Jul 2003 17:04:38 +0000 (17:04 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 30 Jul 2003 17:04:38 +0000 (17:04 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3841 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
backend/ipp.c

index 8697d88570293d6bccfde0b22f5f922cfc7fa0dd..b8f86736ae51ff1babb559894cfd1cfdc17cf7de 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - The IPP backend did not correctly execute the
+         pictwpstops filter on OSX (STR #210)
        - The LPD backend did not set the banner class when the
          "banner=yes" option was specified in the device URI
          (STR #209)
index 871bf8cf3847a47cd5b5d34678cfbc42c33fabd0..1174fe578c257e4748cab9a5d2798cb9d1510e22 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.38.2.27 2003/04/16 19:36:31 mike Exp $"
+ * "$Id: ipp.c,v 1.38.2.28 2003/07/30 17:04:38 mike Exp $"
  *
  *   IPP backend for the Common UNIX Printing System (CUPS).
  *
@@ -55,6 +55,9 @@
  */
 
 static char    tmpfilename[1024] = ""; /* Temporary spool file name */
+#ifdef __APPLE__
+static char    pstmpname[1024] = "";   /* Temporary PostScript file name */
+#endif /* __APPLE__ */
 
 
 /*
@@ -98,7 +101,7 @@ const char   *password_cb(const char *);
 int            report_printer_state(ipp_t *ipp);
 
 #ifdef __APPLE__
-int            run_pictwps_filter(char **argv, char *filename, int length);
+int            run_pictwps_filter(char **argv, const char *filename);
 #endif /* __APPLE__ */
 static void    sigterm_handler(int sig);
 
@@ -633,9 +636,11 @@ main(int  argc,            /* I - Number of command-line arguments (6 or 7) */
        * so convert the document to PostScript...
        */
 
-       if (run_pictwps_filter(argv, filename, sizeof(filename)))
+       if (run_pictwps_filter(argv, filename))
          return (1);
 
+        filename = pstmpname;
+
        /*
        * Change the MIME type to application/postscript...
        */
@@ -892,12 +897,17 @@ main(int  argc,           /* I - Number of command-line arguments (6 or 7) */
     ippDelete(supported);
 
  /*
-  * Remove the temporary file if necessary...
+  * Remove the temporary file(s) if necessary...
   */
 
   if (tmpfilename[0])
     unlink(tmpfilename);
 
+#ifdef __APPLE__
+  if (pstmpname[0])
+    unlink(pstmpname);
+#endif /* __APPLE__ */
+
  /*
   * Return the queue status...
   */
@@ -1045,9 +1055,8 @@ report_printer_state(ipp_t *ipp)  /* I - IPP response */
  */
 
 int                                            /* O - Exit status of filter */
-run_pictwps_filter(char **argv,                        /* I - Command-line arguments */
-                   char *filename,             /* I - Filename buffer */
-                  int  length)                 /* I - Size of filename buffer */
+run_pictwps_filter(char       **argv,          /* I - Command-line arguments */
+                   const char *filename)       /* I - Filename */
 {
   struct stat  fileinfo;                       /* Print file information */
   const char   *ppdfile;                       /* PPD file for destination printer */
@@ -1085,7 +1094,7 @@ run_pictwps_filter(char **argv,                   /* I - Command-line arguments */
   * Then create a temporary file for printing...
   */
 
-  if ((fd = cupsTempFd(filename, length)) < 0)
+  if ((fd = cupsTempFd(pstmpname, sizeof(pstmpname))) < 0)
   {
     fprintf(stderr, "ERROR: Unable to create temporary file - %s.\n",
             strerror(errno));
@@ -1099,7 +1108,18 @@ run_pictwps_filter(char **argv,                  /* I - Command-line arguments */
   * as...
   */
 
-  stat(argv[6], &fileinfo);
+  if (argv[6])
+    stat(argv[6], &fileinfo);
+  else
+  {
+   /*
+    * Use the OSX defaults, as an up-stream filter created the PICT
+    * file...
+    */
+
+    fileinfo.st_uid = 1;
+    fileinfo.st_gid = 80;
+  }
 
   if (ppdfile)
     chown(ppdfile, fileinfo.st_uid, fileinfo.st_gid);
@@ -1132,7 +1152,7 @@ run_pictwps_filter(char **argv,                   /* I - Command-line arguments */
     }
 
     execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
-           argv[6], NULL);
+           filename, NULL);
     perror("ERROR: Unable to exec pictwpstops");
     return (errno);
   }
@@ -1203,16 +1223,21 @@ sigterm_handler(int sig)                /* I - Signal */
   (void)sig;   /* remove compiler warnings... */
 
  /*
-  * Remove the temporary file if necessary...
+  * Remove the temporary file(s) if necessary...
   */
 
   if (tmpfilename[0])
     unlink(tmpfilename);
 
+#ifdef __APPLE__
+  if (pstmpname[0])
+    unlink(pstmpname);
+#endif /* __APPLE__ */
+
   exit(1);
 }
 
 
 /*
- * End of "$Id: ipp.c,v 1.38.2.27 2003/04/16 19:36:31 mike Exp $".
+ * End of "$Id: ipp.c,v 1.38.2.28 2003/07/30 17:04:38 mike Exp $".
  */