]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/auth.c
Remove svn:keywords since they cause svn_load_dirs.pl to complain about every file.
[thirdparty/cups.git] / scheduler / auth.c
index 6ece0cd51c5560cd0a7553389c40308b8cb352ac..da3c8347bf3c96fe363fc09c2325318f406a0d79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c 5336 2006-03-24 16:37:29Z mike $"
+ * "$Id: auth.c 181 2006-06-22 20:01:18Z jlovell $"
  *
  *   Authorization routines for the Common UNIX Printing System (CUPS).
  *
  *   cupsdAddName()            - Add a name to a location...
  *   cupsdAllowHost()          - Add a host name that is allowed to access the
  *                               location.
- *   cupsdAllowIP()            - Add an IP address or network that is allowed to
- *                               access the location.
+ *   cupsdAllowIP()            - Add an IP address or network that is allowed
+ *                               to access the location.
+ *   cupsdAuthorize()          - Validate any authorization credentials.
  *   cupsdCheckAuth()          - Check authorization masks.
  *   cupsdCheckGroup()         - Check for a user's group membership.
  *   cupsdCopyLocation()       - Make a copy of a location...
- *   cupsdDeleteAllLocations() - Free all memory used for location authorization.
+ *   cupsdDeleteAllLocations() - Free all memory used for location
+ *                               authorization.
  *   cupsdDeleteLocation()     - Free all memory used by a location.
- *   cupsdDenyHost()           - Add a host name that is not allowed to access the
- *                               location.
- *   cupsdDenyIP()             - Add an IP address or network that is not allowed
- *                               to access the location.
+ *   cupsdDenyHost()           - Add a host name that is not allowed to access
+ *                               the location.
+ *   cupsdDenyIP()             - Add an IP address or network that is not
+ *                               allowed to access the location.
  *   cupsdFindBest()           - Find the location entry that best matches the
  *                               resource.
  *   cupsdFindLocation()       - Find the named location.
@@ -117,7 +119,7 @@ typedef struct cupsd_authdata_s             /**** Authentication data ****/
  * Local globals...
  */
 
-#if defined(__hpux) && defined(HAVE_LIBPAM)
+#if defined(__hpux) && HAVE_LIBPAM
 static cupsd_authdata_t        *auth_data;     /* Current client being authenticated */
 #endif /* __hpux && HAVE_LIBPAM */
 
@@ -867,9 +869,12 @@ cupsdCheckAuth(
            */
 
            for (iface = (cupsd_netif_t *)cupsArrayFirst(NetIFList);
-                iface && !strcmp(masks->mask.name.name, iface->name);
+                iface;
                 iface = (cupsd_netif_t *)cupsArrayNext(NetIFList))
            {
+              if (strcmp(masks->mask.name.name, iface->name))
+                continue;
+
               if (iface->address.addr.sa_family == AF_INET)
              {
               /*
@@ -1495,7 +1500,8 @@ cupsdIsAuthorized(cupsd_client_t *con,    /* I - Connection */
 
   cupsdLogMessage(CUPSD_LOG_DEBUG2,
                   "cupsdIsAuthorized: con->uri=\"%s\", con->best=%p(%s)",
-                  con->uri, con->best, con->best ? con->best->location : "");
+                  con->uri, con->best, con->best ? con->best->location ?
+                                          con->best->location : "(null)" : "");
   if (owner)
     cupsdLogMessage(CUPSD_LOG_DEBUG2,
                     "cupsdIsAuthorized: owner=\"%s\"", owner);
@@ -1619,6 +1625,7 @@ cupsdIsAuthorized(cupsd_client_t *con,    /* I - Connection */
   */
 
   if (best->encryption >= HTTP_ENCRYPT_REQUIRED && !con->http.tls &&
+      strcasecmp(con->http.hostname, "localhost") &&
       best->satisfy == AUTH_SATISFY_ALL)
   {
     cupsdLogMessage(CUPSD_LOG_DEBUG2,
@@ -2164,5 +2171,5 @@ to64(char          *s,                    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c 5336 2006-03-24 16:37:29Z mike $".
+ * End of "$Id: auth.c 181 2006-06-22 20:01:18Z jlovell $".
  */