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7 +29,13 @@
SockNodeName
- localhost
+ ::1
+ SockServiceName
+ ipp
+
+
+ SockNodeName
+ 127.0.0.1
SockServiceName
ipp
diff --git a/pdftops/Catalog.cxx b/pdftops/Catalog.cxx
index d1ff4cb8e..4fa6e8e91 100644
--- a/pdftops/Catalog.cxx
+++ b/pdftops/Catalog.cxx
@@ -23,6 +23,12 @@
#include "Link.h"
#include "Catalog.h"
+// This define is used to limit the depth of recursive readPageTree calls
+// This is needed because the page tree nodes can reference their parents
+// leaving us in an infinite loop
+// Most sane pdf documents don't have a call depth higher than 10
+#define MAX_CALL_DEPTH 1000
+
//------------------------------------------------------------------------
// Catalog
//------------------------------------------------------------------------
@@ -71,7 +77,7 @@ Catalog::Catalog(XRef *xrefA) {
pageRefs[i].num = -1;
pageRefs[i].gen = -1;
}
- numPages = readPageTree(pagesDict.getDict(), NULL, 0);
+ numPages = readPageTree(pagesDict.getDict(), NULL, 0, 0);
if (numPages != numPages0) {
error(-1, "Page count in top-level pages object is incorrect");
}
@@ -169,7 +175,7 @@ GString *Catalog::readMetadata() {
return s;
}
-int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
+int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start, int callDepth) {
Object kids;
Object kid;
Object kidRef;
@@ -214,9 +220,13 @@ int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
// This should really be isDict("Pages"), but I've seen at least one
// PDF file where the /Type entry is missing.
} else if (kid.isDict()) {
- if ((start = readPageTree(kid.getDict(), attrs1, start))
- < 0)
- goto err2;
+ if (callDepth > MAX_CALL_DEPTH) {
+ error(-1, "Limit of %d recursive calls reached while reading the page tree. If your document is correct and not a test to try to force a crash, please report a bug.", MAX_CALL_DEPTH);
+ } else {
+ if ((start = readPageTree(kid.getDict(), attrs1, start, callDepth + 1))
+ < 0)
+ goto err2;
+ }
} else {
error(-1, "Kid object (page %d) is wrong type (%s)",
start+1, kid.getTypeName());
diff --git a/pdftops/Catalog.h b/pdftops/Catalog.h
index 08e50cae0..8cef94818 100644
--- a/pdftops/Catalog.h
+++ b/pdftops/Catalog.h
@@ -85,7 +85,7 @@ private:
Object acroForm; // AcroForm dictionary
GBool ok; // true if catalog is valid
- int readPageTree(Dict *pages, PageAttrs *attrs, int start);
+ int readPageTree(Dict *pages, PageAttrs *attrs, int start, int callDepth);
Object *findDestInTree(Object *tree, GString *name, Object *obj);
};
diff --git a/scheduler/auth.c b/scheduler/auth.c
index 8baf94511..ddc31ce6d 100644
--- a/scheduler/auth.c
+++ b/scheduler/auth.c
@@ -1,5 +1,5 @@
/*
- * "$Id: auth.c 6314 2007-03-01 19:11:54Z mike $"
+ * "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $"
*
* Authorization routines for the Common UNIX Printing System (CUPS).
*
@@ -835,7 +835,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
}
}
#ifdef HAVE_GSSAPI
- else if (!strncmp(authorization, "Negotiate", 9) && type == AUTH_KERBEROS)
+ else if (!strncmp(authorization, "Negotiate", 9) && type == AUTH_NEGOTIATE)
{
int len; /* Length of authorization string */
gss_cred_id_t server_creds; /* Server credentials */
@@ -1819,8 +1819,8 @@ 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) &&
- !(best->type == AUTH_KERBEROS ||
- (best->type == AUTH_NONE && DefaultAuthType == AUTH_KERBEROS)))
+ !(best->type == AUTH_NEGOTIATE ||
+ (best->type == AUTH_NONE && DefaultAuthType == AUTH_NEGOTIATE)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"cupsdIsAuthorized: Need upgrade to TLS...");
@@ -2522,5 +2522,5 @@ to64(char *s, /* O - Output string */
/*
- * End of "$Id: auth.c 6314 2007-03-01 19:11:54Z mike $".
+ * End of "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $".
*/
diff --git a/scheduler/auth.h b/scheduler/auth.h
index 61c7ae993..de62893ac 100644
--- a/scheduler/auth.h
+++ b/scheduler/auth.h
@@ -1,5 +1,5 @@
/*
- * "$Id: auth.h 5919 2006-08-31 04:20:45Z mike $"
+ * "$Id: auth.h 6361 2007-03-19 16:01:28Z mike $"
*
* Authorization definitions for the Common UNIX Printing System (CUPS)
* scheduler.
@@ -38,7 +38,7 @@
#define AUTH_BASIC 1 /* Basic authentication */
#define AUTH_DIGEST 2 /* Digest authentication */
#define AUTH_BASICDIGEST 3 /* Basic authentication w/passwd.md5 */
-#define AUTH_KERBEROS 4 /* Kerberos authentication */
+#define AUTH_NEGOTIATE 4 /* Kerberos authentication */
#define AUTH_ANON 0 /* Anonymous access */
#define AUTH_USER 1 /* Must have a valid username/password */
@@ -159,5 +159,5 @@ extern http_status_t cupsdIsAuthorized(cupsd_client_t *con, const char *owner);
/*
- * End of "$Id: auth.h 5919 2006-08-31 04:20:45Z mike $".
+ * End of "$Id: auth.h 6361 2007-03-19 16:01:28Z mike $".
*/
diff --git a/scheduler/client.c b/scheduler/client.c
index 9c0a17dc6..1ba04e969 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -1,5 +1,5 @@
/*
- * "$Id: client.c 6329 2007-03-12 14:48:28Z mike $"
+ * "$Id: client.c 6361 2007-03-19 16:01:28Z mike $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -2221,7 +2221,7 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */
* never disable it in that case.
*/
- if (code >= HTTP_BAD_REQUEST && con->http.auth_type != AUTH_KERBEROS)
+ if (code >= HTTP_BAD_REQUEST && con->http.auth_type != AUTH_NEGOTIATE)
con->http.keep_alive = HTTP_KEEPALIVE_OFF;
/*
@@ -2397,7 +2397,7 @@ cupsdSendHeader(cupsd_client_t *con, /* I - Client to send to */
snprintf(auth_str, sizeof(auth_str), "Digest realm=\"CUPS\", nonce=\"%s\"",
con->http.hostname);
#ifdef HAVE_GSSAPI
- else if (auth_type == AUTH_KERBEROS && !con->no_negotiate &&
+ else if (auth_type == AUTH_NEGOTIATE && !con->no_negotiate &&
con->gss_output_token.length == 0)
strlcpy(auth_str, "Negotiate", sizeof(auth_str));
#endif /* HAVE_GSSAPI */
@@ -4533,5 +4533,5 @@ write_file(cupsd_client_t *con, /* I - Client connection */
/*
- * End of "$Id: client.c 6329 2007-03-12 14:48:28Z mike $".
+ * End of "$Id: client.c 6361 2007-03-19 16:01:28Z mike $".
*/
diff --git a/scheduler/conf.c b/scheduler/conf.c
index d033627ad..04a58bd4d 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -1,9 +1,9 @@
/*
- * "$Id: conf.c 6253 2007-02-10 18:48:40Z mike $"
+ * "$Id: conf.c 6365 2007-03-19 20:56:57Z mike $"
*
* Configuration routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -87,6 +87,9 @@ typedef struct
static cupsd_var_t variables[] =
{
{ "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING },
+#ifdef __APPLE__
+ { "AppleQuotas", &AppleQuotas, CUPSD_VARTYPE_BOOLEAN },
+#endif /* __APPLE__ */
{ "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN },
{ "BrowseInterval", &BrowseInterval, CUPSD_VARTYPE_INTEGER },
#ifdef HAVE_LDAP
@@ -463,6 +466,10 @@ cupsdReadConfiguration(void)
cupsdSetString(&LaunchdConf, CUPS_DEFAULT_LAUNCHD_CONF);
#endif /* HAVE_LAUNCHD */
+#ifdef __APPLE__
+ AppleQuotas = TRUE;
+#endif /* __APPLE__ */
+
/*
* Read the configuration file...
*/
@@ -1718,10 +1725,9 @@ parse_aaa(cupsd_location_t *loc, /* I - Location */
loc->level = AUTH_USER;
}
#ifdef HAVE_GSSAPI
- else if (!strcasecmp(value, "kerberos") ||
- !strcasecmp(value, "gssapi"))
+ else if (!strcasecmp(value, "negotiate"))
{
- loc->type = AUTH_KERBEROS;
+ loc->type = AUTH_NEGOTIATE;
if (loc->level == AUTH_ANON)
loc->level = AUTH_USER;
@@ -2737,8 +2743,8 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
else if (!strcasecmp(value, "basicdigest"))
DefaultAuthType = AUTH_BASICDIGEST;
#ifdef HAVE_GSSAPI
- else if (!strcasecmp(value, "kerberos"))
- DefaultAuthType = AUTH_KERBEROS;
+ else if (!strcasecmp(value, "negotiate"))
+ DefaultAuthType = AUTH_NEGOTIATE;
#endif /* HAVE_GSSAPI */
else
{
@@ -3342,5 +3348,5 @@ read_policy(cups_file_t *fp, /* I - Configuration file */
/*
- * End of "$Id: conf.c 6253 2007-02-10 18:48:40Z mike $".
+ * End of "$Id: conf.c 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/scheduler/conf.h b/scheduler/conf.h
index cfb71fc4e..0a5e073d6 100644
--- a/scheduler/conf.h
+++ b/scheduler/conf.h
@@ -1,10 +1,10 @@
/*
- * "$Id: conf.h 6291 2007-02-19 21:54:27Z mike $"
+ * "$Id: conf.h 6365 2007-03-19 20:56:57Z mike $"
*
* Configuration file definitions for the Common UNIX Printing System (CUPS)
* scheduler.
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -201,6 +201,11 @@ VAR char *LaunchdConf VALUE(NULL);
/* launchd(8) configuration file */
#endif /* HAVE_LAUNCHD */
+#ifdef __APPLE__
+VAR int AppleQuotas VALUE(TRUE);
+ /* Use Apple PrintService Quotas instead of CUPS quotas */
+#endif /* __APPLE__ */
+
#ifdef HAVE_AUTHORIZATION_H
VAR char *SystemGroupAuthKey VALUE(NULL);
/* System group auth key */
@@ -228,5 +233,5 @@ extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code);
/*
- * End of "$Id: conf.h 6291 2007-02-19 21:54:27Z mike $".
+ * End of "$Id: conf.h 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/scheduler/cups-driverd.c b/scheduler/cups-driverd.c
index 39892bc71..d5ed5a33a 100644
--- a/scheduler/cups-driverd.c
+++ b/scheduler/cups-driverd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: cups-driverd.c 6211 2007-01-23 15:44:34Z mike $"
+ * "$Id: cups-driverd.c 6363 2007-03-19 20:48:49Z mike $"
*
* PPD/driver support for the Common UNIX Printing System (CUPS).
*
@@ -684,7 +684,7 @@ load_ppds(const char *d, /* I - Actual directory */
{ "german", "de" },
{ "greek", "el" },
{ "italian", "it" },
- { "japanese", "jp" },
+ { "japanese", "ja" },
{ "norwegian", "no" },
{ "polish", "pl" },
{ "portuguese", "pt" },
@@ -1122,5 +1122,5 @@ load_drivers(void)
/*
- * End of "$Id: cups-driverd.c 6211 2007-01-23 15:44:34Z mike $".
+ * End of "$Id: cups-driverd.c 6363 2007-03-19 20:48:49Z mike $".
*/
diff --git a/scheduler/cupsd.h b/scheduler/cupsd.h
index 81b5b3588..93b29b09b 100644
--- a/scheduler/cupsd.h
+++ b/scheduler/cupsd.h
@@ -1,5 +1,5 @@
/*
- * "$Id: cupsd.h 6170 2007-01-02 17:26:41Z mike $"
+ * "$Id: cupsd.h 6365 2007-03-19 20:56:57Z mike $"
*
* Main header file for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -172,6 +172,16 @@ VAR int Launchd VALUE(0);
/* Running from launchd */
#endif /* HAVE_LAUNCH_H */
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+typedef int (*PSQUpdateQuotaProcPtr)(const char *printer, const char *info,
+ const char *user, int nPages, int options);
+VAR PSQUpdateQuotaProcPtr PSQUpdateQuotaProc
+ VALUE(0);
+ /* Apple PrintService quota function */
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
+
+
/*
* Prototypes...
@@ -217,5 +227,5 @@ extern void cupsdStopSelect(void);
/*
- * End of "$Id: cupsd.h 6170 2007-01-02 17:26:41Z mike $".
+ * End of "$Id: cupsd.h 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c
index 73abd7bfc..7953ad5d7 100644
--- a/scheduler/dirsvc.c
+++ b/scheduler/dirsvc.c
@@ -1,5 +1,5 @@
/*
- * "$Id: dirsvc.c 6309 2007-02-24 03:11:56Z mike $"
+ * "$Id: dirsvc.c 6354 2007-03-19 06:16:32Z mike $"
*
* Directory services routines for the Common UNIX Printing System (CUPS).
*
@@ -2448,10 +2448,11 @@ dnssdBuildTxtRecord(
int *txt_len, /* O - TXT record length */
cupsd_printer_t *p) /* I - Printer information */
{
- int i; /* Looping var */
+ int i, j; /* Looping vars */
char type_str[32], /* Type to string buffer */
state_str[32], /* State to string buffer */
rp_str[1024], /* Queue name string buffer */
+ air_str[1024], /* auth-info-required string buffer */
*keyvalue[32][2]; /* Table of key/value pairs */
@@ -2556,6 +2557,27 @@ dnssdBuildTxtRecord(
keyvalue[i ][0] = "pdl";
keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript";
+ if (p->num_auth_info_required)
+ {
+ char *air = air_str; /* Pointer into string */
+
+
+ for (j = 0; j < p->num_auth_info_required; j ++)
+ {
+ if (air >= (air_str + sizeof(air_str) - 2))
+ break;
+
+ if (j)
+ *air++ = ',';
+
+ strlcpy(air, p->auth_info_required[j], sizeof(air_str) - (air - air_str));
+ air += strlen(air);
+ }
+
+ keyvalue[i ][0] = "air";
+ keyvalue[i++][1] = air;
+ }
+
/*
* Then pack them into a proper txt record...
*/
@@ -2978,6 +3000,9 @@ process_implicit_classes(void)
cupsdSetString(&pclass->location, p->location);
cupsdSetString(&pclass->info, p->info);
+ cupsdSetString(&pclass->job_sheets[0], p->job_sheets[0]);
+ cupsdSetString(&pclass->job_sheets[1], p->job_sheets[1]);
+
update = 1;
cupsdLogMessage(CUPSD_LOG_DEBUG, "Added implicit class \"%s\"...",
@@ -3079,7 +3104,7 @@ process_implicit_classes(void)
/*
* 'send_cups_browse()' - Send new browsing information using the CUPS
- * protocol.
+ * protocol.
*/
static void
@@ -3774,5 +3799,5 @@ slp_url_callback(
/*
- * End of "$Id: dirsvc.c 6309 2007-02-24 03:11:56Z mike $".
+ * End of "$Id: dirsvc.c 6354 2007-03-19 06:16:32Z mike $".
*/
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 78edc3cc8..956028484 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: ipp.c 6370 2007-03-20 14:36:12Z mike $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -113,6 +113,17 @@
# include
#endif /* HAVE_LIBPAPER */
+#ifdef HAVE_MEMBERSHIP_H
+# include
+#endif /* HAVE_MEMBERSHIP_H */
+#ifdef HAVE_MEMBERSHIPPRIV_H
+# include
+#else
+extern int mbr_user_name_to_uuid(const char* name, uuid_t uu);
+extern int mbr_group_name_to_uuid(const char* name, uuid_t uu);
+extern int mbr_check_membership_by_id(uuid_t user, gid_t group, int* ismember);
+#endif /* HAVE_MEMBERSHIPPRIV_H */
+
/*
* Local functions...
@@ -1175,16 +1186,31 @@ add_job(cupsd_client_t *con, /* I - Client connection */
* Check policy...
*/
+ auth_info = ippFindAttribute(job->attrs, "auth-info", IPP_TAG_TEXT);
+
if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
{
send_http_error(con, status);
return (NULL);
}
- else if ((printer->type & CUPS_PRINTER_AUTHENTICATED) && !con->username[0])
+ else if ((printer->type & CUPS_PRINTER_AUTHENTICATED) &&
+ !con->username[0] && !auth_info)
{
send_http_error(con, HTTP_UNAUTHORIZED);
return (NULL);
}
+#ifdef HAVE_SSL
+ else if (auth_info && !con->http.tls &&
+ !httpAddrLocalhost(con->http.hostaddr))
+ {
+ /*
+ * Require encryption of auth-info over non-local connections...
+ */
+
+ send_http_error(con, HTTP_UPGRADE_REQUIRED);
+ return (NULL);
+ }
+#endif /* HAVE_SSL */
/*
* See if the printer is accepting jobs...
@@ -1364,8 +1390,6 @@ add_job(cupsd_client_t *con, /* I - Client connection */
attr->name = _cupsStrAlloc("job-originating-user-name");
}
- auth_info = ippFindAttribute(job->attrs, "auth-info", IPP_TAG_TEXT);
-
if (con->username[0] || auth_info)
{
save_auth_info(con, job, auth_info);
@@ -3151,7 +3175,24 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
int i; /* Looping var */
char username[33]; /* Username */
cupsd_quota_t *q; /* Quota data */
+#ifdef HAVE_MBR_UID_TO_UUID
+ /*
+ * Use Apple membership APIs which require that all names represent
+ * valid user account or group records accessible by the server.
+ */
+
+ uuid_t usr_uuid; /* UUID for job requesting user */
+ uuid_t usr2_uuid; /* UUID for ACL user name entry */
+ uuid_t grp_uuid; /* UUID for ACL group name entry */
+ int mbr_err; /* Error from membership function */
+ int is_member; /* Is this user a member? */
+#else
+ /*
+ * Use standard POSIX APIs for checking users and groups...
+ */
+
struct passwd *pw; /* User password data */
+#endif /* HAVE_MBR_UID_TO_UUID */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "check_quotas(%p[%d], %p[%s])",
@@ -3211,8 +3252,34 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
if (p->num_users)
{
+#ifdef HAVE_MBR_UID_TO_UUID
+ /*
+ * Get UUID for job requesting user...
+ */
+
+ if (mbr_user_name_to_uuid((char *)username, usr_uuid))
+ {
+ /*
+ * Unknown user...
+ */
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "check_quotas: UUID lookup failed for user \"%s\"",
+ username);
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "Denying user \"%s\" access to printer \"%s\" "
+ "(unknown user)...",
+ username, p->name);
+ return (0);
+ }
+#else
+ /*
+ * Get UID and GID of requesting user...
+ */
+
pw = getpwnam(username);
endpwent();
+#endif /* HAVE_MBR_UID_TO_UUID */
for (i = 0; i < p->num_users; i ++)
if (p->users[i][0] == '@')
@@ -3221,11 +3288,86 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
* Check group membership...
*/
+#ifdef HAVE_MBR_UID_TO_UUID
+ if ((mbr_err = mbr_group_name_to_uuid((char *)p->users[i] + 1,
+ grp_uuid)) != 0)
+ {
+ /*
+ * Invalid ACL entries are ignored for matching; just record a
+ * warning in the log...
+ */
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "check_quotas: UUID lookup failed for ACL entry "
+ "\"%s\" (err=%d)", p->users[i], mbr_err);
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "Access control entry \"%s\" not a valid group name; "
+ "entry ignored", p->users[i]);
+ }
+ else
+ {
+ if ((mbr_err = mbr_check_membership(usr_uuid, grp_uuid,
+ &is_member)) != 0)
+ {
+ /*
+ * At this point, there should be no errors, but check anyways...
+ */
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "check_quotas: group \"%s\" membership check "
+ "failed (err=%d)", p->users[i] + 1, mbr_err);
+ is_member = 0;
+ }
+
+ /*
+ * Stop if we found a match...
+ */
+
+ if (is_member)
+ break;
+ }
+#else
if (cupsdCheckGroup(username, pw, p->users[i] + 1))
break;
+#endif /* HAVE_MBR_UID_TO_UUID */
+ }
+#ifdef HAVE_MBR_UID_TO_UUID
+ else
+ {
+ if ((mbr_err = mbr_user_name_to_uuid((char *)p->users[i],
+ usr2_uuid)) != 0)
+ {
+ /*
+ * Invalid ACL entries are ignored for matching; just record a
+ * warning in the log...
+ */
+
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "check_quotas: UUID lookup failed for ACL entry "
+ "\"%s\" (err=%d)", p->users[i], mbr_err);
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "Access control entry \"%s\" not a valid user name; "
+ "entry ignored", p->users[i]);
+ }
+ else
+ {
+ if ((mbr_err = mbr_check_membership(usr_uuid, usr2_uuid,
+ &is_member)) != 0)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "check_quotas: User \"%s\" identity check failed "
+ "(err=%d)", p->users[i], mbr_err);
+ is_member = 0;
+ }
+
+ if (is_member)
+ break;
+ }
}
+#else
else if (!strcasecmp(username, p->users[i]))
break;
+#endif /* HAVE_MBR_UID_TO_UUID */
if ((i < p->num_users) == p->deny_users)
{
@@ -3240,6 +3382,66 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
* Check quotas...
*/
+#ifdef __APPLE__
+ if (AppleQuotas)
+ {
+ /*
+ * TODO: Define these special page count values as constants!
+ */
+
+ if (q->page_count == -4) /* special case: unlimited user */
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "User \"%s\" request approved for printer %s (%s): "
+ "unlimited quota.",
+ username, p->name, p->info);
+ q->page_count = 0; /* allow user to print */
+ return (1);
+ }
+ else if (q->page_count == -3) /* quota exceeded */
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "User \"%s\" request denied for printer %s (%s): "
+ "quota limit exceeded.",
+ username, p->name, p->info);
+ q->page_count = 2; /* force quota exceeded failure */
+ return (0);
+ }
+ else if (q->page_count == -2) /* quota disabled for user */
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "User \"%s\" request denied for printer %s (%s): "
+ "printing disabled for user.",
+ username, p->name, p->info);
+ q->page_count = 2; /* force quota exceeded failure */
+ return (0);
+ }
+ else if (q->page_count == -1) /* quota access error */
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "User \"%s\" request denied for printer %s (%s): "
+ "unable to determine quota limit.",
+ username, p->name, p->info);
+ q->page_count = 2; /* force quota exceeded failure */
+ return (0);
+ }
+ else if (q->page_count < 0) /* user not found or other error */
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "User \"%s\" request denied for printer %s (%s): "
+ "user disabled / missing quota.",
+ username, p->name, p->info);
+ q->page_count = 2; /* force quota exceeded failure */
+ return (0);
+ }
+ else /* page within user limits */
+ {
+ q->page_count = 0; /* allow user to print */
+ return (1);
+ }
+ }
+ else
+#endif /* __APPLE__ */
if (p->k_limit || p->page_limit)
{
if ((q = cupsdUpdateQuota(p, username, 0, 0)) == NULL)
@@ -4832,7 +5034,7 @@ create_subscription(
while (attr && attr->group_tag != IPP_TAG_ZERO)
{
- if (!strcmp(attr->name, "notify-recipient") &&
+ if (!strcmp(attr->name, "notify-recipient-uri") &&
attr->value_tag == IPP_TAG_URI)
{
/*
@@ -4851,7 +5053,7 @@ create_subscription(
resource, sizeof(resource)) < HTTP_URI_OK)
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Bad notify-recipient URI \"%s\"!"), recipient);
+ _("Bad notify-recipient-uri URI \"%s\"!"), recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
return;
@@ -4862,7 +5064,7 @@ create_subscription(
if (access(notifier, X_OK))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("notify-recipient URI \"%s\" uses unknown scheme!"),
+ _("notify-recipient-uri URI \"%s\" uses unknown scheme!"),
recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
@@ -5503,9 +5705,6 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
if ((job->dtype & dmask) != dtype &&
(!job->printer || (job->printer->type & dmask) != dtype))
continue;
- if (username[0] && strcasecmp(username, job->username))
- continue;
-
if (completed && job->state_value <= IPP_JOB_STOPPED)
continue;
@@ -5517,6 +5716,9 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
if (!job->attrs)
continue;
+ if (username[0] && strcasecmp(username, job->username))
+ continue;
+
if (count > 0)
ippAddSeparator(con->response);
@@ -7658,7 +7860,6 @@ static void
save_krb5_creds(cupsd_client_t *con, /* I - Client connection */
cupsd_job_t *job) /* I - Job */
{
-# ifndef __APPLE__
krb5_context krb_context; /* Kerberos context */
krb5_ccache ccache; /* Credentials cache */
OM_uint32 major_status, /* Major status code */
@@ -7699,7 +7900,6 @@ save_krb5_creds(cupsd_client_t *con, /* I - Client connection */
cupsdSetStringf(&(job->ccname), "KRB5CCNAME=FILE:%s",
krb5_cc_get_name(krb_context, ccache));
krb5_cc_close(krb_context, ccache);
-# endif /* !__APPLE__ */
}
#endif /* HAVE_GSSAPI && HAVE_KRB5_H */
@@ -9248,5 +9448,5 @@ validate_user(cupsd_job_t *job, /* I - Job */
/*
- * End of "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: ipp.c 6370 2007-03-20 14:36:12Z mike $".
*/
diff --git a/scheduler/job.c b/scheduler/job.c
index 3c876a649..aded57757 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -1,5 +1,5 @@
/*
- * "$Id: job.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: job.c 6365 2007-03-19 20:56:57Z mike $"
*
* Job management routines for the Common UNIX Printing System (CUPS).
*
@@ -1700,7 +1700,28 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
job->sheets->values[0].integer += copies;
if (job->printer->page_limit)
- cupsdUpdateQuota(job->printer, job->username, copies, 0);
+ {
+ cupsd_quota_t *q = cupsdUpdateQuota(job->printer, job->username,
+ copies, 0);
+
+#ifdef __APPLE__
+ if (AppleQuotas && q->page_count == -3)
+ {
+ /*
+ * Quota limit exceeded, cancel job in progress immediately...
+ */
+
+ cupsdLogMessage(CUPSD_LOG_INFO,
+ "Job %d canceled: pages exceed user %s quota "
+ "limit on printer %s (%s).",
+ job->id, job->username, job->printer->name,
+ job->printer->info);
+
+ cupsdCancelJob(job, 1, IPP_JOB_CANCELED);
+ return;
+ }
+#endif /* __APPLE__ */
+ }
}
cupsdLogPage(job, message);
@@ -3521,5 +3542,5 @@ unload_job(cupsd_job_t *job) /* I - Job */
/*
- * End of "$Id: job.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: job.c 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/scheduler/main.c b/scheduler/main.c
index 8591cc0f3..f17969eea 100644
--- a/scheduler/main.c
+++ b/scheduler/main.c
@@ -1,5 +1,5 @@
/*
- * "$Id: main.c 6326 2007-03-11 17:50:18Z mike $"
+ * "$Id: main.c 6365 2007-03-19 20:56:57Z mike $"
*
* Scheduler main loop for the Common UNIX Printing System (CUPS).
*
@@ -61,7 +61,7 @@
#ifdef HAVE_LAUNCH_H
# include
# include
-# define CUPS_KEEPALIVE CUPS_STATEDIR "/org.cups.cupsd"
+# define CUPS_KEEPALIVE CUPS_CACHEDIR "/org.cups.cupsd"
/* Name of the launchd KeepAlive file */
# ifndef LAUNCH_JOBKEY_KEEPALIVE
# define LAUNCH_JOBKEY_KEEPALIVE "KeepAlive"
@@ -81,6 +81,10 @@
# include
#endif /* HAVE_NOTIFY_H */
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+# include
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
/*
* Local functions...
@@ -123,6 +127,12 @@ static CFDictionaryRef launchd_conf_dict = NULL;
/* org.cups.cupsd.plist dict */
#endif /* HAVE_LAUNCHD */
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+static const char *PSQLibPath = "/usr/lib/libPrintServiceQuota.dylib";
+static const char *PSQLibFuncName = "PSQUpdateQuota";
+static void *PSQLibRef; /* libPrintServiceQuota.dylib */
+#endif /* HAVE_DLFCN_H */
+
/*
* 'main()' - Main entry for the CUPS scheduler.
@@ -424,6 +434,17 @@ main(int argc, /* I - Number of command-line args */
}
#endif /* HAVE_LAUNCHD */
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+ /*
+ * Load Print Service quota enforcement library (X Server only)
+ */
+
+ PSQLibRef = dlopen(PSQLibPath, RTLD_LAZY);
+
+ if (PSQLibRef)
+ PSQUpdateQuotaProc = dlsym(PSQLibRef, PSQLibFuncName);
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
/*
* Startup the server...
*/
@@ -2134,5 +2155,5 @@ usage(int status) /* O - Exit status */
/*
- * End of "$Id: main.c 6326 2007-03-11 17:50:18Z mike $".
+ * End of "$Id: main.c 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 9a33a2221..c76a97780 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -1,5 +1,5 @@
/*
- * "$Id: printers.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: printers.c 6354 2007-03-19 06:16:32Z mike $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
@@ -2288,6 +2288,14 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
if (BrowseLocalOptions)
length += 12 + strlen(BrowseLocalOptions);
+ if (p->num_auth_info_required > 0)
+ {
+ length += 18; /* auth-info-required */
+
+ for (i = 0; i < p->num_auth_info_required; i ++)
+ length += strlen(p->auth_info_required[i]) + 1;
+ }
+
/*
* Allocate the new string...
*/
@@ -2334,7 +2342,20 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
}
}
- *attrptr = '\0';
+ if (p->num_auth_info_required > 0)
+ {
+ strcpy(attrptr, "auth-info-required");
+ attrptr += 18;
+
+ for (i = 0; i < p->num_auth_info_required; i ++)
+ {
+ *attrptr++ = i ? ',' : '=';
+ strcpy(attrptr, p->auth_info_required[i]);
+ attrptr += strlen(attrptr);
+ }
+ }
+ else
+ *attrptr = '\0';
}
}
@@ -3632,5 +3653,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */
/*
- * End of "$Id: printers.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: printers.c 6354 2007-03-19 06:16:32Z mike $".
*/
diff --git a/scheduler/quotas.c b/scheduler/quotas.c
index a51f7f08d..e224ebe3a 100644
--- a/scheduler/quotas.c
+++ b/scheduler/quotas.c
@@ -1,9 +1,9 @@
/*
- * "$Id: quotas.c 5969 2006-09-19 20:09:24Z mike $"
+ * "$Id: quotas.c 6365 2007-03-19 20:56:57Z mike $"
*
* Quota routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -101,6 +101,19 @@ cupsdUpdateQuota(
"cupsdUpdateQuota: p=%s username=%s pages=%d k=%d",
p->name, username, pages, k);
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+ /*
+ * Use Apple PrintService quota enforcement if installed (X Server only)
+ */
+
+ if (AppleQuotas && PSQUpdateQuotaProc)
+ {
+ q->page_count = (*PSQUpdateQuotaProc)(p->name, p->info, username, pages, 0);
+
+ return (q);
+ }
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
curtime = time(NULL);
if (curtime < q->next_update)
@@ -230,5 +243,5 @@ find_quota(cupsd_printer_t *p, /* I - Printer */
/*
- * End of "$Id: quotas.c 5969 2006-09-19 20:09:24Z mike $".
+ * End of "$Id: quotas.c 6365 2007-03-19 20:56:57Z mike $".
*/
diff --git a/systemv/lp.c b/systemv/lp.c
index 526930cd7..8500f802e 100644
--- a/systemv/lp.c
+++ b/systemv/lp.c
@@ -1,9 +1,9 @@
/*
- * "$Id: lp.c 5925 2006-09-05 19:43:11Z mike $"
+ * "$Id: lp.c 6356 2007-03-19 13:54:48Z mike $"
*
* "lp" command for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -290,7 +290,7 @@ main(int argc, /* I - Number of command-line arguments */
snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
httpGetHostname(NULL, buffer, sizeof(buffer)));
- num_options = cupsAddOption("notify-recipient", email,
+ num_options = cupsAddOption("notify-recipient-uri", email,
num_options, &options);
}
@@ -840,5 +840,5 @@ sighandler(int s) /* I - Signal number */
/*
- * End of "$Id: lp.c 5925 2006-09-05 19:43:11Z mike $".
+ * End of "$Id: lp.c 6356 2007-03-19 13:54:48Z mike $".
*/
diff --git a/systemv/lpoptions.c b/systemv/lpoptions.c
index e6778acc9..582213204 100644
--- a/systemv/lpoptions.c
+++ b/systemv/lpoptions.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpoptions.c 6202 2007-01-22 21:37:45Z mike $"
+ * "$Id: lpoptions.c 6347 2007-03-18 03:21:36Z mike $"
*
* Printer option program for the Common UNIX Printing System (CUPS).
*
@@ -174,6 +174,12 @@ main(int argc, /* I - Number of command-line arguments */
if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
dest = dests;
+ if (dest == NULL)
+ {
+ _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+ return (1);
+ }
+
for (j = 0; j < dest->num_options; j ++)
if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
num_options = cupsAddOption(dest->options[j].name,
@@ -244,6 +250,12 @@ main(int argc, /* I - Number of command-line arguments */
if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
dest = dests;
+ if (dest == NULL)
+ {
+ _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+ return (1);
+ }
+
for (j = 0; j < dest->num_options; j ++)
if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
num_options = cupsAddOption(dest->options[j].name,
@@ -484,5 +496,5 @@ usage(void)
/*
- * End of "$Id: lpoptions.c 6202 2007-01-22 21:37:45Z mike $".
+ * End of "$Id: lpoptions.c 6347 2007-03-18 03:21:36Z mike $".
*/
diff --git a/templates/admin.tmpl b/templates/admin.tmpl
index 056790dfd..137e26475 100644
--- a/templates/admin.tmpl
+++ b/templates/admin.tmpl
@@ -67,6 +67,7 @@ CLASS="button">
Share published printers connected to this system
Allow printing from the Internet
Allow remote administration
+{have_gssapi? Use Kerberos authentication :}
Allow users to cancel any job (not just their own)
Save debugging information for troubleshooting
diff --git a/templates/de/admin.tmpl b/templates/de/admin.tmpl
index 170c42c36..da45641b4 100644
--- a/templates/de/admin.tmpl
+++ b/templates/de/admin.tmpl
@@ -67,6 +67,7 @@ CLASS="button">