]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 6 Jan 2014 21:59:35 +0000 (21:59 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 6 Jan 2014 21:59:35 +0000 (21:59 +0000)
Move the cupsdNetIFUpdate call before the name check - we need to update for all names.

Add debug logging to show interfaces that are skipped and other "errors".

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11497 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
scheduler/auth.c
scheduler/network.c

index 3751371a8c6a818d8d1a8f5bf51687586e2f0eb8..a207788ae932cc166024614f8062b06cc81256cf 100644 (file)
@@ -32,6 +32,7 @@ CHANGES IN CUPS V1.7.1
          before attempting to print (<rdar://problem/15465667>)
        - CUPS did not support "auto-monochrome" or "process-monochrome" for the
          "print-color-mode" option (<rdar://problem/15482520>)
+       - Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
 
 
 CHANGES IN CUPS V1.7.0
index 5566e6ce650392594b8a8acbda1f2a0e9c2a3ae3..9e5642ef853381712c28a12b2798e006ea22e3e7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Authorization routines for the CUPS scheduler.
  *
- * Copyright 2007-2013 by Apple Inc.
+ * Copyright 2007-2014 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * This file contains Kerberos support code, copyright 2006 by
@@ -1226,6 +1226,8 @@ cupsdCheckAuth(unsigned     ip[4],        /* I - Client address */
           netip6[3] = htonl(ip[3]);
 #endif /* AF_INET6 */
 
+         cupsdNetIFUpdate();
+
           if (!strcmp(mask->mask.name.name, "*"))
          {
 #ifdef __APPLE__
@@ -1241,8 +1243,6 @@ cupsdCheckAuth(unsigned     ip[4],        /* I - Client address */
            * Check against all local interfaces...
            */
 
-            cupsdNetIFUpdate();
-
            for (iface = (cupsd_netif_t *)cupsArrayFirst(NetIFList);
                 iface;
                 iface = (cupsd_netif_t *)cupsArrayNext(NetIFList))
index 054faa50fe36257f53ead0d276ead3958726f8c2..350f4e3e90583d9a21df182fe31b1d222e70be2a 100644 (file)
@@ -1,23 +1,16 @@
 /*
  * "$Id$"
  *
- *   Network interface functions for the CUPS scheduler.
+ * Network interface functions for the CUPS scheduler.
  *
- *   Copyright 2007-2012 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   "LICENSE" which should have been included with this file.  If this
- *   file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * Contents:
- *
- *   cupsdNetIFFind()   - Find a network interface.
- *   cupsdNetIFFree()   - Free the current network interface list.
- *   cupsdNetIFUpdate() - Update the network interface list as needed...
- *   compare_netif()    - Compare two network interfaces.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * "LICENSE" which should have been included with this file.  If this
+ * file is missing or damaged, see the license at "http://www.cups.org/".
  */
 
 /*
@@ -133,7 +126,10 @@ cupsdNetIFUpdate(void)
   */
 
   if (getifaddrs(&addrs) < 0)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Unable to get interface list - %s", strerror(errno));
     return;
+  }
 
   for (addr = addrs; addr != NULL; addr = addr->ifa_next)
   {
@@ -148,7 +144,10 @@ cupsdNetIFUpdate(void)
 #endif
        ) ||
         addr->ifa_netmask == NULL || addr->ifa_name == NULL)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Ignoring \"%s\".", addr->ifa_name);
       continue;
+    }
 
    /*
     * Try looking up the hostname for the address as needed...
@@ -178,7 +177,10 @@ cupsdNetIFUpdate(void)
 
     hostlen = strlen(hostname);
     if ((temp = calloc(1, sizeof(cupsd_netif_t) + hostlen)) == NULL)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: Unable to allocate memory for interface.");
       break;
+    }
 
    /*
     * Copy all of the information...