]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
SGIs support a maximum of 38400 baud on the older ports.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 12 Jan 2001 19:29:17 +0000 (19:29 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 12 Jan 2001 19:29:17 +0000 (19:29 +0000)
Wasn't ignoring control characters (newlines, etc.) in form data.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1505 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
backend/serial.c
cgi-bin/var.c

index bf9d4f48339c54aca03db0e9cd6177dbac136ddf..228fd945b5705a5c58573dab344e6662ea82a976 100644 (file)
@@ -34,6 +34,9 @@ CHANGES IN CUPS V1.1.6
        - The HP and EPSON sample drivers now correctly catch
          signals and eject the current page when a job is
          cancelled.
+       - Fixed bug in CGI code - did not ignore control
+         characters (e.g. newlines) in form data.  This caused
+         sporatic web interface problems.
 
 
 CHANGES IN CUPS V1.1.5-2
index fa4482f7b29861b9150c71905df1839ba9d05022..5250f41b8fff9954b6bf2ed0515727e7d27c7349 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: serial.c,v 1.27 2001/01/03 17:44:40 mike Exp $"
+ * "$Id: serial.c,v 1.28 2001/01/12 19:29:16 mike Exp $"
  *
  *   Serial port backend for the Common UNIX Printing System (CUPS).
  *
@@ -532,7 +532,7 @@ list_devices(void)
         */
 
        for (n = 0; n < 6; n ++)
-         printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"CDSIO Board %d Serial Port #%d\"\n",
+         printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"CDSIO Board %d Serial Port #%d\"\n",
                 n + 5 + 8 * inv->inv_controller, inv->inv_controller, n + 1);
       }
       else if (inv->inv_type == INV_EPC_SERIAL)
@@ -547,7 +547,7 @@ list_devices(void)
           i = 41 + 4 * (int)inv->inv_controller;
 
        for (n = 0; n < (int)inv->inv_state; n ++)
-         printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"EPC Serial Port %d, Ebus slot %d\"\n",
+         printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"EPC Serial Port %d, Ebus slot %d\"\n",
                 n + i, n + 1, (int)inv->inv_controller);
       }
       else if (inv->inv_state > 1)
@@ -557,7 +557,7 @@ list_devices(void)
         */
 
        for (n = 0; n < (int)inv->inv_state; n ++)
-         printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"Onboard Serial Port %d\"\n",
+         printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"Onboard Serial Port %d\"\n",
                 n + (int)inv->inv_unit + 1, n + (int)inv->inv_unit + 1);
       }
       else
@@ -842,5 +842,5 @@ list_devices(void)
 
 
 /*
- * End of "$Id: serial.c,v 1.27 2001/01/03 17:44:40 mike Exp $".
+ * End of "$Id: serial.c,v 1.28 2001/01/12 19:29:16 mike Exp $".
  */
index 838764022427a48c199cebed47f14a32cd3a515d..08caa1c82e0b4e3c95ea61548a6a639a038b6cbc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: var.c,v 1.17 2000/12/04 16:10:32 mike Exp $"
+ * "$Id: var.c,v 1.18 2001/01/12 19:29:17 mike Exp $"
  *
  *   CGI form variable and array functions.
  *
@@ -39,6 +39,8 @@
 
 /*#define DEBUG*/
 #include "cgi.h"
+#include <errno.h>
+#include <syslog.h>
 
 
 /*
@@ -489,10 +491,11 @@ cgi_initialize_post(void)
 
   for (tbytes = 0; tbytes < length; tbytes += nbytes)
     if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
-    {
-      free(data);
-      return (0);
-    }
+      if (errno != EAGAIN)
+      {
+        free(data);
+        return (0);
+      }
 
   data[length] = '\0';
 
@@ -543,11 +546,11 @@ cgi_initialize_string(const char *data)   /* I - Form data string */
     * Get the variable name...
     */
 
-    for (s = name; *data != '\0'; data ++, s ++)
+    for (s = name; *data != '\0'; data ++)
       if (*data == '=')
         break;
-      else
-        *s = *data;
+      else if (*data >= ' ')
+        *s++ = *data;
 
     *s = '\0';
     if (*data == '=')
@@ -590,7 +593,10 @@ cgi_initialize_string(const char *data)    /* I - Form data string */
             break;
 
        default :       /* Other characters come straight through */
-            *s = *data;
+           if (*data < ' ')
+             s --;
+           else
+              *s = *data;
             break;
       }
 
@@ -600,7 +606,9 @@ cgi_initialize_string(const char *data)     /* I - Form data string */
     * Remove trailing whitespace...
     */
 
-    s --;
+    if (s > value)
+      s --;
+
     while (s >= value && *s == ' ')
       *s-- = '\0';
 
@@ -645,13 +653,14 @@ cgi_sort_variables(void)
         (int (*)(const void *, const void *))cgi_compare_variables);
 
 #ifdef DEBUG
-  puts("New variable list is:");
+  puts("Sorted variable list is:");
   for (i = 0; i < form_count; i ++)
-    printf("%s = %s\n", form_vars[i].name, form_vars[i].value);
+    printf("%d: %s (%d) = \"%s\" ...\n", i, form_vars[i].name,
+           form_vars[i].nvalues, form_vars[i].values[0]);
 #endif /* DEBUG */
 }
 
 
 /*
- * End of "$Id: var.c,v 1.17 2000/12/04 16:10:32 mike Exp $".
+ * End of "$Id: var.c,v 1.18 2001/01/12 19:29:17 mike Exp $".
  */