From: msweet
Date: Fri, 16 May 2008 03:15:15 +0000 (+0000)
Subject: Merge changes from CUPS 1.4svn-r7582.
X-Git-Tag: release-1.6.3~169
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01ce6322ca3809ac0260c8ef28abbc8255f6e34f;p=thirdparty%2Fcups.git
Merge changes from CUPS 1.4svn-r7582.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@768 a1ca3aef-8c08-0410-bb20-df032aa958be
---
diff --git a/CHANGES.txt b/CHANGES.txt
index 64b2990935..575442955d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,8 +1,10 @@
-CHANGES.txt - 2008-05-14
+CHANGES.txt - 2008-05-15
------------------------
CHANGES IN CUPS V1.4b1
+ - Added a PageLogFormat directive to the cupsd.conf file to
+ control the format of lines in the page_log file.
- Filters can now send PPD: messages to stderr to set PPD
keywords like DefaultPageSize while a job is printing.
- Added a mdns backend for discovery and printing to printers
diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in
index 55b7c5ca8b..3561a805e5 100644
--- a/conf/cupsd.conf.in
+++ b/conf/cupsd.conf.in
@@ -22,6 +22,7 @@ Listen localhost:@DEFAULT_IPP_PORT@
Browsing On
BrowseOrder allow,deny
BrowseAllow all
+BrowseLocalProtocols
# Default authentication type, when authentication is required...
DefaultAuthType Basic
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index c643663b02..6e81ea5260 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -261,8 +261,13 @@ case $uname in
dnl Check for Authorization Services support
AC_CHECK_HEADER(Security/Authorization.h, [
AC_DEFINE(HAVE_AUTHORIZATION_H)
- CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
- CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"])
+ if grep -q system.print.operator /etc/authorization; then
+ CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
+ CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
+ else
+ CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
+ CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
+ fi])
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
dnl Check for sandbox/Seatbelt support
diff --git a/cups/adminutil.c b/cups/adminutil.c
index 70fdce4256..e3adf54b44 100644
--- a/cups/adminutil.c
+++ b/cups/adminutil.c
@@ -79,7 +79,7 @@ static void write_option(cups_file_t *dstfp, int order,
char * /* O - PPD file or NULL */
cupsAdminCreateWindowsPPD(
- http_t *http, /* I - Connection to server */
+ http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
const char *dest, /* I - Printer or class */
char *buffer, /* I - Filename buffer */
int bufsize) /* I - Size of filename buffer */
@@ -121,6 +121,9 @@ cupsAdminCreateWindowsPPD(
if (buffer)
*buffer = '\0';
+ if (!http)
+ http = _cupsConnect();
+
if (!http || !dest || !buffer || bufsize < 2)
return (NULL);
@@ -855,7 +858,7 @@ cupsAdminExportSamba(
int /* O - 1 on success, 0 on failure */
cupsAdminGetServerSettings(
- http_t *http, /* I - Connection to server */
+ http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int *num_settings, /* O - Number of settings */
cups_option_t **settings) /* O - Settings */
{
@@ -874,7 +877,7 @@ cupsAdminGetServerSettings(
int /* O - 1 on success, 0 on failure */
_cupsAdminGetServerSettings(
- http_t *http, /* I - Connection to server */
+ http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int *num_settings, /* O - Number of settings */
cups_option_t **settings) /* O - Settings */
{
@@ -893,6 +896,9 @@ _cupsAdminGetServerSettings(
* Range check input...
*/
+ if (!http)
+ http = _cupsConnect();
+
if (!http || !num_settings || !settings)
{
_cupsSetError(IPP_INTERNAL_ERROR, NULL);
@@ -1144,7 +1150,7 @@ _cupsAdminGetServerSettings(
int /* O - 1 on success, 0 on failure */
cupsAdminSetServerSettings(
- http_t *http, /* I - Connection to server */
+ http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int num_settings, /* I - Number of settings */
cups_option_t *settings) /* I - Settings */
{
@@ -1160,7 +1166,7 @@ cupsAdminSetServerSettings(
int /* O - 1 on success, 0 on failure */
_cupsAdminSetServerSettings(
- http_t *http, /* I - Connection to server */
+ http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
int num_settings, /* I - Number of settings */
cups_option_t *settings) /* I - Settings */
{
@@ -1213,6 +1219,9 @@ _cupsAdminSetServerSettings(
* Range check input...
*/
+ if (!http)
+ http = _cupsConnect();
+
if (!http || !num_settings || !settings)
{
_cupsSetError(IPP_INTERNAL_ERROR, NULL);
diff --git a/cups/localize.c b/cups/localize.c
index 3136d4b7e6..6e28bb8d5b 100644
--- a/cups/localize.c
+++ b/cups/localize.c
@@ -277,9 +277,6 @@ ppdLocalizeIPPReason(
* Decode text: URI and add to the buffer...
*/
- if (bufptr > buffer)
- *bufptr++ = ' '; /* Add leading whitespace */
-
valptr += 5;
while (*valptr && !isspace(*valptr & 255) && bufptr < bufend)
diff --git a/cups/test.ppd b/cups/test.ppd
index 35682234a7..1b58a52312 100644
--- a/cups/test.ppd
+++ b/cups/test.ppd
@@ -144,19 +144,19 @@
help:anchor='foo'%20bookID=Vendor%20Help
/help/foo/bar.html"
*End
-*fr.cupsIPPReason foo/La Foo Reason: "text:La%20Long
+*fr.cupsIPPReason foo/La Foo Reason: "text:La%20Long%20
text:Foo%20Reason
http://foo/fr/bar.html
help:anchor='foo'%20bookID=Vendor%20Help
/help/fr/foo/bar.html"
*End
-*zh_TW.cupsIPPReason foo/Number 1 Foo Reason: "text:Number%201
+*zh_TW.cupsIPPReason foo/Number 1 Foo Reason: "text:Number%201%20
text:Foo%20Reason
http://foo/zh_TW/bar.html
help:anchor='foo'%20bookID=Vendor%20Help
/help/zh_TW/foo/bar.html"
*End
-*zh.cupsIPPReason foo/Number 2 Foo Reason: "text:Number%202
+*zh.cupsIPPReason foo/Number 2 Foo Reason: "text:Number%202%20
text:Foo%20Reason
http://foo/zh/bar.html
help:anchor='foo'%20bookID=Vendor%20Help
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index 07ba7ad517..46ad1027ba 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -2134,6 +2134,48 @@ default page log file is @CUPS_LOGDIR@/page_log.
information to the system log instead of a plain file.
+
+
+Examples
+
+
+PageLogFormat %p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}
+PageLogFormat PAGE %p %j %u %P %C %{job-billing} %{job-originating-host-name}
+
+
+Description
+
+The PageLogFormat
directive sets the format of lines
+that are logged to the page log file. Sequences beginning with percent (%)
+characters are replaced with the corresponding information, while all other
+characters are copied literally. The following percent sequences are
+recognized:
+
+
+
+ %%
: Inserts a single percent character.
+
+ %{name}
: Inserts the value of the specified IPP
+ attribute.
+
+ %C
: Inserts the number of copies for the current page.
+
+ %P
: Inserts the current page number.
+
+ %T
: Inserts the current date and time in common log
+ format.
+
+ %j
: Inserts the job ID.
+
+ %p
: Inserts the printer name.
+
+ %u
: Inserts the username.
+
+
+
+The default is "%p %j %u %T %P %C %{job-billing} %{job-originating-host-name} %{job-name} %{media} %{sides}".
+
+
Examples
diff --git a/doc/help/ref-page_log.html b/doc/help/ref-page_log.html
index f57180f7e1..fa2bd1dc16 100644
--- a/doc/help/ref-page_log.html
+++ b/doc/help/ref-page_log.html
@@ -6,20 +6,23 @@
The page_log file lists each page that is sent to a
-printer. Each line contains the following information:
+printer. By default, each line contains the following information:
-printer user job-id date-time page-number num-copies job-billing
+printer user job-id date-time page-number num-copies job-billing job-originating-host-name job-name media sides
-DeskJet root 2 [20/May/1999:19:21:05 +0000] 1 1 acme-123
+DeskJet root 2 [20/May/1999:19:21:05 +0000] 1 1 acme-123 localhost myjob letter one-sided
-DeskJet root 2 [20/May/1999:19:21:05 +0000] 2 1 acme-123
+DeskJet root 2 [20/May/1999:19:21:05 +0000] 2 1 acme-123 localhost myjob letter one-sided
+The PageLogFormat
+directive can be used to change this information.
+
The printer field contains the name of the printer that
printed the page. If you send a job to a printer class, this
field will contain the name of the printer that was assigned the
@@ -49,5 +52,23 @@ printers that cannot produce copies on their own, the
Create-Job
or Print-Job
requests or "-"
if none was provided.
+
The job-originating-host-name field contains the hostname or IP
+address of the client that printed the job.
+
+The job-name field contains a copy of the
+job-name
attribute provided with the IPP
+Create-Job
or Print-Job
requests or "-"
+if none was provided.
+
+
The media field contains a copy of the
+media
attribute provided with the IPP
+Create-Job
or Print-Job
requests or "-"
+if none was provided.
+
+
The sides field contains a copy of the
+sides
attribute provided with the IPP
+Create-Job
or Print-Job
requests or "-"
+if none was provided.
+