]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 20 Jul 2003 12:51:55 +0000 (12:51 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 20 Jul 2003 12:51:55 +0000 (12:51 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3817 7a7537e8-13f0-0310-91df-b6672ffda945

16 files changed:
CHANGES-1.1.txt
berkeley/lpc.c
cups/cups.h
cups/language.c
cups/options.c
cups/ppd.c
cups/string.c
cups/string.h
scheduler/client.c
scheduler/conf.c
scheduler/dirsvc.c
scheduler/ipp.c
scheduler/job.c
scheduler/ppds.c
scheduler/printers.c
test/run-stp-tests.sh

index 59ef565c87c13f5ebd1914c35d08fe8e43295b0c..8ba79508a23775f32bb58858238990ce2e0dc64f 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - Added support for live testing with Valgrind (STR
+         #193)
        - The CGI programs now collect the list of needed
          attributes for the class, job, and printer template
          files (STR #192)
index af59bcdce662123a2e32621f5695729fa90e3da5..5f43330d908b2f38e1ffa86e826232323ef73f3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: lpc.c,v 1.11.2.6 2003/01/07 18:26:17 mike Exp $"
+ * "$Id: lpc.c,v 1.11.2.7 2003/07/20 12:51:39 mike Exp $"
  *
  *   "lpc" command for the Common UNIX Printing System (CUPS).
  *
@@ -99,7 +99,7 @@ main(int  argc,               /* I - Number of command-line arguments */
       */
 
       while (isspace(line[0]))
-        strcpy(line, line + 1);
+        cups_strcpy(line, line + 1);
 
       for (params = line; *params != '\0'; params ++)
         if (isspace(*params))
@@ -477,5 +477,5 @@ show_status(http_t *http,   /* I - HTTP connection to server */
 
 
 /*
- * End of "$Id: lpc.c,v 1.11.2.6 2003/01/07 18:26:17 mike Exp $".
+ * End of "$Id: lpc.c,v 1.11.2.7 2003/07/20 12:51:39 mike Exp $".
  */
index 76e52fa57e92628842c08a998be9f78d850f3b0a..f2ef09596d873e7f5b18bcbcdf822639634b7237 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups.h,v 1.32.2.10 2003/06/11 23:17:27 mike Exp $"
+ * "$Id: cups.h,v 1.32.2.11 2003/07/20 12:51:40 mike Exp $"
  *
  *   API definitions for the Common UNIX Printing System (CUPS).
  *
@@ -170,6 +170,7 @@ extern void         cupsSetServer(const char *server);
 extern void            cupsSetUser(const char *user);
 extern const char      *cupsUser(void);
 
+
 #  ifdef __cplusplus
 }
 #  endif /* __cplusplus */
@@ -177,5 +178,5 @@ extern const char   *cupsUser(void);
 #endif /* !_CUPS_CUPS_H_ */
 
 /*
- * End of "$Id: cups.h,v 1.32.2.10 2003/06/11 23:17:27 mike Exp $".
+ * End of "$Id: cups.h,v 1.32.2.11 2003/07/20 12:51:40 mike Exp $".
  */
index 5977d97f8dab6120a82bed3db4404ab96844a0cc..b39aa86eea026c1532f166fbc48d42be1a121136 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: language.c,v 1.20.2.23 2003/07/20 01:39:58 mike Exp $"
+ * "$Id: language.c,v 1.20.2.24 2003/07/20 12:51:40 mike Exp $"
  *
  *   I18N/language support for the Common UNIX Printing System (CUPS).
  *
@@ -52,6 +52,7 @@
 #endif /* WIN32 */
 #include "string.h"
 #include "language.h"
+#include "debug.h"
 
 
 /*
@@ -645,6 +646,9 @@ void
 _cupsRestoreLocale(int  category,      /* I - Category */
                    char *oldlocale)    /* I - Old locale or NULL */
 {
+  DEBUG_printf(("_cupsRestoreLocale(category=%d, oldlocale=\"%s\")\n",
+                category, oldlocale));
+
   if (oldlocale)
   {
    /*
@@ -668,6 +672,9 @@ _cupsSaveLocale(int        category,        /* I - Category */
   char *oldlocale;                     /* Old locale */
 
 
+  DEBUG_printf(("_cupsSaveLocale(category=%d, locale=\"%s\")\n",
+                category, locale));
+
   if ((oldlocale = setlocale(category, locale)) != NULL)
     return (strdup(oldlocale));
   else
@@ -859,5 +866,5 @@ cups_cache_lookup(const char      *name,/* I - Name of locale */
 
 
 /*
- * End of "$Id: language.c,v 1.20.2.23 2003/07/20 01:39:58 mike Exp $".
+ * End of "$Id: language.c,v 1.20.2.24 2003/07/20 12:51:40 mike Exp $".
  */
index ebf3807f1e385f5abdc6343503348d9902863762..ecdf9e390910b0d5dc72710c651188991db9d63f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: options.c,v 1.21.2.9 2003/03/21 18:07:34 mike Exp $"
+ * "$Id: options.c,v 1.21.2.10 2003/07/20 12:51:41 mike Exp $"
  *
  *   Option routines for the Common UNIX Printing System (CUPS).
  *
@@ -244,7 +244,7 @@ cupsParseOptions(const char    *arg,                /* I - Argument to parse */
       while (*ptr != '\'' && *ptr != '\0')
       {
         if (*ptr == '\\')
-         strcpy(ptr, ptr + 1);
+         cups_strcpy(ptr, ptr + 1);
 
         ptr ++;
       }
@@ -264,7 +264,7 @@ cupsParseOptions(const char    *arg,                /* I - Argument to parse */
       while (*ptr != '\"' && *ptr != '\0')
       {
         if (*ptr == '\\')
-         strcpy(ptr, ptr + 1);
+         cups_strcpy(ptr, ptr + 1);
 
         ptr ++;
       }
@@ -297,7 +297,7 @@ cupsParseOptions(const char    *arg,                /* I - Argument to parse */
          }
         }
         else if (*ptr == '\\')
-         strcpy(ptr, ptr + 1);
+         cups_strcpy(ptr, ptr + 1);
 
       if (*ptr != '\0')
         *ptr++ = '\0';
@@ -313,7 +313,7 @@ cupsParseOptions(const char    *arg,                /* I - Argument to parse */
       while (!isspace(*ptr) && *ptr != '\0')
       {
         if (*ptr == '\\')
-         strcpy(ptr, ptr + 1);
+         cups_strcpy(ptr, ptr + 1);
 
         ptr ++;
       }
@@ -495,5 +495,5 @@ cupsMarkOptions(ppd_file_t    *ppd,         /* I - PPD file */
 
 
 /*
- * End of "$Id: options.c,v 1.21.2.9 2003/03/21 18:07:34 mike Exp $".
+ * End of "$Id: options.c,v 1.21.2.10 2003/07/20 12:51:41 mike Exp $".
  */
index f33ace590059de90b92832dfd205af53bd839f01..a719bb3f6abb7232c1662b619b540e3c1466a181 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.55 2003/07/20 01:33:11 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.56 2003/07/20 12:51:41 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -117,7 +117,7 @@ static void         ppd_decode(char *string);
 #ifndef __APPLE__
 static void            ppd_fix(char *string);
 #else
-#  define ppd_fix(s)
+#  define              ppd_fix(s)
 #endif /* !__APPLE__ */
 static void            ppd_free_group(ppd_group_t *group);
 static void            ppd_free_option(ppd_option_t *option);
@@ -217,14 +217,18 @@ ppdClose(ppd_file_t *ppd)         /* I - PPD file record */
   */
 
   if (ppd->num_sizes > 0)
+  {
     ppd_free(ppd->sizes);
+  }
 
  /*
   * Free any constraints...
   */
 
   if (ppd->num_consts > 0)
+  {
     ppd_free(ppd->consts);
+  }
 
  /*
   * Free any filters...
@@ -233,7 +237,9 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
   if (ppd->num_filters > 0)
   {
     for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
+    {
       ppd_free(*filter);
+    }
 
     ppd_free(ppd->filters);
   }
@@ -245,7 +251,9 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
   if (ppd->num_fonts > 0)
   {
     for (i = ppd->num_fonts, font = ppd->fonts; i > 0; i --, font ++)
+    {
       ppd_free(*font);
+    }
 
     ppd_free(ppd->fonts);
   }
@@ -255,7 +263,9 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
   */
 
   if (ppd->num_profiles > 0)
+  {
     ppd_free(ppd->profiles);
+  }
 
  /*
   * Free any attributes...
@@ -889,6 +899,7 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
 
       choice->code = string;
       option       = NULL;
+      string       = NULL;             /* Don't add as an attribute below */
     }
     else if (strcmp(keyword, "LandscapeOrientation") == 0)
     {
@@ -984,7 +995,7 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
       */
 
       if (name[0] == '*')
-        strcpy(name, name + 1); /* Eliminate leading asterisk */
+        cups_strcpy(name, name + 1); /* Eliminate leading asterisk */
 
       for (i = strlen(name) - 1; i > 0 && isspace(name[i]); i --)
         name[i] = '\0'; /* Eliminate trailing spaces */
@@ -1120,7 +1131,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       */
 
       if (name[0] == '*')
-        strcpy(name, name + 1);
+        cups_strcpy(name, name + 1);
 
       option = ppd_get_option(group, name);
 
@@ -1239,7 +1250,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       }
 
       if (keyword[0] == '*')
-        strcpy(keyword, keyword + 1);
+        cups_strcpy(keyword, keyword + 1);
 
       if (strcmp(name, "ExitServer") == 0)
         section = PPD_ORDER_EXIT;
@@ -1384,12 +1395,12 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
            */
 
            if (constraint->option1[0] == '*')
-             strcpy(constraint->option1, constraint->option1 + 1);
+             cups_strcpy(constraint->option1, constraint->option1 + 1);
 
            if (constraint->choice1[0] == '*')
-             strcpy(constraint->option2, constraint->choice1 + 1);
+             cups_strcpy(constraint->option2, constraint->choice1 + 1);
            else
-             strcpy(constraint->option2, constraint->choice1);
+             cups_strcpy(constraint->option2, constraint->choice1);
 
             constraint->choice1[0] = '\0';
             constraint->choice2[0] = '\0';
@@ -1397,23 +1408,23 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
            
        case 3 : /* Two options, one choice... */
           /*
-           * The following strcpy's are safe, as optionN and
+           * The following cups_strcpy's are safe, as optionN and
            * choiceN are all the same size (size defined by PPD spec...)
            */
 
            if (constraint->option1[0] == '*')
-             strcpy(constraint->option1, constraint->option1 + 1);
+             cups_strcpy(constraint->option1, constraint->option1 + 1);
 
            if (constraint->choice1[0] == '*')
            {
-             strcpy(constraint->choice2, constraint->option2);
-             strcpy(constraint->option2, constraint->choice1 + 1);
+             cups_strcpy(constraint->choice2, constraint->option2);
+             cups_strcpy(constraint->option2, constraint->choice1 + 1);
               constraint->choice1[0] = '\0';
            }
            else
            {
              if (constraint->option2[0] == '*')
-               strcpy(constraint->option2, constraint->option2 + 1);
+               cups_strcpy(constraint->option2, constraint->option2 + 1);
 
               constraint->choice2[0] = '\0';
            }
@@ -1421,10 +1432,10 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
            
        case 4 : /* Two options, two choices... */
            if (constraint->option1[0] == '*')
-             strcpy(constraint->option1, constraint->option1 + 1);
+             cups_strcpy(constraint->option1, constraint->option1 + 1);
 
            if (constraint->option2[0] == '*')
-             strcpy(constraint->option2, constraint->option2 + 1);
+             cups_strcpy(constraint->option2, constraint->option2 + 1);
            break;
       }
 
@@ -1513,7 +1524,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
         ppd_decode(string);            /* Decode quoted string */
 
       choice->code = string;
-      string = NULL;                   /* Don't add as an attribute below */
+      string       = NULL;             /* Don't add as an attribute below */
     }
 #if 0
     else if (strcmp(keyword, "cupsUIType") == 0 &&
@@ -1738,7 +1749,9 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
         (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING))
       ppd_add_attr(ppd, keyword, name, text, string);
     else
+    {
       ppd_free(string);
+    }
   }
 
  /*
@@ -1778,7 +1791,8 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
   if ((option = ppdFindOption(ppd, "InputSlot")) != NULL)
   {
     for (i = 0; i < option->num_choices; i ++)
-      if (option->choices[i].code == NULL || !option->choices[i].code[0])
+      if (option->choices[i].code == NULL || !option->choices[i].code[0] ||
+          !strncasecmp(option->choices[i].choice, "Auto", 4))
        break;
 
     if (i >= option->num_choices)
@@ -2291,7 +2305,9 @@ ppd_free_option(ppd_option_t *option)     /* I - Option to free */
     for (i = option->num_choices, choice = option->choices;
          i > 0;
          i --, choice ++)
+    {
       ppd_free(choice->code);
+    }
 
     ppd_free(option->choices);
   }
@@ -2933,5 +2949,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.55 2003/07/20 01:33:11 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.56 2003/07/20 12:51:41 mike Exp $".
  */
index b6236edf34c086817ce81a477a6791ca180f1945..b5f805c78b974bf6e6c9061f288b657f6cd4ea55 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: string.c,v 1.5.2.7 2003/01/07 18:26:30 mike Exp $"
+ * "$Id: string.c,v 1.5.2.8 2003/07/20 12:51:42 mike Exp $"
  *
  *   String functions for the Common UNIX Printing System (CUPS).
  *
@@ -25,6 +25,7 @@
  *
  * Contents:
  *
+ *   cups_strcpy()      - Copy a string allowing for overlapping strings.
  *   cups_strdup()      - Duplicate a string.
  *   cups_strcasecmp()  - Do a case-insensitive comparison.
  *   cups_strncasecmp() - Do a case-insensitive comparison on up to N chars.
 #include "string.h"
 
 
+/*
+ * 'cups_strcpy()' - Copy a string allowing for overlapping strings.
+ */
+
+void
+cups_strcpy(char       *dst,           /* I - Destination string */
+            const char *src)           /* I - Source string */
+{
+  while (*src)
+    *dst++ = *src++;
+
+  *dst = '\0';
+}
+
+
 /*
  * 'cups_strdup()' - Duplicate a string.
  */
@@ -206,5 +222,5 @@ cups_strlcpy(char       *dst,       /* O - Destination string */
 
 
 /*
- * End of "$Id: string.c,v 1.5.2.7 2003/01/07 18:26:30 mike Exp $".
+ * End of "$Id: string.c,v 1.5.2.8 2003/07/20 12:51:42 mike Exp $".
  */
index 1b5798e71c7ed6b641df4f66b804cc693033d0be..ce01fecccc87ff44f28a9eb9a6f0fab556b69312 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: string.h,v 1.7.2.10 2003/01/07 18:26:30 mike Exp $"
+ * "$Id: string.h,v 1.7.2.11 2003/07/20 12:51:43 mike Exp $"
  *
  *   String definitions for the Common UNIX Printing System (CUPS).
  *
@@ -73,6 +73,8 @@ extern "C" {
  * Prototypes...
  */
 
+extern void    cups_strcpy(char *dst, const char *src);
+
 #  ifndef HAVE_STRDUP
 extern char    *cups_strdup(const char *);
 #    define strdup cups_strdup
@@ -124,5 +126,5 @@ extern int  cups_vsnprintf(char *, size_t, const char *, va_list);
 #endif /* !_CUPS_STRING_H_ */
 
 /*
- * End of "$Id: string.h,v 1.7.2.10 2003/01/07 18:26:30 mike Exp $".
+ * End of "$Id: string.h,v 1.7.2.11 2003/07/20 12:51:43 mike Exp $".
  */
index 27a3331b8c30e2f969d17d236c121f6ce5124e00..16db863564031b76b01e108cdf2f47490e2176af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.91.2.64 2003/07/20 03:13:08 mike Exp $"
+ * "$Id: client.c,v 1.91.2.65 2003/07/20 12:51:43 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -508,7 +508,7 @@ CloseClient(client_t *con)  /* I - Client to close */
   NumClients --;
 
   if (con < (Clients + NumClients))
-    memcpy(con, con + 1, (Clients + NumClients - con) * sizeof(client_t));
+    memmove(con, con + 1, (Clients + NumClients - con) * sizeof(client_t));
 }
 
 
@@ -1255,7 +1255,7 @@ ReadClient(client_t *con) /* I - Client to read from */
              }
 
              if (con->options[0] == '/')
-               strcpy(con->options, con->options + 1);
+               cups_strcpy(con->options, con->options + 1);
 
               if (!SendCommand(con, con->command, con->options))
              {
@@ -1429,7 +1429,7 @@ ReadClient(client_t *con) /* I - Client to read from */
              }
 
              if (con->options[0] == '/')
-               strcpy(con->options, con->options + 1);
+               cups_strcpy(con->options, con->options + 1);
 
               LogMessage(L_DEBUG2, "ReadClient() %d command=\"%s\", options = \"%s\"",
                         con->http.fd, con->command, con->options);
@@ -2941,7 +2941,8 @@ pipe_command(client_t *con,               /* I - Client connection */
                script_name[1024],      /* SCRIPT_NAME environment variable */
                server_name[1024],      /* SERVER_NAME environment variable */
                server_port[1024],      /* SERVER_PORT environment variable */
-               tmpdir[1024];           /* TMPDIR environment variable */
+               tmpdir[1024],           /* TMPDIR environment variable */
+               vg_args[1024];          /* VG_ARGS environment variable */
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* POSIX signal handler */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -2988,7 +2989,7 @@ pipe_command(client_t *con,               /* I - Client connection */
       else
         *commptr |= tolower(commptr[2]) - 'a' + 10;
 
-      strcpy(commptr + 1, commptr + 3);
+      cups_strcpy(commptr + 1, commptr + 3);
     }
     else if (*commptr == '?')
       break;
@@ -3039,6 +3040,7 @@ pipe_command(client_t *con,               /* I - Client connection */
   else
     envp[envc ++] = "SERVER_PROTOCOL=HTTP/0.9";
   envp[envc ++] = "REDIRECT_STATUS=1";
+  envp[envc ++] = "CUPS_SERVER=localhost";
   envp[envc ++] = ipp_port;
   envp[envc ++] = server_name;
   envp[envc ++] = server_port;
@@ -3051,6 +3053,12 @@ pipe_command(client_t *con,              /* I - Client connection */
   envp[envc ++] = cups_datadir;
   envp[envc ++] = cups_serverroot;
 
+  if (getenv("VG_ARGS") != NULL)
+  {
+    snprintf(vg_args, sizeof(vg_args), "VG_ARGS=%s", getenv("VG_ARGS"));
+    envp[envc ++] = vg_args;
+  }
+
   if (getenv("LD_LIBRARY_PATH") != NULL)
   {
     snprintf(ld_library_path, sizeof(ld_library_path), "LD_LIBRARY_PATH=%s",
@@ -3347,5 +3355,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.91.2.64 2003/07/20 03:13:08 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.65 2003/07/20 12:51:43 mike Exp $".
  */
index 05c51eb0de8c3931c20474abf75c7cc3382c52b3..5e81a0f9033ee18d3b595548ed435abdd4ba1f11 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: conf.c,v 1.77.2.41 2003/07/20 03:13:09 mike Exp $"
+ * "$Id: conf.c,v 1.77.2.42 2003/07/20 12:51:45 mike Exp $"
  *
  *   Configuration routines for the Common UNIX Printing System (CUPS).
  *
@@ -880,6 +880,8 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
       Listeners = temp;
       temp      += NumListeners;
 
+      memset(temp, 0, sizeof(listener_t));
+
       if (get_address(value, INADDR_ANY, IPP_PORT, AF_INET, &(temp->address)))
       {
         httpAddrString(&(temp->address), line, sizeof(line));
@@ -2293,5 +2295,5 @@ CDSAGetServerCerts(void)
 
 
 /*
- * End of "$Id: conf.c,v 1.77.2.41 2003/07/20 03:13:09 mike Exp $".
+ * End of "$Id: conf.c,v 1.77.2.42 2003/07/20 12:51:45 mike Exp $".
  */
index 4cb18375960ccb1a9398f5cc56af3b652d3950c7..8922efd482df0cac23a78068dce3368ba8146873 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dirsvc.c,v 1.73.2.34 2003/07/19 22:13:53 mike Exp $"
+ * "$Id: dirsvc.c,v 1.73.2.35 2003/07/20 12:51:46 mike Exp $"
  *
  *   Directory services routines for the Common UNIX Printing System (CUPS).
  *
@@ -1409,7 +1409,7 @@ UpdatePolling(void)
     * Copy over the buffer data we've used up...
     */
 
-    strcpy(buffer, lineptr);
+    cups_strcpy(buffer, lineptr);
     bufused -= lineptr - buffer;
 
     if (bufused < 0)
@@ -1708,7 +1708,7 @@ GetSlpAttrVal(const char *attrlist,       /* I - Attribute list string */
 
        for (ptr1 = valbuf; *ptr1; ptr1 ++)
          if (*ptr1 == '\\' && ptr1[1])
-           strcpy(ptr1, ptr1 + 1);
+           cups_strcpy(ptr1, ptr1 + 1);
 
         return (0);
       }
@@ -1942,5 +1942,5 @@ UpdateSLPBrowse(void)
 
 
 /*
- * End of "$Id: dirsvc.c,v 1.73.2.34 2003/07/19 22:13:53 mike Exp $".
+ * End of "$Id: dirsvc.c,v 1.73.2.35 2003/07/20 12:51:46 mike Exp $".
  */
index 93d6c3af6176c922628ee58d0c8bfa60f7bbe986..375cc62f657030ef77772a2ec7ee392c62f8d3fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.127.2.70 2003/05/13 14:50:54 mike Exp $"
+ * "$Id: ipp.c,v 1.127.2.71 2003/07/20 12:51:47 mike Exp $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -2668,10 +2668,18 @@ copy_model(const char *from,            /* I - Source file */
   */
 
   if ((src = cupsFileOpen(from, "rb")) == NULL)
+  {
+    if (num_defaults > 0)
+      free(defaults);
+
     return (-1);
+  }
 
   if ((dst = cupsFileOpen(to, "wb")) == NULL)
   {
+    if (num_defaults > 0)
+      free(defaults);
+
     cupsFileClose(src);
     return (-1);
   }
@@ -2711,6 +2719,9 @@ copy_model(const char *from,              /* I - Source file */
   if (cups_protocol[0])
     cupsFilePrintf(dst, "%s\n", cups_protocol);
 
+  if (num_defaults > 0)
+    free(defaults);
+
  /*
   * Close both files and return...
   */
@@ -6741,5 +6752,5 @@ validate_user(client_t   *con,            /* I - Client connection */
 
 
 /*
- * End of "$Id: ipp.c,v 1.127.2.70 2003/05/13 14:50:54 mike Exp $".
+ * End of "$Id: ipp.c,v 1.127.2.71 2003/07/20 12:51:47 mike Exp $".
  */
index fa75a0f6c2266f5e95a1fd4fee430e83f41eb925..54594d94d2abdc3266d3ca025c1bacf6467908c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c,v 1.124.2.75 2003/07/20 02:34:27 mike Exp $"
+ * "$Id: job.c,v 1.124.2.76 2003/07/20 12:51:51 mike Exp $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -1198,6 +1198,7 @@ StartJob(int       id,                    /* I - Job ID */
                processPath[1050],      /* CFProcessPath environment variable */
 #endif /* __APPLE__ */
                path[1024],             /* PATH environment variable */
+               ipp_port[1024],         /* IPP_PORT environment variable */
                language[255],          /* LANG environment variable */
                charset[255],           /* CHARSET environment variable */
                classification[1024],   /* CLASSIFICATION environment variable */
@@ -1215,7 +1216,8 @@ StartJob(int       id,                    /* I - Job ID */
                shlib_path[1024],       /* SHLIB_PATH environment variable */
                nlspath[1024],          /* NLSPATH environment variable */
                datadir[1024],          /* CUPS_DATADIR environment variable */
-               fontpath[1050];         /* CUPS_FONTPATH environment variable */
+               fontpath[1050],         /* CUPS_FONTPATH environment variable */
+               vg_args[1024];          /* VG_ARGS environment variable */
   static char  *options = NULL;        /* Full list of options */
   static int   optlength = 0;          /* Length of option buffer */
 
@@ -1707,6 +1709,7 @@ StartJob(int       id,                    /* I - Job ID */
   snprintf(tmpdir, sizeof(tmpdir), "TMPDIR=%s", TempDir);
   snprintf(datadir, sizeof(datadir), "CUPS_DATADIR=%s", DataDir);
   snprintf(fontpath, sizeof(fontpath), "CUPS_FONTPATH=%s", FontPath);
+  sprintf(ipp_port, "IPP_PORT=%d", LocalPort);
 
   envc = 0;
 
@@ -1715,7 +1718,8 @@ StartJob(int       id,                    /* I - Job ID */
   envp[envc ++] = "USER=root";
   envp[envc ++] = charset;
   envp[envc ++] = language;
-  envp[envc ++] = TZ;
+  if (TZ && TZ[0])
+    envp[envc ++] = TZ;
   envp[envc ++] = ppd;
   envp[envc ++] = root;
   envp[envc ++] = cache;
@@ -1725,6 +1729,14 @@ StartJob(int       id,                   /* I - Job ID */
   envp[envc ++] = printer_name;
   envp[envc ++] = datadir;
   envp[envc ++] = fontpath;
+  envp[envc ++] = "CUPS_SERVER=localhost";
+  envp[envc ++] = ipp_port;
+
+  if (getenv("VG_ARGS") != NULL)
+  {
+    snprintf(vg_args, sizeof(vg_args), "VG_ARGS=%s", getenv("VG_ARGS"));
+    envp[envc ++] = vg_args;
+  }
 
   if (getenv("LD_LIBRARY_PATH") != NULL)
   {
@@ -2360,7 +2372,7 @@ UpdateJob(job_t *job)             /* I - Job to check */
     * Copy over the buffer data we've used up...
     */
 
-    strcpy(job->buffer, lineptr);
+    cups_strcpy(job->buffer, lineptr);
     job->bufused -= lineptr - job->buffer;
 
     if (job->bufused < 0)
@@ -2791,5 +2803,5 @@ start_process(const char *command,        /* I - Full path to command */
 
 
 /*
- * End of "$Id: job.c,v 1.124.2.75 2003/07/20 02:34:27 mike Exp $".
+ * End of "$Id: job.c,v 1.124.2.76 2003/07/20 12:51:51 mike Exp $".
  */
index eef9a00aa257d878d3edf5ebf6a9da87508e8760..e1924970e47a33083733c5213d920e8d8061ca72 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppds.c,v 1.14.2.10 2003/03/30 20:01:48 mike Exp $"
+ * "$Id: ppds.c,v 1.14.2.11 2003/07/20 12:51:53 mike Exp $"
  *
  *   PPD scanning routines for the Common UNIX Printing System (CUPS).
  *
@@ -589,7 +589,7 @@ load_ppds(const char *d,            /* I - Actual directory */
       strcpy(make_model, model_name);
 
     while (isspace(make_model[0]))
-      strcpy(make_model, make_model + 1);
+      cups_strcpy(make_model, make_model + 1);
 
     if (!make_model[0])
       continue;        /* Nope... */
@@ -599,7 +599,7 @@ load_ppds(const char *d,            /* I - Actual directory */
     */
 
     while (isspace(manufacturer[0]))
-      strcpy(manufacturer, manufacturer + 1);
+      cups_strcpy(manufacturer, manufacturer + 1);
 
     if (!manufacturer[0] || strcmp(manufacturer, "ESP") == 0)
     {
@@ -670,7 +670,7 @@ load_ppds(const char *d,            /* I - Actual directory */
       */
 
       country[0] = '_';
-      strcpy(country + 1, ptr);
+      cups_strcpy(country + 1, ptr);
     }
     else
     {
@@ -781,5 +781,5 @@ load_ppds(const char *d,            /* I - Actual directory */
 
 
 /*
- * End of "$Id: ppds.c,v 1.14.2.10 2003/03/30 20:01:48 mike Exp $".
+ * End of "$Id: ppds.c,v 1.14.2.11 2003/07/20 12:51:53 mike Exp $".
  */
index a20af796db9d625358ede968afa4d7591aa88baa..e5333d4f929fcb3493069b00acb9493e07ecc225 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.93.2.49 2003/04/26 17:19:47 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.50 2003/07/20 12:51:54 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -501,7 +501,7 @@ DeletePrinterFilters(printer_t *p)  /* I - Printer to remove from */
       MimeDatabase->num_filters --;
 
       if (i > 1)
-        memcpy(filter, filter + 1, sizeof(mime_filter_t) * (i - 1));
+        memmove(filter, filter + 1, sizeof(mime_filter_t) * (i - 1));
 
       filter --;
     }
@@ -2389,5 +2389,5 @@ write_irix_state(printer_t *p)            /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c,v 1.93.2.49 2003/04/26 17:19:47 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.50 2003/07/20 12:51:54 mike Exp $".
  */
index a212bf27bc8adcad55278f7a7f15017a2d261aca..7875f345d190d799f5b6176dcedf90fbd9814233 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# "$Id: run-stp-tests.sh,v 1.4.2.14 2003/04/23 18:39:23 mike Exp $"
+# "$Id: run-stp-tests.sh,v 1.4.2.15 2003/07/20 12:51:55 mike Exp $"
 #
 #   Perform the complete set of IPP compliance tests specified in the
 #   CUPS Software Test Plan.
@@ -92,6 +92,30 @@ port=8631
 cwd=`pwd`
 root=`dirname $cwd`
 
+#
+# See if we want to use valgrind...
+#
+
+echo ""
+echo "This test script can use the Valgrind software from:"
+echo ""
+echo "    http://developer.kde.org/~sewardj/"
+echo ""
+echo "Please enter Y to use Valgrind or N to not use Valgrind:"
+
+read usevalgrind
+
+case "$usevalgrind" in
+       Y* | y*)
+               valgrind="valgrind --logfile=/tmp/$user/log/valgrind --error-limit=no --leak-check=yes --trace-children=yes"
+               echo "Using Valgrind; log files can be found in /tmp/$user/log..."
+               ;;
+
+       *)
+               valgrind=""
+               ;;
+esac
+
 #
 # Start by creating temporary directories for the tests...
 #
@@ -270,7 +294,7 @@ export HOME
 
 echo "Starting scheduler..."
 
-../scheduler/cupsd -c /tmp/$user/cupsd.conf -f >/tmp/$user/log/debug_log &
+$valgrind ../scheduler/cupsd -c /tmp/$user/cupsd.conf -f >/tmp/$user/log/debug_log &
 cupsd=$!
 
 #if test -x /usr/bin/strace; then
@@ -440,5 +464,5 @@ echo "    $pdffile"
 echo ""
 
 #
-# End of "$Id: run-stp-tests.sh,v 1.4.2.14 2003/04/23 18:39:23 mike Exp $"
+# End of "$Id: run-stp-tests.sh,v 1.4.2.15 2003/07/20 12:51:55 mike Exp $"
 #