[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cups-commit
Subject:    [cups.commit] [CUPS] r9784 - in trunk: . doc/help man scheduler
From:       cups-dev () easysw ! com
Date:       2011-05-18 21:33:38
Message-ID: 10555-cups.commit () news ! easysw ! com
[Download RAW message or body]

Author: mike
Date: 2011-05-18 14:33:35 -0700 (Wed, 18 May 2011)
New Revision: 9784
Log:
The scheduler now allows the ServerAlias directive to contain multiple hostnames
separated by spaces or commas (STR #3813)



Modified:
   trunk/CHANGES.txt
   trunk/doc/help/ref-cupsd-conf.html.in
   trunk/man/cupsd.conf.man.in
   trunk/scheduler/conf.c

Modified: trunk/CHANGES.txt
===================================================================
--- trunk/CHANGES.txt	2011-05-18 20:44:16 UTC (rev 9783)
+++ trunk/CHANGES.txt	2011-05-18 21:33:35 UTC (rev 9784)
@@ -3,6 +3,8 @@
 
 CHANGES IN CUPS V1.5b1
 
+	- The scheduler now allows the ServerAlias directive to contain multiple
+	  hostnames separated by spaces or commas (STR #3813)
 	- The scheduler now sets the process group for child processes and
 	  manages the group (STR #2829)
 	- Fixed some minor issues discovered by a Coverity scan (STR #3838)

Modified: trunk/doc/help/ref-cupsd-conf.html.in
===================================================================
--- trunk/doc/help/ref-cupsd-conf.html.in	2011-05-18 20:44:16 UTC (rev 9783)
+++ trunk/doc/help/ref-cupsd-conf.html.in	2011-05-18 21:33:35 UTC (rev 9784)
@@ -2782,6 +2782,7 @@
 ServerAlias althost
 ServerAlias foo.example.com
 ServerAlias bar.example.com
+ServerAlias one.example.com two.example.com
 ServerAlias *
 </PRE>
 

Modified: trunk/man/cupsd.conf.man.in
===================================================================
--- trunk/man/cupsd.conf.man.in	2011-05-18 20:44:16 UTC (rev 9783)
+++ trunk/man/cupsd.conf.man.in	2011-05-18 21:33:35 UTC (rev 9784)
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH cupsd.conf 5 "CUPS" "5 November 2010" "Apple Inc."
+.TH cupsd.conf 5 "CUPS" "18 May 2011" "Apple Inc."
 .SH NAME
 cupsd.conf \- server configuration file for cups
 .SH DESCRIPTION
@@ -645,7 +645,9 @@
 .br
 Specifies the email address of the server administrator.
 .TP 5
-ServerAlias hostname
+ServerAlias hostname [... hostname]
+.TP 5
+ServerAlias *
 .br
 Specifies an alternate name that the server is known by. The special name "*"
 allows any name to be used.

Modified: trunk/scheduler/conf.c
===================================================================
--- trunk/scheduler/conf.c	2011-05-18 20:44:16 UTC (rev 9783)
+++ trunk/scheduler/conf.c	2011-05-18 21:33:35 UTC (rev 9784)
@@ -1916,7 +1916,7 @@
 
 	value += 4;
 
-	while (isspace(*value & 255))
+	while (_cups_isspace(*value))
 	  value ++;
 
         if (!*value)
@@ -1927,9 +1927,9 @@
       * Find the end of the value...
       */
 
-      for (valptr = value; *valptr && !isspace(*valptr & 255); valptr ++);
+      for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
 
-      while (isspace(*valptr & 255))
+      while (_cups_isspace(*valptr))
         *valptr++ = '\0';
 
      /*
@@ -2145,7 +2145,7 @@
     *     Require user names
     */
 
-    for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++);
+    for (valptr = value; !_cups_isspace(*valptr) && *valptr; valptr ++);
 
     if (*valptr)
       *valptr++ = '\0';
@@ -2168,7 +2168,7 @@
 
     for (value = valptr; *value;)
     {
-      while (isspace(*value & 255))
+      while (_cups_isspace(*value))
 	value ++;
 
 #ifdef HAVE_AUTHORIZATION_H
@@ -2201,7 +2201,7 @@
 	* Grab literal name.
 	*/
 
-        for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++);
+        for (valptr = value; !_cups_isspace(*valptr) && *valptr; valptr ++);
       }
 
       if (*valptr)
@@ -2209,7 +2209,7 @@
 
       cupsdAddName(loc, value);
 
-      for (value = valptr; isspace(*value & 255); value ++);
+      for (value = valptr; _cups_isspace(*value); value ++);
     }
   }
   else if (!strcasecmp(line, "Satisfy"))
@@ -2267,7 +2267,7 @@
     */
 
     for (valend = valstart; *valend; valend ++)
-      if (isspace(*valend & 255) || *valend == ',')
+      if (_cups_isspace(*valend) || *valend == ',')
 	break;
 
     if (*valend)
@@ -2304,7 +2304,7 @@
                       "Unknown FatalErrors kind \"%s\" ignored.", valstart);
 
     for (valstart = valend; *valstart; valstart ++)
