diff options
author | Didier Raboud <odyx@debian.org> | 2012-10-25 20:52:33 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2012-10-25 20:52:33 +0200 |
commit | 505bb5aeae558718c3acafc63797fc652368279f (patch) | |
tree | 1dd916f29a4bde76d9288508a1d13830e18e2ef1 /scheduler/conf.c | |
parent | b0950df0920600c7b76f0aada5fb2d7dfe01eb7b (diff) | |
download | cups-505bb5aeae558718c3acafc63797fc652368279f.tar.gz |
Imported Upstream version 1.4.5upstream/1.4.5
Diffstat (limited to 'scheduler/conf.c')
-rw-r--r-- | scheduler/conf.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/scheduler/conf.c b/scheduler/conf.c index dffff6d0..e72ecead 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1,5 +1,5 @@ /* - * "$Id: conf.c 9120 2010-04-23 18:56:34Z mike $" + * "$Id: conf.c 9273 2010-08-31 04:18:38Z mike $" * * Configuration routines for the Common UNIX Printing System (CUPS). * @@ -1174,6 +1174,19 @@ cupsdReadConfiguration(void) cupsdLogMessage(CUPSD_LOG_INFO, "<Policy default>"); cupsdLogMessage(CUPSD_LOG_INFO, + "<Limit Create-Job Print-Job Print-URI Validate-Job>"); + cupsdLogMessage(CUPSD_LOG_INFO, "Order Deny,Allow"); + + po = cupsdAddPolicyOp(p, NULL, IPP_CREATE_JOB); + po->order_type = CUPSD_AUTH_ALLOW; + + cupsdAddPolicyOp(p, po, IPP_PRINT_JOB); + cupsdAddPolicyOp(p, po, IPP_PRINT_URI); + cupsdAddPolicyOp(p, po, IPP_VALIDATE_JOB); + + cupsdLogMessage(CUPSD_LOG_INFO, "</Limit>"); + + cupsdLogMessage(CUPSD_LOG_INFO, "<Limit Send-Document Send-URI Cancel-Job Hold-Job " "Release-Job Restart-Job Purge-Jobs " "Set-Job-Attributes Create-Job-Subscription " @@ -3685,10 +3698,30 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ linenum); /* - * Verify that we have an explicit policy for CUPS-Get-Document - * (ensures that upgrades do not introduce new security issues...) + * Verify that we have an explicit policy for Validate-Job and + * CUPS-Get-Document, which ensures that upgrades do not introduce new + * security issues... */ + if ((op = cupsdFindPolicyOp(pol, IPP_VALIDATE_JOB)) == NULL || + op->op == IPP_ANY_OPERATION) + { + if ((op = cupsdFindPolicyOp(pol, IPP_PRINT_JOB)) != NULL && + op->op != IPP_ANY_OPERATION) + { + /* + * Add a new limit for Validate-Job using the Print-Job limit as a + * template... + */ + + cupsdLogMessage(CUPSD_LOG_WARN, + "No limit for Validate-Job defined in policy %s " + "- using Print-Job's policy", pol->name); + + cupsdAddPolicyOp(pol, op, IPP_VALIDATE_JOB); + } + } + if ((op = cupsdFindPolicyOp(pol, CUPS_GET_DOCUMENT)) == NULL || op->op == IPP_ANY_OPERATION) { @@ -3820,5 +3853,5 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ /* - * End of "$Id: conf.c 9120 2010-04-23 18:56:34Z mike $". + * End of "$Id: conf.c 9273 2010-08-31 04:18:38Z mike $". */ |