/*
- * "$Id: policy.c 7673 2008-06-18 22:31:26Z mike $"
+ * "$Id$"
*
- * Policy routines for the CUPS scheduler.
+ * Policy routines for the CUPS scheduler.
*
- * Copyright 2007-2011 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2011, 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"
- * 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/".
*/
/*
/*
- * 'AddPolicy()' - Add a policy to the system.
+ * 'cupsdAddPolicy()' - Add a policy to the system.
*/
cupsd_policy_t * /* O - 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);
}
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);
}
return (po);
}
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindPolicyOp: No match found!");
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFindPolicyOp: No match found.");
return (NULL);
}
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...
*/
/*
- * End of "$Id: policy.c 7673 2008-06-18 22:31:26Z mike $".
+ * End of "$Id$".
*/