-      if (!isspace(*valstart & 255) || *valstart != ',')
+      if (!_cups_isspace(*valstart) || *valstart != ',')
 	break;
   }
 
@@ -2357,7 +2357,7 @@
       */
 
       for (valend = valstart; *valend; valend ++)
-	if (isspace(*valend) || *valend == ',')
+	if (_cups_isspace(*valend) || *valend == ',')
 	  break;
     }
 
@@ -2379,7 +2379,7 @@
 
     valstart = valend;
 
-    while (*valstart == ',' || isspace(*valstart))
+    while (*valstart == ',' || _cups_isspace(*valstart))
       valstart ++;
   }
 
@@ -2422,7 +2422,7 @@
     */
 
     for (valend = valstart; *valend; valend ++)
-      if (isspace(*valend & 255) || *valend == ',')
+      if (_cups_isspace(*valend) || *valend == ',')
 	break;
 
     if (*valend)
@@ -2453,7 +2453,7 @@
                       "Unknown browse protocol \"%s\" ignored.", valstart);
 
     for (valstart = valend; *valstart; valstart ++)
-      if (!isspace(*valstart & 255) || *valstart != ',')
+      if (!_cups_isspace(*valstart) || *valstart != ',')
 	break;
   }
 
@@ -2830,7 +2830,7 @@
 	  * Skip leading whitespace...
 	  */
 
-	  while (isspace(*value & 255))
+	  while (_cups_isspace(*value))
 	    value ++;
 
 	  if (!*value)
@@ -2841,10 +2841,10 @@
 	  */
 
 	  for (valueptr = value;
-	       *valueptr && !isspace(*valueptr & 255);
+	       *valueptr && !_cups_isspace(*valueptr);
 	       valueptr ++);
 
-	  while (isspace(*valueptr & 255))
+	  while (_cups_isspace(*valueptr))
 	    *valueptr++ = '\0';
 
 	 /*
@@ -2965,7 +2965,7 @@
         * Skip leading whitespace...
 	*/
 
-	while (isspace(*value))
+	while (_cups_isspace(*value))
 	  value ++;
       }
 
@@ -2974,10 +2974,10 @@
       */
 
       for (valueptr = value;
-	   *valueptr && !isspace(*valueptr & 255);
+	   *valueptr && !_cups_isspace(*valueptr);
 	   valueptr ++);
 
-      while (isspace(*valueptr & 255))
+      while (_cups_isspace(*valueptr))
 	*valueptr++ = '\0';
 
      /*
@@ -3047,7 +3047,7 @@
 
 	valueptr += 3;
 
-	while (isspace(*valueptr))
+	while (_cups_isspace(*valueptr))
 	  valueptr ++;
       }
 
@@ -3412,7 +3412,7 @@
       for (; *value;)
       {
         for (valuelen = 0; value[valuelen]; valuelen ++)
-	  if (isspace(value[valuelen]) || value[valuelen] == ',')
+	  if (_cups_isspace(value[valuelen]) || value[valuelen] == ',')
 	    break;
 
         if (value[valuelen])
@@ -3424,16 +3424,37 @@
         cupsdSetEnv(value, NULL);
 
         for (value += valuelen; *value; value ++)
-	  if (!isspace(*value) || *value != ',')
+	  if (!_cups_isspace(*value) || *value != ',')
 	    break;
       }
     }
     else if (!strcasecmp(line, "ServerAlias") && value)
     {
+     /*
+      * ServerAlias name [... name]
+      */
+
       if (!ServerAlias)
         ServerAlias = cupsArrayNew(NULL, NULL);
 
-      cupsdAddAlias(ServerAlias, value);
+      for (; *value;)
+      {
+        for (valuelen = 0; value[valuelen]; valuelen ++)
+	  if (_cups_isspace(value[valuelen]) || value[valuelen] == ',')
+	    break;
+
+        if (value[valuelen])
+        {
+	  value[valuelen] = '\0';
+	  valuelen ++;
+	}
+
+	cupsdAddAlias(ServerAlias, value);
+
+        for (value += valuelen; *value; value ++)
+	  if (!_cups_isspace(*value) || *value != ',')
+	    break;
+      }
     }
     else if (!strcasecmp(line, "SetEnv") && value)
     {

_______________________________________________
cups-commit mailing list
cups-commit@easysw.com
http://lists.easysw.com/mailman/listinfo/cups-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic