]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/policy.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / scheduler / policy.c
index 466067036e42e51781105055b9b425b6e7cffd5b..9a68b1a97b582a769e8bf2fc1033759924524d85 100644 (file)
@@ -1,32 +1,14 @@
 /*
- * "$Id$"
+ * Policy routines for the CUPS scheduler.
  *
- *   Policy routines for the CUPS scheduler.
+ * Copyright 2007-2011, 2014 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2011 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"
- *   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/".
- *
- * Contents:
- *
- *   AddPolicy()              - Add a policy to the system.
- *   cupsdAddPolicyOp()       - Add an operation to a policy.
- *   cupsdCheckPolicy()       - Check the IPP operation and username against a
- *                              policy.
- *   cupsdDeleteAllPolicies() - Delete all policies in memory.
- *   cupsdFindPolicy()        - Find a named policy.
- *   cupsdFindPolicyOp()      - Find a policy operation.
- *   cupsdGetPrivateAttrs()   - Get the private attributes for the current
- *                              request.
- *   compare_ops()            - Compare two operations.
- *   compare_policies()       - Compare two policies.
- *   free_policy()            - Free the memory used by a policy.
- *   hash_op()                - Generate a lookup hash for the operation.
+ * 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"
+ * 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/".
  */
 
 /*
@@ -48,7 +30,7 @@ static int    hash_op(cupsd_location_t *op);
 
 
 /*
- * 'AddPolicy()' - Add a policy to the system.
+ * 'cupsdAddPolicy()' - Add a policy to the system.
  */
 
 cupsd_policy_t *                       /* O - Policy */
@@ -136,7 +118,7 @@ cupsdCheckPolicy(cupsd_policy_t *p, /* I - Policy */
 
   if (!p || !con)
   {
-    cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdCheckPolicy: p=%p, con=%p!", p, con);
+    cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdCheckPolicy: p=%p, con=%p.", p, con);
 
     return ((http_status_t)0);
   }
@@ -147,7 +129,7 @@ cupsdCheckPolicy(cupsd_policy_t *p, /* I - Policy */
 
   if ((po = cupsdFindPolicyOp(p, con->request->request.op.operation_id)) == NULL)
   {
-    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckPolicy: No matching operation, returning 0!");
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckPolicy: No matching operation, returning 0.");
     return ((http_status_t)0);
   }
 
@@ -263,7 +245,7 @@ cupsdFindPolicyOp(cupsd_policy_t *p,        /* I - Policy */
     return (po);
   }
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindPolicyOp: No match found!");
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindPolicyOp: No match found.");
 
   return (NULL);
 }
@@ -293,9 +275,15 @@ cupsdGetPrivateAttrs(
   cupsdLogMessage(CUPSD_LOG_DEBUG2,
                   "cupsdGetPrivateAttrs(policy=%p(%s), con=%p(%d), "
                  "printer=%p(%s), owner=\"%s\")", policy, policy->name, con,
-                 con->http.fd, printer, printer ? printer->name : "", owner);
+                 con->number, printer, printer ? printer->name : "", owner);
 #endif /* DEBUG */
 
+  if (!policy)
+  {
+    cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdGetPrivateAttrs: policy=%p, con=%p, printer=%p, owner=\"%s\", DefaultPolicyPtr=%p: This should never happen, please report a bug.", policy, con, printer, owner, DefaultPolicyPtr);
+    policy = DefaultPolicyPtr;
+  }
+
  /*
   * Get the access and attributes lists that correspond to the request...
   */
@@ -510,8 +498,3 @@ hash_op(cupsd_location_t *op)               /* I - Operation */
 {
   return (((op->op >> 6) & 0x40) | (op->op & 0x3f));
 }
-
-
-/*
- * End of "$Id$".
- */