]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix parsing of SystemGroup directive.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 31 Jan 2003 17:48:23 +0000 (17:48 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 31 Jan 2003 17:48:23 +0000 (17:48 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@3295 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
scheduler/auth.c
scheduler/conf.c
scheduler/ipp.c

index 43f18384ff8545a0b69d9d3e12002a7dd2820048..f97a5d62cbbb893a4e3b968d43330391209fd25c 100644 (file)
@@ -1,8 +1,10 @@
-CHANGES.txt - 01/28/2003
+CHANGES.txt - 01/31/2003
 ------------------------
 
 CHANGES IN CUPS V1.1.19
 
+       - The scheduler did not properly parse the SystemGroup
+         directive, so only the first group would be used.
        - Revamped how strings are stored in the scheduler,
          providing a substantial improvement in memory usage
          for systems with large numbers of printers.
index db534c991c84007eeb5951115ba99fc55cc1d12d..f7fd4db8533e0ef1189b8b7965024c6a17b5d049 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c,v 1.67 2003/01/24 20:39:43 mike Exp $"
+ * "$Id: auth.c,v 1.68 2003/01/31 17:48:23 mike Exp $"
  *
  *   Authorization routines for the Common UNIX Printing System (CUPS).
  *
@@ -772,14 +772,23 @@ GetMD5Passwd(const char *username,        /* I - Username */
        tempgroup[33];                  /* Group from file */
 
 
+  LogMessage(L_DEBUG2, "GetMD5Passwd(username=\"%s\", group=\"%s\", passwd=%p)",
+             username, group ? group : "(null)", passwd);
+
   snprintf(filename, sizeof(filename), "%s/passwd.md5", ServerRoot);
   if ((fp = fopen(filename, "r")) == NULL)
+  {
+    LogMessage(L_ERROR, "Unable to open %s - %s", filename, strerror(errno));
     return (NULL);
+  }
 
   while (fgets(line, sizeof(line), fp) != NULL)
   {
     if (sscanf(line, "%32[^:]:%32[^:]:%32s", tempuser, tempgroup, passwd) != 3)
+    {
+      LogMessage(L_ERROR, "Bad MD5 password line: %s", line);
       continue;
+    }
 
     if (strcmp(username, tempuser) == 0 &&
         (group == NULL || strcmp(group, tempgroup) == 0))
@@ -788,6 +797,9 @@ GetMD5Passwd(const char *username,  /* I - Username */
       * Found the password entry!
       */
 
+      LogMessage(L_DEBUG2, "Found MD5 user %s, group %s...", username,
+                 tempgroup);
+
       fclose(fp);
       return (passwd);
     }
@@ -1153,6 +1165,8 @@ IsAuthorized(client_t *con)       /* I - Connection */
 
          if (best->num_names && best->level == AUTH_GROUP)
          {
+           LogMessage(L_DEBUG2, "IsAuthorized: num_names = %d", best->num_names);
+
             for (i = 0; i < best->num_names; i ++)
              if (GetMD5Passwd(con->username, best->names[i], md5))
                break;
@@ -1188,6 +1202,8 @@ IsAuthorized(client_t *con)       /* I - Connection */
 
          if (best->num_names && best->level == AUTH_GROUP)
          {
+           LogMessage(L_DEBUG2, "IsAuthorized: num_names = %d", best->num_names);
+
             for (i = 0; i < best->num_names; i ++)
              if (GetMD5Passwd(con->username, best->names[i], md5))
                break;
@@ -1627,5 +1643,5 @@ to64(char          *s,    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c,v 1.67 2003/01/24 20:39:43 mike Exp $".
+ * End of "$Id: auth.c,v 1.68 2003/01/31 17:48:23 mike Exp $".
  */
index cbbd43c5357e809b32b113cc83746815960e39f3..e85468c6aee2ea16548b6bf683f39d931d2c595b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: conf.c,v 1.120 2003/01/31 17:20:02 mike Exp $"
+ * "$Id: conf.c,v 1.121 2003/01/31 17:48:23 mike Exp $"
  *
  *   Configuration routines for the Common UNIX Printing System (CUPS).
  *
@@ -1295,7 +1295,7 @@ read_configuration(FILE *fp)              /* I - File to read from */
       char *valueptr; /* Pointer into value */
 
 
-      for (i = NumSystemGroups; i < MAX_SYSTEM_GROUPS; i ++)
+      for (i = NumSystemGroups; *value && i < MAX_SYSTEM_GROUPS; i ++)
       {
         for (valueptr = value; *valueptr; valueptr ++)
          if (isspace(*valueptr) || *valueptr == ',')
@@ -1306,6 +1306,8 @@ read_configuration(FILE *fp)              /* I - File to read from */
 
         SetString(SystemGroups + i, value);
 
+        value = valueptr;
+
         while (*value == ',' || isspace(*value))
          value ++;
       }
@@ -2041,5 +2043,5 @@ CDSAGetServerCerts(void)
 
 
 /*
- * End of "$Id: conf.c,v 1.120 2003/01/31 17:20:02 mike Exp $".
+ * End of "$Id: conf.c,v 1.121 2003/01/31 17:48:23 mike Exp $".
  */
index 68ac494108ddda67cc7c7f1f97aeb1fa92f4a17a..24052e28b0a3a0bf6dbcd9a7390a98122c0d2bf3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.185 2003/01/31 01:26:31 mike Exp $"
+ * "$Id: ipp.c,v 1.186 2003/01/31 17:48:23 mike Exp $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -1021,6 +1021,8 @@ add_printer(client_t        *con, /* I - Client connection */
     * No, return an error...
     */
 
+    LogMessage(L_ERROR, "add_printer: bad printer URI \"%s\"!",
+               uri->values[0].string.text);
     send_ipp_error(con, IPP_BAD_REQUEST);
     return;
   }
@@ -1042,6 +1044,8 @@ add_printer(client_t        *con, /* I - Client connection */
       * Yes, return an error...
       */
 
+      LogMessage(L_ERROR, "add_printer: \"%s\" already exists as a class!",
+                resource + 10);
       send_ipp_error(con, IPP_NOT_POSSIBLE);
       return;
     }
@@ -6027,5 +6031,5 @@ validate_user(client_t   *con,            /* I - Client connection */
 
 
 /*
- * End of "$Id: ipp.c,v 1.185 2003/01/31 01:26:31 mike Exp $".
+ * End of "$Id: ipp.c,v 1.186 2003/01/31 17:48:23 mike Exp $".
  */