diff options
author | Didier Raboud <odyx@debian.org> | 2014-01-02 23:03:44 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2014-01-02 23:03:44 +0100 |
commit | d13746555c30d1d1bd617dcf64d5b92e319ae2b5 (patch) | |
tree | ba335eb874926e0d4efebaccb46f2d5d390c7854 /backend | |
parent | 11884b3954f87fa67f02dca9169df32666b5363c (diff) | |
download | cups-d13746555c30d1d1bd617dcf64d5b92e319ae2b5.tar.gz |
Imported Upstream version 1.7.0~rc1upstream/1.7.0_rc1
Diffstat (limited to 'backend')
-rw-r--r-- | backend/Makefile | 4 | ||||
-rw-r--r-- | backend/backend-private.h | 4 | ||||
-rw-r--r-- | backend/dnssd.c | 4 | ||||
-rw-r--r-- | backend/ieee1284.c | 4 | ||||
-rw-r--r-- | backend/ipp.c | 40 | ||||
-rw-r--r-- | backend/lpd.c | 4 | ||||
-rw-r--r-- | backend/network.c | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | backend/pseudo | 0 | ||||
-rw-r--r-- | backend/runloop.c | 4 | ||||
-rw-r--r-- | backend/snmp-supplies.c | 4 | ||||
-rw-r--r-- | backend/snmp.c | 4 | ||||
-rw-r--r-- | backend/socket.c | 4 | ||||
-rw-r--r-- | backend/test1284.c | 4 | ||||
-rw-r--r-- | backend/testbackend.c | 18 | ||||
-rw-r--r-- | backend/testsupplies.c | 4 | ||||
-rw-r--r-- | backend/usb-darwin.c | 4 | ||||
-rw-r--r-- | backend/usb-libusb.c | 20 | ||||
-rw-r--r-- | backend/usb-unix.c | 4 | ||||
-rw-r--r-- | backend/usb.c | 4 |
19 files changed, 85 insertions, 53 deletions
diff --git a/backend/Makefile b/backend/Makefile index d2f88140..0c8e55a9 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 10736 2012-12-07 21:45:35Z mike $" +# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $" # # Backend makefile for CUPS. # @@ -296,5 +296,5 @@ include Dependencies # -# End of "$Id: Makefile 10736 2012-12-07 21:45:35Z mike $". +# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $". # diff --git a/backend/backend-private.h b/backend/backend-private.h index fa829141..09e4bac4 100644 --- a/backend/backend-private.h +++ b/backend/backend-private.h @@ -1,5 +1,5 @@ /* - * "$Id: backend-private.h 10329 2012-03-05 23:18:31Z mike $" + * "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $" * * Backend support definitions for CUPS. * @@ -334,5 +334,5 @@ extern int backendWaitLoop(int snmp_fd, http_addr_t *addr, /* - * End of "$Id: backend-private.h 10329 2012-03-05 23:18:31Z mike $". + * End of "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/dnssd.c b/backend/dnssd.c index b66ad1af..916b890b 100644 --- a/backend/dnssd.c +++ b/backend/dnssd.c @@ -1,5 +1,5 @@ /* - * "$Id: dnssd.c 10748 2012-12-11 20:01:35Z mike $" + * "$Id: dnssd.c 4074 2012-12-12 20:54:21Z msweet $" * * DNS-SD discovery backend for CUPS. * @@ -1320,5 +1320,5 @@ unquote(char *dst, /* I - Destination buffer */ /* - * End of "$Id: dnssd.c 10748 2012-12-11 20:01:35Z mike $". + * End of "$Id: dnssd.c 4074 2012-12-12 20:54:21Z msweet $". */ diff --git a/backend/ieee1284.c b/backend/ieee1284.c index c95fbc7f..fc5ad1d0 100644 --- a/backend/ieee1284.c +++ b/backend/ieee1284.c @@ -1,5 +1,5 @@ /* - * "$Id: ieee1284.c 9828 2011-06-14 06:38:24Z mike $" + * "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $" * * IEEE-1284 support functions for CUPS. * @@ -487,5 +487,5 @@ backendGetMakeModel( /* - * End of "$Id: ieee1284.c 9828 2011-06-14 06:38:24Z mike $". + * End of "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/ipp.c b/backend/ipp.c index e27700b5..92b9a79b 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 10929 2013-04-01 18:49:19Z mike $" + * "$Id: ipp.c 11089 2013-07-03 16:39:38Z msweet $" * * IPP backend for CUPS. * @@ -366,7 +366,8 @@ main(int argc, /* I - Number of command-line args */ * that way. */ - if (!getuid() && (value = getenv("AUTH_UID")) != NULL) + if (!getuid() && (value = getenv("AUTH_UID")) != NULL && + !getenv("AUTH_PASSWORD")) { uid_t uid = (uid_t)atoi(value); /* User ID */ @@ -431,7 +432,7 @@ main(int argc, /* I - Number of command-line args */ if (!port) port = IPP_PORT; /* Default to port 631 */ - if (!strcmp(scheme, "https")) + if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps")) cupsSetEncryption(HTTP_ENCRYPT_ALWAYS); else cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED); @@ -2601,17 +2602,27 @@ new_request( "job-password-encryption", NULL, keyword); } - if (pc->account_id && - (keyword = cupsGetOption("job-account-id", num_options, - options)) != NULL) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", - NULL, keyword); + if (pc->account_id) + { + if ((keyword = cupsGetOption("job-account-id", num_options, + options)) == NULL) + keyword = cupsGetOption("job-billing", num_options, options); - if (pc->accounting_user_id && - (keyword = cupsGetOption("job-accounting-user-id", num_options, - options)) != NULL) - ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, - "job-accounting-user-id", NULL, keyword); + if (keyword) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id", + NULL, keyword); + } + + if (pc->accounting_user_id) + { + if ((keyword = cupsGetOption("job-accounting-user-id", num_options, + options)) == NULL) + keyword = user; + + if (keyword) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, + "job-accounting-user-id", NULL, keyword); + } for (mandatory = (char *)cupsArrayFirst(pc->mandatory); mandatory; @@ -3403,7 +3414,6 @@ run_as_user(char *argv[], /* I - Command-line arguments */ if (conn) { - xpc_connection_suspend(conn); xpc_connection_cancel(conn); xpc_release(conn); } @@ -3669,5 +3679,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ } /* - * End of "$Id: ipp.c 10929 2013-04-01 18:49:19Z mike $". + * End of "$Id: ipp.c 11089 2013-07-03 16:39:38Z msweet $". */ diff --git a/backend/lpd.c b/backend/lpd.c index 6417ea48..6e4ab365 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -1,5 +1,5 @@ /* - * "$Id: lpd.c 10672 2012-11-01 00:57:55Z mike $" + * "$Id: lpd.c 10996 2013-05-29 11:51:34Z msweet $" * * Line Printer Daemon backend for CUPS. * @@ -1331,5 +1331,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: lpd.c 10672 2012-11-01 00:57:55Z mike $". + * End of "$Id: lpd.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/network.c b/backend/network.c index 387d5150..4227319c 100644 --- a/backend/network.c +++ b/backend/network.c @@ -1,5 +1,5 @@ /* - * "$Id: network.c 10389 2012-03-28 21:57:29Z mike $" + * "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $" * * Common backend network APIs for CUPS. * @@ -322,5 +322,5 @@ backendNetworkSideCB( /* - * End of "$Id: network.c 10389 2012-03-28 21:57:29Z mike $". + * End of "$Id: network.c 3755 2012-03-30 05:59:14Z msweet $". */ diff --git a/backend/pseudo b/backend/pseudo index 3a82a522..3a82a522 100755..100644 --- a/backend/pseudo +++ b/backend/pseudo diff --git a/backend/runloop.c b/backend/runloop.c index 90bb9558..74cdc512 100644 --- a/backend/runloop.c +++ b/backend/runloop.c @@ -1,5 +1,5 @@ /* - * "$Id: runloop.c 10434 2012-04-23 21:47:41Z mike $" + * "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $" * * Common run loop APIs for CUPS backends. * @@ -539,5 +539,5 @@ backendWaitLoop( /* - * End of "$Id: runloop.c 10434 2012-04-23 21:47:41Z mike $". + * End of "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c index 438db2d9..afe2fbf1 100644 --- a/backend/snmp-supplies.c +++ b/backend/snmp-supplies.c @@ -1,5 +1,5 @@ /* - * "$Id: snmp-supplies.c 10734 2012-12-07 21:33:22Z mike $" + * "$Id: snmp-supplies.c 4074 2012-12-12 20:54:21Z msweet $" * * SNMP supplies functions for CUPS. * @@ -1073,5 +1073,5 @@ utf16_to_utf8( /* - * End of "$Id: snmp-supplies.c 10734 2012-12-07 21:33:22Z mike $". + * End of "$Id: snmp-supplies.c 4074 2012-12-12 20:54:21Z msweet $". */ diff --git a/backend/snmp.c b/backend/snmp.c index 690f2fa5..a94e89c5 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -1,5 +1,5 @@ /* - * "$Id: snmp.c 10642 2012-10-09 03:01:31Z mike $" + * "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $" * * SNMP discovery backend for CUPS. * @@ -1391,5 +1391,5 @@ update_cache(snmp_cache_t *device, /* I - Device */ /* - * End of "$Id: snmp.c 10642 2012-10-09 03:01:31Z mike $". + * End of "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/socket.c b/backend/socket.c index e8c36177..8b7dc380 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -1,5 +1,5 @@ /* - * "$Id: socket.c 10679 2012-11-06 16:33:50Z mike $" + * "$Id: socket.c 10996 2013-05-29 11:51:34Z msweet $" * * AppSocket backend for CUPS. * @@ -520,5 +520,5 @@ wait_bc(int device_fd, /* I - Socket */ /* - * End of "$Id: socket.c 10679 2012-11-06 16:33:50Z mike $". + * End of "$Id: socket.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/test1284.c b/backend/test1284.c index 1080c195..3a32391b 100644 --- a/backend/test1284.c +++ b/backend/test1284.c @@ -1,5 +1,5 @@ /* - * "$Id: test1284.c 9042 2010-03-24 00:45:34Z mike $" + * "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $" * * IEEE-1284 support functions test program for CUPS. * @@ -80,5 +80,5 @@ main(int argc, /* I - Number of command-line args */ /* - * End of "$Id: test1284.c 9042 2010-03-24 00:45:34Z mike $". + * End of "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/testbackend.c b/backend/testbackend.c index ad260701..aecfd9cd 100644 --- a/backend/testbackend.c +++ b/backend/testbackend.c @@ -1,5 +1,5 @@ /* - * "$Id: testbackend.c 10389 2012-03-28 21:57:29Z mike $" + * "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $" * * Backend test program for CUPS. * @@ -667,10 +667,22 @@ walk_cb(const char *oid, /* I - OID */ int datalen, /* I - Length of data */ void *context) /* I - Context (unused) */ { - printf("CUPS_SC_CMD_SNMP_WALK %s, %d bytes (%s)\n", oid, datalen, data); + char temp[80]; + if (datalen > (sizeof(temp) - 1)) + { + memcpy(temp, data, sizeof(temp) - 1); + temp[sizeof(temp) - 1] = '\0'; + } + else + { + memcpy(temp, data, datalen); + temp[datalen] = '\0'; + } + + printf("CUPS_SC_CMD_SNMP_WALK %s, %d bytes (%s)\n", oid, datalen, temp); } /* - * End of "$Id: testbackend.c 10389 2012-03-28 21:57:29Z mike $". + * End of "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $". */ diff --git a/backend/testsupplies.c b/backend/testsupplies.c index 827cdf6f..0a300bc9 100644 --- a/backend/testsupplies.c +++ b/backend/testsupplies.c @@ -1,5 +1,5 @@ /* - * "$Id: testsupplies.c 9771 2011-05-12 05:21:56Z mike $" + * "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $" * * SNMP supplies test program for CUPS. * @@ -79,5 +79,5 @@ main(int argc, /* I - Number of command-line args */ /* - * End of "$Id: testsupplies.c 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $". */ diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index ca855cc9..15f074e9 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1,5 +1,5 @@ /* -* "$Id: usb-darwin.c 10894 2013-03-11 14:01:31Z mike $" +* "$Id: usb-darwin.c 10996 2013-05-29 11:51:34Z msweet $" * * Copyright 2005-2013 Apple Inc. All rights reserved. * @@ -2339,5 +2339,5 @@ static void get_device_id(cups_sc_status_t *status, /* - * End of "$Id: usb-darwin.c 10894 2013-03-11 14:01:31Z mike $". + * End of "$Id: usb-darwin.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c index 4cae3a0e..e25a9504 100644 --- a/backend/usb-libusb.c +++ b/backend/usb-libusb.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-libusb.c 10948 2013-04-18 14:18:34Z mike $" + * "$Id: usb-libusb.c 10977 2013-05-13 16:46:08Z msweet $" * * LIBUSB interface code for CUPS. * @@ -230,6 +230,7 @@ static const struct quirk_printer_struct quirk_printers[] = { { 0x04a9, 0x3256, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP810 */ { 0x04a9, 0x30F5, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP500 */ { 0x04a9, 0x31AF, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES3 */ + { 0x04a9, 0x31DD, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */ /* MISSING PIDs: CP520, CP530, CP790 */ { 0, 0 } }; @@ -898,7 +899,8 @@ find_device(usb_cb_t cb, /* I - Callback function */ /* Pointer to current alternate setting */ const struct libusb_endpoint_descriptor *endpptr = NULL; /* Pointer to current endpoint */ - ssize_t numdevs, /* number of connected devices */ + ssize_t err = 0, /* Error code */ + numdevs, /* number of connected devices */ i = 0; uint8_t conf, /* Current configuration */ iface, /* Current interface */ @@ -917,7 +919,14 @@ find_device(usb_cb_t cb, /* I - Callback function */ * Initialize libusb... */ - libusb_init(NULL); + err = libusb_init(NULL); + if (err) + { + fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, " + "libusb error %i\n", err); + return (NULL); + } + numdevs = libusb_get_device_list(NULL, &list); fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs); @@ -1087,7 +1096,8 @@ find_device(usb_cb_t cb, /* I - Callback function */ * Clean up .... */ - libusb_free_device_list(list, 1); + if (numdevs >= 0) + libusb_free_device_list(list, 1); libusb_exit(NULL); return (NULL); @@ -1972,6 +1982,6 @@ static void soft_reset(void) /* - * End of "$Id: usb-libusb.c 10948 2013-04-18 14:18:34Z mike $". + * End of "$Id: usb-libusb.c 10977 2013-05-13 16:46:08Z msweet $". */ diff --git a/backend/usb-unix.c b/backend/usb-unix.c index fd02ee98..20338004 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-unix.c 10632 2012-10-01 04:07:51Z mike $" + * "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $" * * USB port backend for CUPS. * @@ -612,5 +612,5 @@ side_cb(int print_fd, /* I - Print file */ /* - * End of "$Id: usb-unix.c 10632 2012-10-01 04:07:51Z mike $". + * End of "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $". */ diff --git a/backend/usb.c b/backend/usb.c index 1cacb82a..3ccbc009 100644 --- a/backend/usb.c +++ b/backend/usb.c @@ -1,5 +1,5 @@ /* - * "$Id: usb.c 10264 2012-02-12 07:18:31Z mike $" + * "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $" * * USB port backend for CUPS. * @@ -260,5 +260,5 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ /* - * End of "$Id: usb.c 10264 2012-02-12 07:18:31Z mike $". + * End of "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $". */ |