From 757d2cad8f3f75c420ad2e462b787cd9cf8a7a62 Mon Sep 17 00:00:00 2001 From: jlovell Date: Wed, 8 Mar 2006 00:32:35 +0000 Subject: [PATCH] Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@80 a1ca3aef-8c08-0410-bb20-df032aa958be --- Makedefs.in | 5 +- Makefile | 80 +- backend/Makefile | 17 +- backend/ieee1394.c | 8 +- backend/ipp.c | 11 +- backend/lpd.c | 16 +- backend/parallel.c | 8 +- backend/scsi-irix.c | 8 +- backend/scsi-linux.c | 8 +- backend/serial.c | 8 +- backend/socket.c | 8 +- backend/usb-darwin.c | 9 +- backend/usb-unix.c | 8 +- berkeley/Makefile | 17 +- berkeley/lpr.c | 6 +- cgi-bin/Makefile | 15 +- cgi-bin/admin.c | 1020 +++--------------- cgi-bin/ipp-var.c | 6 +- conf/Makefile | 28 +- conf/client.conf | 67 -- config-scripts/cups-common.m4 | 5 +- cups/Dependencies | 51 +- cups/Makefile | 41 +- cups/adminutil.c | 1900 +++++++++++++++++++++++++++++++++ cups/adminutil.h | 89 ++ cups/cups.h | 8 +- cups/emit.c | 857 ++++++++------- cups/encode.c | 6 +- cups/getputfile.c | 10 +- cups/globals.c | 8 +- cups/globals.h | 14 +- cups/http-addr.c | 44 +- cups/http.c | 6 +- cups/http.h | 6 +- cups/i18n.h | 8 +- cups/ipp-private.h | 8 +- cups/ipp.c | 116 +- cups/language.c | 180 ++-- cups/libcups_s.exp | 30 +- cups/mark.c | 76 +- cups/md5-apple.h | 10 +- cups/md5.c | 12 +- cups/md5.h | 8 +- cups/md5passwd.c | 22 +- cups/page.c | 42 +- cups/ppd.c | 80 +- cups/ppd.h | 6 +- cups/string.c | 203 +++- cups/string.h | 21 +- cups/testadmin.c | 129 +++ cups/testhttp.c | 6 +- cups/util.c | 6 +- data/Makefile | 36 +- doc/Makefile | 41 +- doc/cups-printable.css | 4 + doc/cups.css | 4 + doc/help/cgi.html | 91 ++ doc/help/ref-cupsd-conf.html | 1 + doc/help/whatsnew.html | 632 ++++++++--- doc/index.html.in | 14 +- doc/ja/index.html.in | 14 +- filter/Makefile | 29 +- fonts/Makefile | 22 +- locale/Makefile | 16 +- locale/cups.pot | 125 ++- locale/cups_ja.po | 139 ++- man/Makefile | 29 +- monitor/Makefile | 16 +- notifier/Makefile | 16 +- notifier/mailto.c | 9 +- packaging/LICENSE.rtf | 4 +- packaging/installer.tif | Bin 6580 -> 6076 bytes packaging/installer.xcf.gz | Bin 7461 -> 7026 bytes pdftops/Makefile | 14 +- ppd/Makefile | 23 +- scheduler/Makefile | 29 +- scheduler/auth.c | 42 +- scheduler/conf.c | 12 +- scheduler/ipp.c | 60 +- scheduler/main.c | 6 +- scheduler/printers.c | 42 +- scheduler/sysman.c | 20 +- scripting/php/Dependencies | 8 +- scripting/php/Makefile | 19 +- standards/Makefile | 11 +- systemv/Dependencies | 8 +- systemv/Makefile | 27 +- systemv/cupsaddsmb.c | 896 ++-------------- systemv/lp.c | 6 +- templates/Makefile | 28 +- templates/admin.tmpl | 2 +- templates/edit-config.tmpl.in | 4 +- test/Makefile | 13 +- tools/testosx | 14 +- 94 files changed, 4850 insertions(+), 3037 deletions(-) delete mode 100644 conf/client.conf create mode 100644 cups/adminutil.c create mode 100644 cups/adminutil.h create mode 100644 cups/testadmin.c create mode 100644 doc/help/cgi.html diff --git a/Makedefs.in b/Makedefs.in index 4520f8b2f..fc84a5354 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -1,5 +1,5 @@ # -# "$Id: Makedefs.in 5194 2006-02-27 20:57:07Z mike $" +# "$Id: Makedefs.in 5229 2006-03-05 16:48:12Z mike $" # # Common makefile definitions for the Common UNIX Printing System (CUPS). # @@ -40,6 +40,7 @@ MV = @MV@ PHPCONFIG = @PHPCONFIG@ RANLIB = @RANLIB@ RM = @RM@ -f +RMDIR = @RMDIR@ SED = @SED@ SHELL = /bin/sh STRIP = @STRIP@ @@ -215,5 +216,5 @@ DBUSDIR = @DBUSDIR@ # -# End of "$Id: Makedefs.in 5194 2006-02-27 20:57:07Z mike $" +# End of "$Id: Makedefs.in 5229 2006-03-05 16:48:12Z mike $" # diff --git a/Makefile b/Makefile index 3535a9fde..2913b9831 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5217 2006-03-02 21:24:01Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Top-level Makefile for the Common UNIX Printing System (CUPS). # @@ -30,7 +30,8 @@ include Makedefs DIRS = cups backend berkeley cgi-bin filter locale man monitor \ notifier pdftops scheduler systemv test \ - $(PHPDIR) + $(PHPDIR) \ + conf data doc fonts ppd templates # @@ -76,32 +77,20 @@ install: installhdrs echo Installing in $$dir... ;\ (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\ done - echo Installing in conf... - (cd conf; $(MAKE) $(MFLAGS) install) - echo Installing in data... - (cd data; $(MAKE) $(MFLAGS) install) - echo Installing in doc... - (cd doc; $(MAKE) $(MFLAGS) install) - echo Installing in fonts... - (cd fonts; $(MAKE) $(MFLAGS) install) - echo Installing in ppd... - (cd ppd; $(MAKE) $(MFLAGS) install) - echo Installing in templates... - (cd templates; $(MAKE) $(MFLAGS) install) echo Installing cups-config script... - $(INSTALL_DIR) $(BINDIR) + $(INSTALL_DIR) -m 755 $(BINDIR) $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config echo Installing startup script... if test "x$(INITDIR)" != "x"; then \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/init.d; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc2.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc3.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc5.d; \ $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ fi if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \ @@ -109,7 +98,7 @@ install: installhdrs if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ $(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \ $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ - $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ @@ -119,7 +108,7 @@ install: installhdrs fi if test "x$(DBUSDIR)" != "x"; then \ echo Installing cups.conf in $(DBUSDIR)...;\ - $(INSTALL_DIR) $(BUILDROOT)$(DBUSDIR); \ + $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR); \ $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/cups.conf; \ fi @@ -136,6 +125,51 @@ installhdrs: (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1; +# +# Uninstall object and target files... +# + +uninstall: + for dir in $(DIRS); do\ + echo Uninstalling in $$dir... ;\ + (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ + done + echo Uninstalling cups-config script... + $(RM) $(BINDIR)/cups-config + -$(RMDIR) $(BINDIR) + echo Uninstalling startup script... + if test "x$(INITDIR)" != "x"; then \ + $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \ + $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \ + $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ + $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ + $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ + $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ + $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ + $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ + $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ + $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ + fi + if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \ + if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ + $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \ + $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ + $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ + $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ + elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ + $(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ + else \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ + fi \ + $(RMDIR) $(BUILDROOT)$(INITDDIR); \ + fi + if test "x$(DBUSDIR)" != "x"; then \ + echo Uninstalling cups.conf in $(DBUSDIR)...;\ + $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ + $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ + fi + + # # Run the test suite... # @@ -159,5 +193,5 @@ epm: # -# End of "$Id: Makefile 5217 2006-03-02 21:24:01Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/backend/Makefile b/backend/Makefile index bebaa471d..4267f21e5 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5131 2006-02-18 05:31:36Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Backend makefile for the Common UNIX Printing System (CUPS). # @@ -72,6 +72,19 @@ install: all $(LN) ipp $(SERVERBIN)/backend/http +# +# Uninstall all targets... +# + +uninstall: + for file in $(RBACKENDS) $(UBACKENDS); do \ + $(RM) $(SERVERBIN)/backend/$$file; \ + done + $(RM) $(SERVERBIN)/backend/http + -$(RMDIR) $(SERVERBIN)/backend + -$(RMDIR) $(SERVERBIN) + + # # betest # @@ -179,5 +192,5 @@ include Dependencies # -# End of "$Id: Makefile 5131 2006-02-18 05:31:36Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/backend/ieee1394.c b/backend/ieee1394.c index 0be210581..3d88c7a08 100644 --- a/backend/ieee1394.c +++ b/backend/ieee1394.c @@ -1,5 +1,5 @@ /* - * "$Id: ieee1394.c 4494 2005-02-18 02:18:11Z mike $" + * "$Id: ieee1394.c 5241 2006-03-07 22:07:44Z mike $" * * IEEE-1394 backend for the Common UNIX Printing System (CUPS). * @@ -140,6 +140,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Try to open the printer device... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((dev = ieee1394_open(argv[0])) == NULL) @@ -150,6 +152,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ } while (dev == NULL); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Now that we are "connected" to the port, ignore SIGTERM so that we * can finish out any page data the driver sends (e.g. to eject the @@ -259,5 +263,5 @@ list_devices(void) /* - * End of "$Id: ieee1394.c 4494 2005-02-18 02:18:11Z mike $". + * End of "$Id: ieee1394.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/ipp.c b/backend/ipp.c index 07699d655..878f634e1 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 5180 2006-02-26 01:31:45Z mike $" + * "$Id: ipp.c 5241 2006-03-07 22:07:44Z mike $" * * IPP backend for the Common UNIX Printing System (CUPS). * @@ -507,6 +507,8 @@ main(int argc, /* I - Number of command-line args */ * Try connecting to the remote server... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { fprintf(stderr, "INFO: Connecting to %s on port %d...\n", hostname, port); @@ -563,6 +565,7 @@ main(int argc, /* I - Number of command-line args */ } while (http == NULL); + fputs("STATE: -connecting-to-device\n", stderr); fprintf(stderr, "INFO: Connected to %s...\n", hostname); /* @@ -1242,8 +1245,8 @@ compress_files(int num_files, /* I - Number of files */ while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0) if (cupsFileWrite(out, buffer, bytes) < bytes) { - fprintf(stderr, "ERROR: Unable to write %d bytes to \"%s\": %s\n", - bytes, filename, strerror(errno)); + fprintf(stderr, "ERROR: Unable to write " CUPS_LLFMT " bytes to \"%s\": %s\n", + CUPS_LLCAST bytes, filename, strerror(errno)); cupsFileClose(in); cupsFileClose(out); exit(CUPS_BACKEND_FAILED); @@ -1615,5 +1618,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: ipp.c 5180 2006-02-26 01:31:45Z mike $". + * End of "$Id: ipp.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/lpd.c b/backend/lpd.c index 30dea2372..5a2f1c313 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -1,5 +1,5 @@ /* - * "$Id: lpd.c 5023 2006-01-29 14:39:44Z mike $" + * "$Id: lpd.c 5241 2006-03-07 22:07:44Z mike $" * * Line Printer Daemon backend for the Common UNIX Printing System (CUPS). * @@ -644,6 +644,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ * First try to reserve a port for this connection... */ + fputs("STATE: +connecting-to-device\n", stderr); fprintf(stderr, "INFO: Attempting to connect to host %s for printer %s\n", hostname, printer); @@ -769,12 +770,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ #ifdef __APPLE__ recoverable = 1; fprintf(stderr, "WARNING: recoverable: " + "Network host \'%s\' is busy, down, or " + "unreachable; will retry in 30 seconds...\n", + hostname); #else fprintf(stderr, "WARNING: " -#endif /* __APPLE__ */ "Network host \'%s\' is busy, down, or " "unreachable; will retry in 30 seconds...\n", hostname); +#endif /* __APPLE__ */ sleep(30); } else if (error == EADDRINUSE) @@ -790,10 +794,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ #ifdef __APPLE__ recoverable = 1; perror("ERROR: recoverable: " + "Unable to connect to printer; will retry in 30 seconds..."); #else perror("ERROR: " -#endif /* __APPLE__ */ "Unable to connect to printer; will retry in 30 seconds..."); +#endif /* __APPLE__ */ sleep(30); } } @@ -812,6 +817,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ } #endif /* __APPLE__ */ + fputs("STATE: -connecting-to-device\n", stderr); fprintf(stderr, "INFO: Connected to %s...\n", hostname); fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port, lport); @@ -853,7 +859,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ return (CUPS_BACKEND_FAILED); } - httpGetHostname(localhost, sizeof(localhost)); + httpGetHostname(NULL, localhost, sizeof(localhost)); snprintf(control, sizeof(control), "H%.31s\n" /* RFC 1179, Section 7.2 - host name <= 31 chars */ @@ -1224,5 +1230,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: lpd.c 5023 2006-01-29 14:39:44Z mike $". + * End of "$Id: lpd.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/parallel.c b/backend/parallel.c index 3731b378c..6acb8134f 100644 --- a/backend/parallel.c +++ b/backend/parallel.c @@ -1,5 +1,5 @@ /* - * "$Id: parallel.c 5194 2006-02-27 20:57:07Z mike $" + * "$Id: parallel.c 5241 2006-03-07 22:07:44Z mike $" * * Parallel port backend for the Common UNIX Printing System (CUPS). * @@ -202,6 +202,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Open the parallel port device... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((fd = open(resource, O_WRONLY | O_EXCL)) == -1) @@ -247,6 +249,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ } while (fd < 0); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Set any options provided... */ @@ -733,5 +737,5 @@ list_devices(void) /* - * End of "$Id: parallel.c 5194 2006-02-27 20:57:07Z mike $". + * End of "$Id: parallel.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/scsi-irix.c b/backend/scsi-irix.c index 097071c23..cec216e87 100644 --- a/backend/scsi-irix.c +++ b/backend/scsi-irix.c @@ -1,5 +1,5 @@ /* - * "$Id: scsi-irix.c 4703 2005-09-26 19:33:58Z mike $" + * "$Id: scsi-irix.c 5241 2006-03-07 22:07:44Z mike $" * * IRIX SCSI printer support for the Common UNIX Printing System (CUPS). * @@ -103,6 +103,8 @@ print_device(const char *resource, /* I - SCSI device */ * Open the SCSI device file... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((scsi_fd = open(resource, O_RDWR | O_EXCL)) == -1) @@ -144,6 +146,8 @@ print_device(const char *resource, /* I - SCSI device */ } while (scsi_fd == -1); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Now that we are "connected" to the port, ignore SIGTERM so that we * can finish out any page data the driver sends (e.g. to eject the @@ -227,5 +231,5 @@ print_device(const char *resource, /* I - SCSI device */ /* - * End of "$Id: scsi-irix.c 4703 2005-09-26 19:33:58Z mike $". + * End of "$Id: scsi-irix.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/scsi-linux.c b/backend/scsi-linux.c index b5c1d1bef..75c9629dc 100644 --- a/backend/scsi-linux.c +++ b/backend/scsi-linux.c @@ -1,5 +1,5 @@ /* - * "$Id: scsi-linux.c 4703 2005-09-26 19:33:58Z mike $" + * "$Id: scsi-linux.c 5241 2006-03-07 22:07:44Z mike $" * * Linux SCSI printer support for the Common UNIX Printing System (CUPS). * @@ -116,6 +116,8 @@ print_device(const char *resource, /* I - SCSI device */ * Open the SCSI device file... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((scsi_fd = open(resource, O_RDWR | O_EXCL)) == -1) @@ -157,6 +159,8 @@ print_device(const char *resource, /* I - SCSI device */ } while (scsi_fd == -1); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Now that we are "connected" to the port, ignore SIGTERM so that we * can finish out any page data the driver sends (e.g. to eject the @@ -245,5 +249,5 @@ print_device(const char *resource, /* I - SCSI device */ /* - * End of "$Id: scsi-linux.c 4703 2005-09-26 19:33:58Z mike $". + * End of "$Id: scsi-linux.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/serial.c b/backend/serial.c index 7d8abe786..17de8d8d3 100644 --- a/backend/serial.c +++ b/backend/serial.c @@ -1,5 +1,5 @@ /* - * "$Id: serial.c 5194 2006-02-27 20:57:07Z mike $" + * "$Id: serial.c 5241 2006-03-07 22:07:44Z mike $" * * Serial port backend for the Common UNIX Printing System (CUPS). * @@ -223,6 +223,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Open the serial port device... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((fd = open(resource, O_WRONLY | O_NOCTTY | O_EXCL | O_NDELAY)) == -1) @@ -263,6 +265,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ } while (fd < 0); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Set any options provided... */ @@ -1130,5 +1134,5 @@ list_devices(void) /* - * End of "$Id: serial.c 5194 2006-02-27 20:57:07Z mike $". + * End of "$Id: serial.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/socket.c b/backend/socket.c index ab541be60..1833be6fc 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -1,5 +1,5 @@ /* - * "$Id: socket.c 5099 2006-02-13 02:46:10Z mike $" + * "$Id: socket.c 5241 2006-03-07 22:07:44Z mike $" * * AppSocket backend for the Common UNIX Printing System (CUPS). * @@ -256,6 +256,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ while (copies > 0) { + fputs("STATE: +connecting-to-device\n", stderr); + for (delay = 5;;) { if (!httpAddrConnect(addrlist, &fd)) @@ -304,6 +306,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ break; } + fputs("STATE: -connecting-to-device\n", stderr); + /* * Now that we are "connected" to the port, ignore SIGTERM so that we * can finish out any page data the driver sends (e.g. to eject the @@ -488,5 +492,5 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ /* - * End of "$Id: socket.c 5099 2006-02-13 02:46:10Z mike $". + * End of "$Id: socket.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 5c2ee4f4f..11009b27a 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-darwin.c 4548 2005-06-27 02:33:50Z mike $" + * "$Id: usb-darwin.c 5241 2006-03-07 22:07:44Z mike $" * * USB port on Darwin backend for the Common UNIX Printing System (CUPS). * @@ -674,6 +674,9 @@ int print_device(const char *uri, const char *hostname, const char *resource, co USBPrinterInfo *activePrinter = NULL; USBPrinterClassContext **classdriver; int countdown = INITIAL_LOG_INTERVAL; + + fputs("STATE: +connecting-to-device\n", stderr); + do { /* */ @@ -746,6 +749,8 @@ int print_device(const char *uri, const char *hostname, const char *resource, co return (status); } + fputs("STATE: -connecting-to-device\n", stderr); + /* * Now that we are "connected" to the port, ignore SIGTERM so that we * can finish out any page data the driver sends (e.g. to eject the @@ -1895,5 +1900,5 @@ static CFStringRef CreateEncodedCFString(CFStringRef string) } /* - * End of "$Id: usb-darwin.c 4548 2005-06-27 02:33:50Z mike $". + * End of "$Id: usb-darwin.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/backend/usb-unix.c b/backend/usb-unix.c index b28222202..e034a0a2c 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-unix.c 5162 2006-02-24 03:15:13Z mike $" + * "$Id: usb-unix.c 5241 2006-03-07 22:07:44Z mike $" * * USB port backend for the Common UNIX Printing System (CUPS). * @@ -82,6 +82,8 @@ print_device(const char *uri, /* I - Device URI */ * Open the USB port device... */ + fputs("STATE: +connecting-to-device\n", stderr); + do { if ((fd = open_device(uri)) == -1) @@ -127,6 +129,8 @@ print_device(const char *uri, /* I - Device URI */ } while (fd < 0); + fputs("STATE: -connecting-to-device\n", stderr); + /* * Set any options provided... */ @@ -616,5 +620,5 @@ open_device(const char *uri) /* I - Device URI */ /* - * End of "$Id: usb-unix.c 5162 2006-02-24 03:15:13Z mike $". + * End of "$Id: usb-unix.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/berkeley/Makefile b/berkeley/Makefile index 6f438cda3..eb16d025c 100644 --- a/berkeley/Makefile +++ b/berkeley/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Berkeley commands makefile for the Common UNIX Printing System (CUPS). # @@ -64,6 +64,19 @@ install: all $(INSTALL_BIN) lpc $(SBINDIR) +# +# Uninstall all targets... +# + +uninstall: + $(RM) $(BINDIR)/lpq + $(RM) $(BINDIR)/lpr + $(RM) $(BINDIR)/lprm + $(RM) $(SBINDIR)/lpc + -$(RMDIR) $(SBINDIR) + -$(RMDIR) $(BINDIR) + + # # lpc # @@ -108,5 +121,5 @@ include Dependencies # -# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/berkeley/lpr.c b/berkeley/lpr.c index c909892e3..f6b5fb3b7 100644 --- a/berkeley/lpr.c +++ b/berkeley/lpr.c @@ -1,5 +1,5 @@ /* - * "$Id: lpr.c 4974 2006-01-25 07:04:33Z mike $" + * "$Id: lpr.c 5235 2006-03-06 13:02:23Z mike $" * * "lpr" command for the Common UNIX Printing System (CUPS). * @@ -231,7 +231,7 @@ main(int argc, /* I - Number of command-line arguments */ snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(), - httpGetHostname(buffer, sizeof(buffer))); + httpGetHostname(NULL, buffer, sizeof(buffer))); num_options = cupsAddOption("notify-recipient", email, num_options, &options); } @@ -529,5 +529,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lpr.c 4974 2006-01-25 07:04:33Z mike $". + * End of "$Id: lpr.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile index 7cce230f8..9497bb59f 100644 --- a/cgi-bin/Makefile +++ b/cgi-bin/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5145 2006-02-22 00:25:14Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # CGI makefile for the Common UNIX Printing System (CUPS). # @@ -65,6 +65,17 @@ install: all done +# +# Uninstall all targets... +# + +uninstall: + for file in $(CGIS); do \ + $(RM) $(SERVERBIN)/cgi-bin/$$file; \ + done + -$(RMDIR) $(SERVERBIN)/cgi-bin + + # # libcgi.a # @@ -159,5 +170,5 @@ include Dependencies # -# End of "$Id: Makefile 5145 2006-02-22 00:25:14Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 3547ee5fd..0b8597b67 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,5 +1,5 @@ /* - * "$Id: admin.c 5107 2006-02-15 19:14:17Z mike $" + * "$Id: admin.c 5240 2006-03-07 21:55:29Z mike $" * * Administration CGI for the Common UNIX Printing System (CUPS). * @@ -43,6 +43,7 @@ */ #include "cgi-private.h" +#include #include #include #include @@ -1574,586 +1575,45 @@ do_config_server(http_t *http) /* I - HTTP connection */ * Save basic setting changes... */ - http_status_t status; /* PUT status */ - cups_file_t *cupsd; /* cupsd.conf file */ - char tempfile[1024]; /* Temporary new cupsd.conf */ - int tempfd; /* Temporary file descriptor */ - cups_file_t *temp; /* Temporary file */ - char line[1024], /* Line from cupsd.conf file */ - *value; /* Value on line */ - const char *server_root; /* Location of config files */ - int linenum, /* Line number in file */ - in_policy, /* In a policy section? */ - in_cancel_job, /* In a cancel-job section? */ - in_admin_location, /* In the /admin location? */ - in_conf_location, /* In the /admin/conf location? */ - in_root_location; /* In the / location? */ - int remote_printers, /* Show remote printers */ - share_printers, /* Share local printers */ - remote_admin, /* Remote administration allowed? */ - user_cancel_any, /* Cancel-job policy set? */ - debug_logging; /* LogLevel debug set? */ - int wrote_port_listen, /* Wrote the port/listen lines? */ - wrote_browsing, /* Wrote the browsing lines? */ - wrote_policy, /* Wrote the policy? */ - wrote_loglevel, /* Wrote the LogLevel line? */ - wrote_admin_location, /* Wrote the /admin location? */ - wrote_conf_location, /* Wrote the /admin/conf location? */ - wrote_root_location; /* Wrote the / location? */ - int indent; /* Indentation */ - - - /* - * Get form variables... - */ - - remote_printers = cgiGetVariable("REMOTE_PRINTERS") != NULL; - share_printers = cgiGetVariable("SHARE_PRINTERS") != NULL; - remote_admin = cgiGetVariable("REMOTE_ADMIN") != NULL; - user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") != NULL; - debug_logging = cgiGetVariable("DEBUG_LOGGING") != NULL; - - /* - * Locate the cupsd.conf file... - */ - - if ((server_root = getenv("CUPS_SERVERROOT")) == NULL) - server_root = CUPS_SERVERROOT; - - snprintf(line, sizeof(line), "%s/cupsd.conf", server_root); - - /* - * Open the cupsd.conf file... - */ - - if ((cupsd = cupsFileOpen(line, "r")) == NULL) - { - /* - * Unable to open - log an error... - */ - - cgiStartHTML(cgiText(_("Change Settings"))); - cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); - cgiSetVariable("ERROR", strerror(errno)); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - - perror(line); - return; - } - - /* - * Create a temporary file for the new cupsd.conf file... - */ - - if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) - { - cgiStartHTML(cgiText(_("Change Settings"))); - cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); - cgiSetVariable("ERROR", strerror(errno)); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - - perror(tempfile); - cupsFileClose(cupsd); - return; - } - - if ((temp = cupsFileOpenFd(tempfd, "w")) == NULL) + int num_settings; /* Number of server settings */ + cups_option_t *settings; /* Server settings */ + + + num_settings = 0; + num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, + cgiGetVariable("DEBUG_LOGGING") ? "1" : "0", + num_settings, &settings); + num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, + cgiGetVariable("REMOTE_ADMIN") ? "1" : "0", + num_settings, &settings); + num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS, + cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0", + num_settings, &settings); + num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, + cgiGetVariable("SHARE_PRINTERS") ? "1" : "0", + num_settings, &settings); + num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, + cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0", + num_settings, &settings); + + + if (!_cupsAdminSetServerSettings(http, num_settings, settings)) { cgiStartHTML(cgiText(_("Change Settings"))); cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); - cgiSetVariable("ERROR", strerror(errno)); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - - perror(tempfile); - close(tempfd); - unlink(tempfile); - cupsFileClose(cupsd); - return; - } - - /* - * Copy the old file to the new, making changes along the way... - */ - - in_admin_location = 0; - in_cancel_job = 0; - in_conf_location = 0; - in_policy = 0; - in_root_location = 0; - linenum = 0; - wrote_admin_location = 0; - wrote_browsing = 0; - wrote_conf_location = 0; - wrote_loglevel = 0; - wrote_policy = 0; - wrote_port_listen = 0; - wrote_root_location = 0; - indent = 0; - - while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) - { - if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) - { - if (!wrote_port_listen) - { - wrote_port_listen = 1; - - if (share_printers || remote_admin) - { - cupsFilePuts(temp, "# Allow remote access\n"); - cupsFilePrintf(temp, "Listen *:%d\n", ippPort()); - } - else - { - cupsFilePuts(temp, "# Only listen for connections from the local machine.\n"); - cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort()); - } - -#ifdef CUPS_DEFAULT_DOMAINSOCKET - cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n"); -#endif /* CUPS_DEFAULT_DOMAINSOCKET */ - } - } - else if (!strcasecmp(line, "Browsing") || - !strcasecmp(line, "BrowseAddress") || - !strcasecmp(line, "BrowseAllow") || - !strcasecmp(line, "BrowseDeny") || - !strcasecmp(line, "BrowseOrder")) - { - if (!wrote_browsing) - { - wrote_browsing = 1; - - if (remote_printers || share_printers) - { - if (remote_printers && share_printers) - cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n"); - else if (remote_printers) - cupsFilePuts(temp, "# Show shared printers on the local network.\n"); - else - cupsFilePuts(temp, "# Share local printers on the local network.\n"); - - cupsFilePuts(temp, "Browsing On\n"); - cupsFilePuts(temp, "BrowseOrder allow,deny\n"); - - if (remote_printers) - cupsFilePuts(temp, "BrowseAllow @LOCAL\n"); - - if (share_printers) - cupsFilePuts(temp, "BrowseAddress @LOCAL\n"); - } - else - { - cupsFilePuts(temp, "# Disable printer sharing and shared printers.\n"); - cupsFilePuts(temp, "Browsing Off\n"); - } - } - } - else if (!strcasecmp(line, "LogLevel")) - { - wrote_loglevel = 1; - - if (debug_logging) - { - cupsFilePuts(temp, "# Show troubleshooting information in error_log.\n"); - cupsFilePuts(temp, "LogLevel debug\n"); - } - else - { - cupsFilePuts(temp, "# Show general information in error_log.\n"); - cupsFilePuts(temp, "LogLevel info\n"); - } - } - else if (!strcasecmp(line, "\n", line, value); - indent += 2; - } - else if (!strcasecmp(line, "")) - { - indent -= 2; - if (!wrote_policy) - { - wrote_policy = 1; - - if (!user_cancel_any) - cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" - " \n" - " Order deny,allow\n" - " Allow @SYSTEM\n" - " Allow @OWNER\n" - " \n"); - } - - in_policy = 0; - - cupsFilePuts(temp, "\n"); - } - else if (!strcasecmp(line, "\n", line, value); - } - else if (!strcasecmp(line, "")) - { - indent -= 2; - if (in_admin_location) - { - wrote_admin_location = 1; - - if (remote_admin) - cupsFilePuts(temp, " # Allow remote administration...\n"); - else - cupsFilePuts(temp, " # Restrict access to the admin pages...\n"); - - cupsFilePuts(temp, " Order allow,deny\n"); - - if (remote_admin) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - } - else if (in_conf_location) - { - wrote_conf_location = 1; - - if (remote_admin) - cupsFilePuts(temp, " # Allow remote access to the configuration files...\n"); - else - cupsFilePuts(temp, " # Restrict access to the configuration files...\n"); - - cupsFilePuts(temp, " Order allow,deny\n"); - - if (remote_admin) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - } - else if (in_root_location) - { - wrote_root_location = 1; - - if (remote_admin && share_printers) - cupsFilePuts(temp, " # Allow shared printing and remote administration...\n"); - else if (remote_admin) - cupsFilePuts(temp, " # Allow remote administration...\n"); - else if (share_printers) - cupsFilePuts(temp, " # Allow shared printing...\n"); - else - cupsFilePuts(temp, " # Restrict access to the server...\n"); - - cupsFilePuts(temp, " Order allow,deny\n"); - - if (remote_admin || share_printers) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - } - - in_admin_location = 0; - in_conf_location = 0; - in_root_location = 0; - - cupsFilePuts(temp, "\n"); - } - else if (!strcasecmp(line, "\n"); - } - } - else if (!strcasecmp(line, "") && in_cancel_job) - { - indent -= 2; - - if (in_cancel_job == 1) - cupsFilePuts(temp, " \n"); - - wrote_policy = 1; - - if (!user_cancel_any) - cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" - " \n" - " Order deny,allow\n" - " Require user @OWNER @SYSTEM\n" - " \n"); - - in_cancel_job = 0; - } - else if ((in_admin_location || in_conf_location || in_root_location) && - (!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") || - !strcasecmp(line, "Order"))) - continue; - else if (in_cancel_job == 2) - continue; - else if (!strcasecmp(line, "\n", line, value); - else if (line[0] == '<') - { - if (value) - { - cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value); - indent += 2; - } - else - { - if (line[1] == '/') - indent -= 2; - - cupsFilePrintf(temp, "%*s%s\n", indent, "", line); - } - } - else if (value) - cupsFilePrintf(temp, "%*s%s %s\n", indent, "", line, value); - else - cupsFilePrintf(temp, "%*s%s\n", indent, "", line); - } - - /* - * Write any missing info... - */ - - if (!wrote_browsing) - { - if (remote_printers || share_printers) - { - if (remote_printers && share_printers) - cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n"); - else if (remote_printers) - cupsFilePuts(temp, "# Show shared printers on the local network.\n"); - else - cupsFilePuts(temp, "# Share local printers on the local network.\n"); - - cupsFilePuts(temp, "Browsing On\n"); - cupsFilePuts(temp, "BrowseOrder allow,deny\n"); - - if (remote_printers) - cupsFilePuts(temp, "BrowseAllow @LOCAL\n"); - - if (share_printers) - cupsFilePuts(temp, "BrowseAddress @LOCAL\n"); - } - else - { - cupsFilePuts(temp, "# Disable printer sharing and shared printers.\n"); - cupsFilePuts(temp, "Browsing Off\n"); - } - } - - if (!wrote_loglevel) - { - if (debug_logging) - { - cupsFilePuts(temp, "# Show troubleshooting information in error_log.\n"); - cupsFilePuts(temp, "LogLevel debug\n"); - } - else - { - cupsFilePuts(temp, "# Show general information in error_log.\n"); - cupsFilePuts(temp, "LogLevel info\n"); - } - } - - if (!wrote_port_listen) - { - if (share_printers || remote_admin) - { - cupsFilePuts(temp, "# Allow remote access\n"); - cupsFilePrintf(temp, "Listen *:%d\n", ippPort()); - } - else - { - cupsFilePuts(temp, "# Only listen for connections from the local machine.\n"); - cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort()); - } - -#ifdef CUPS_DEFAULT_DOMAINSOCKET - cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n"); -#endif /* CUPS_DEFAULT_DOMAINSOCKET */ - } - - if (!wrote_root_location) - { - if (remote_admin && share_printers) - cupsFilePuts(temp, "# Allow shared printing and remote administration...\n"); - else if (remote_admin) - cupsFilePuts(temp, "# Allow remote administration...\n"); - else if (share_printers) - cupsFilePuts(temp, "# Allow shared printing...\n"); - else - cupsFilePuts(temp, "# Restrict access to the server...\n"); - - cupsFilePuts(temp, "\n" - " Order allow,deny\n"); - - if (remote_admin || share_printers) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - - cupsFilePuts(temp, "\n"); - } - - if (!wrote_admin_location) - { - if (remote_admin) - cupsFilePuts(temp, "# Allow remote administration...\n"); - else - cupsFilePuts(temp, "# Restrict access to the admin pages...\n"); - - cupsFilePuts(temp, "\n" - " Order allow,deny\n"); - - if (remote_admin) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - - cupsFilePuts(temp, "\n"); - } - - if (!wrote_conf_location) - { - if (remote_admin) - cupsFilePuts(temp, "# Allow remote access to the configuration files...\n"); - else - cupsFilePuts(temp, "# Restrict access to the configuration files...\n"); - - cupsFilePuts(temp, "\n" - " AuthType Basic\n" - " Require user @SYSTEM\n" - " Order allow,deny\n"); - - if (remote_admin) - cupsFilePuts(temp, " Allow @LOCAL\n"); - else - cupsFilePuts(temp, " Allow localhost\n"); - - cupsFilePuts(temp, "\n"); - } - - if (!wrote_policy) - { - cupsFilePuts(temp, "\n" - " # Job-related operations must be done by the owner or an adminstrator...\n" - " \n" - " Require user @OWNER @SYSTEM\n" - " Order deny,allow\n" - " \n" - " # All administration operations require an adminstrator to authenticate...\n" - " \n" - " AuthType Basic\n" - " Require user @SYSTEM\n" - " Order deny,allow\n" - "\n"); - - if (!user_cancel_any) - cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" - " \n" - " Require user @OWNER @SYSTEM\n" - " Order deny,allow\n" - " \n"); - - cupsFilePuts(temp, " \n" - " Order deny,allow\n" - " \n" - "\n"); - } - - cupsFileClose(cupsd); - cupsFileClose(temp); - - /* - * Upload the configuration file to the server... - */ - - status = cupsPutFile(http, "/admin/conf/cupsd.conf", tempfile); - - if (status != HTTP_CREATED) - { - cgiSetVariable("MESSAGE", cgiText(_("Unable to upload cupsd.conf file:"))); - cgiSetVariable("ERROR", httpStatus(status)); - cgiStartHTML(cgiText(_("Change Settings"))); + cgiSetVariable("ERROR", cupsLastErrorString()); cgiCopyTemplateLang("error.tmpl"); } else { cgiSetVariable("refresh_page", "5;/admin/?OP=redirect"); - cgiStartHTML(cgiText(_("Change Settings"))); cgiCopyTemplateLang("restart.tmpl"); } - cgiEndHTML(); + cupsFreeOptions(num_settings, settings); - unlink(tempfile); + cgiEndHTML(); } else if (cgiIsPOST()) { @@ -2482,14 +1942,11 @@ do_export(http_t *http) /* I - HTTP connection */ *export_all; /* Export all printers? */ int export_count, /* Number of printers to export */ printer_count; /* Number of available printers */ + const char *name, /* What name to pull */ + *dest; /* Current destination */ + char ppd[1024]; /* PPD file */ - /* - * Show header... - */ - - cgiStartHTML(cgiText(_("Export Printers to Samba"))); - /* * Get form data... */ @@ -2499,163 +1956,6 @@ do_export(http_t *http) /* I - HTTP connection */ export_all = cgiGetVariable("EXPORT_ALL"); export_count = cgiGetSize("EXPORT_NAME"); - if (username && *username && password && *password && export_count <= 1000) - { - /* - * Do export... - */ - - char userpass[1024], /* Username%password */ - *argv[1005]; /* Arguments */ - int argc; /* Number of arguments */ - int pid; /* Process ID of child */ - int status; /* Status of command */ - - - fputs("DEBUG: Export printers...\n", stderr); - - /* - * Create the command-line for cupsaddsmb... - */ - - snprintf(userpass, sizeof(userpass), "%s%%%s", username, password); - - argv[0] = "cupsaddsmb"; - argv[1] = "-v"; - argv[2] = "-U"; - argv[3] = userpass; - argc = 4; - - if (export_all) - argv[argc ++] = "-a"; - else - { - for (i = 0; i < export_count; i ++) - argv[argc ++] = (char *)cgiGetArray("EXPORT_NAME", i); - } - - argv[argc] = NULL; - - /* - * Run the command... - */ - - if ((pid = fork()) == 0) - { - /* - * Child goes here... - */ - - close(0); - open("/dev/null", O_RDONLY); - close(1); - dup(2); - - execvp("cupsaddsmb", argv); - perror("ERROR: Unable to execute cupsaddsmb"); - exit(20); - } - else if (pid < 0) - cgiSetVariable("ERROR", cgiText(_("Unable to fork process!"))); - else - { - /* - * Parent goes here, wait for child to finish... - */ - - while (wait(&status) < 0); - - if (status) - { - char message[1024]; /* Error message */ - - - if (WIFEXITED(status)) - { - switch (WEXITSTATUS(status)) - { - case 1 : - cgiSetVariable("ERROR", cgiText(_("Unable to connect to server!"))); - break; - - case 2 : - cgiSetVariable("ERROR", cgiText(_("Unable to get printer " - "attributes!"))); - break; - - case 3 : - cgiSetVariable("ERROR", cgiText(_("Unable to convert PPD file!"))); - break; - - case 4 : - cgiSetVariable("ERROR", cgiText(_("Unable to copy Windows 2000 " - "printer driver files!"))); - break; - - case 5 : - cgiSetVariable("ERROR", cgiText(_("Unable to install Windows " - "2000 printer driver files!"))); - break; - - case 6 : - cgiSetVariable("ERROR", cgiText(_("Unable to copy Windows 9x " - "printer driver files!"))); - break; - - case 7 : - cgiSetVariable("ERROR", cgiText(_("Unable to install Windows " - "9x printer driver files!"))); - break; - - case 8 : - cgiSetVariable("ERROR", cgiText(_("Unable to set Windows " - "printer driver!"))); - break; - - case 9 : - cgiSetVariable("ERROR", cgiText(_("No printer drivers found!"))); - break; - - case 20 : - cgiSetVariable("ERROR", cgiText(_("Unable to execute " - "cupsaddsmb command!"))); - break; - - default : - snprintf(message, sizeof(message), - cgiText(_("cupsaddsmb failed with status %d")), - WEXITSTATUS(status)); - - cgiSetVariable("ERROR", message); - break; - } - } - else - { - snprintf(message, sizeof(message), - cgiText(_("cupsaddsmb crashed on signal %d")), - WTERMSIG(status)); - - cgiSetVariable("ERROR", message); - } - } - else - { - cgiCopyTemplateLang("samba-exported.tmpl"); - cgiEndHTML(); - return; - } - } - } - else if (username && !*username) - cgiSetVariable("ERROR", - cgiText(_("A Samba username is required to export " - "printer drivers!"))); - else if (username && (!password || !*password)) - cgiSetVariable("ERROR", - cgiText(_("A Samba password is required to export " - "printer drivers!"))); - /* * Get list of available printers... */ @@ -2686,9 +1986,10 @@ do_export(http_t *http) /* I - HTTP connection */ for (i = 0; i < printer_count; i ++) { + dest = cgiGetArray("PRINTER_NAME", i); + for (j = 0; j < export_count; j ++) - if (!strcasecmp(cgiGetArray("PRINTER_NAME", i), - cgiGetArray("EXPORT_NAME", j))) + if (!strcasecmp(dest, cgiGetArray("EXPORT_NAME", j))) break; cgiSetArray("PRINTER_EXPORT", i, j < export_count ? "Y" : ""); @@ -2696,10 +1997,67 @@ do_export(http_t *http) /* I - HTTP connection */ } } + /* + * Export or get the printers to export... + */ + + if (username && *username && password && *password && + (export_all || export_count > 0)) + { + /* + * Do export... + */ + + fputs("DEBUG: Export printers...\n", stderr); + + if (export_all) + { + name = "PRINTER_NAME"; + export_count = cgiGetSize("PRINTER_NAME"); + } + else + name = "EXPORT_NAME"; + + for (i = 0; i < export_count; i ++) + { + dest = cgiGetArray(name, i); + + if (!cupsAdminCreateWindowsPPD(http, dest, ppd, sizeof(ppd))) + break; + + j = cupsAdminExportSamba(dest, ppd, "localhost", username, password, + stderr); + + unlink(ppd); + + if (!j) + break; + } + + if (i < export_count) + cgiSetVariable("ERROR", cupsLastErrorString()); + else + { + cgiStartHTML(cgiText(_("Export Printers to Samba"))); + cgiCopyTemplateLang("samba-exported.tmpl"); + cgiEndHTML(); + return; + } + } + else if (username && !*username) + cgiSetVariable("ERROR", + cgiText(_("A Samba username is required to export " + "printer drivers!"))); + else if (username && (!password || !*password)) + cgiSetVariable("ERROR", + cgiText(_("A Samba password is required to export " + "printer drivers!"))); + /* * Show form... */ + cgiStartHTML(cgiText(_("Export Printers to Samba"))); cgiCopyTemplateLang("samba-export.tmpl"); cgiEndHTML(); } @@ -2712,10 +2070,10 @@ do_export(http_t *http) /* I - HTTP connection */ static void do_menu(http_t *http) /* I - HTTP connection */ { - cups_file_t *cupsd; /* cupsd.conf file */ - char line[1024], /* Line from cupsd.conf file */ - *value; /* Value on line */ - const char *server_root; /* Location of config files */ + int num_settings; /* Number of server settings */ + cups_option_t *settings; /* Server settings */ + const char *val; /* Setting value */ + char filename[1024]; /* Temporary filename */ const char *datadir; /* Location of data files */ ipp_t *request, /* IPP request */ *response; /* IPP response */ @@ -2723,165 +2081,37 @@ do_menu(http_t *http) /* I - HTTP connection */ /* - * Locate the cupsd.conf file... + * Get the current server settings... */ - if ((server_root = getenv("CUPS_SERVERROOT")) == NULL) - server_root = CUPS_SERVERROOT; - - snprintf(line, sizeof(line), "%s/cupsd.conf", server_root); - - cgiStartHTML(cgiText(_("Administration"))); - - printf("\n", line); - - /* - * Open the cupsd.conf file... - */ - - if ((cupsd = cupsFileOpen(line, "r")) == NULL) + if (!_cupsAdminGetServerSettings(http, &num_settings, &settings)) { - /* - * Unable to open - log an error... - */ - + cgiStartHTML(cgiText(_("Administration"))); cgiSetVariable("MESSAGE", cgiText(_("Unable to open cupsd.conf file:"))); - cgiSetVariable("ERROR", strerror(errno)); + cgiSetVariable("ERROR", cupsLastErrorString()); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); - - perror(line); } - else - { - /* - * Read the file, keeping track of what settings are enabled... - */ - int remote_access = 0, /* Remote access allowed? */ - remote_admin = 0, /* Remote administration allowed? */ - browsing = 1, /* Browsing enabled? */ - browse_allow = 1, /* Browse address set? */ - browse_address = 0, /* Browse address set? */ - cancel_policy = 1, /* Cancel-job policy set? */ - debug_logging = 0; /* LogLevel debug set? */ - int linenum = 0, /* Line number in file */ - in_policy = 0, /* In a policy section? */ - in_cancel_job = 0, /* In a cancel-job section? */ - in_admin_location = 0; /* In the /admin location? */ + if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings, + settings)) != NULL && atoi(val)) + cgiSetVariable("DEBUG_LOGGING", "CHECKED"); + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings, + settings)) != NULL && atoi(val)) + cgiSetVariable("REMOTE_ADMIN", "CHECKED"); - while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) - { - if (!strcasecmp(line, "Port")) - { - remote_access = 1; - } - else if (!strcasecmp(line, "Listen")) - { - char *port; /* Pointer to port number, if any */ + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings, + settings)) != NULL && atoi(val)) + cgiSetVariable("REMOTE_PRINTERS", "CHECKED"); + if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings, + settings)) != NULL && atoi(val)) + cgiSetVariable("SHARE_PRINTERS", "CHECKED"); - if ((port = strrchr(value, ':')) != NULL) - *port = '\0'; - - if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")) - remote_access = 1; - } - else if (!strcasecmp(line, "Browsing")) - { - browsing = !strcasecmp(value, "yes") || !strcasecmp(value, "on") || - !strcasecmp(value, "true"); - } - else if (!strcasecmp(line, "BrowseAddress")) - { - browse_address = 1; - } - else if (!strcasecmp(line, "BrowseAllow")) - { - browse_allow = 1; - } - else if (!strcasecmp(line, "BrowseOrder")) - { - browse_allow = !strncasecmp(value, "deny,", 5); - } - else if (!strcasecmp(line, "LogLevel")) - { - debug_logging = !strncasecmp(value, "debug", 5); - } - else if (!strcasecmp(line, "")) - { - in_policy = 0; - } - else if (!strcasecmp(line, "")) - { - in_cancel_job = 0; - } - else if (!strcasecmp(line, "Require") && in_cancel_job) - { - cancel_policy = 0; - } - else if (!strcasecmp(line, "")) - { - in_admin_location = 0; - } - else if (!strcasecmp(line, "Allow") && in_admin_location && - strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")) - { - remote_admin = 1; - } - } - - cupsFileClose(cupsd); - - if (browsing && browse_allow) - cgiSetVariable("REMOTE_PRINTERS", "CHECKED"); - - if (remote_access && browsing && browse_address) - cgiSetVariable("SHARE_PRINTERS", "CHECKED"); - - if (remote_access && remote_admin) - cgiSetVariable("REMOTE_ADMIN", "CHECKED"); - - if (cancel_policy) - cgiSetVariable("USER_CANCEL_ANY", "CHECKED"); - - if (debug_logging) - cgiSetVariable("DEBUG_LOGGING", "CHECKED"); - } + if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings, + settings)) != NULL && atoi(val)) + cgiSetVariable("USER_CANCEL_ANY", "CHECKED"); /* * Get the list of printers and their devices... @@ -3100,33 +2330,39 @@ do_menu(http_t *http) /* I - HTTP connection */ if ((datadir = getenv("CUPS_DATADIR")) == NULL) datadir = CUPS_DATADIR; - snprintf(line, sizeof(line), "%s/drivers/pscript5.dll", datadir); - if (!access(line, 0)) + snprintf(filename, sizeof(filename), "%s/drivers/pscript5.dll", datadir); + if (!access(filename, R_OK)) { /* * Found Windows 2000 driver file, see if we have smbclient and * rpcclient... */ - if (cupsFileFind("smbclient", getenv("PATH"), 1, line, sizeof(line)) && - cupsFileFind("rpcclient", getenv("PATH"), 1, line, sizeof(line))) + if (cupsFileFind("smbclient", getenv("PATH"), 1, filename, + sizeof(filename)) && + cupsFileFind("rpcclient", getenv("PATH"), 1, filename, + sizeof(filename))) cgiSetVariable("HAVE_SAMBA", "Y"); else { - if (!cupsFileFind("smbclient", getenv("PATH"), 1, line, sizeof(line))) + if (!cupsFileFind("smbclient", getenv("PATH"), 1, filename, + sizeof(filename))) fputs("ERROR: smbclient not found!\n", stderr); - if (!cupsFileFind("rpcclient", getenv("PATH"), 1, line, sizeof(line))) + if (!cupsFileFind("rpcclient", getenv("PATH"), 1, filename, + sizeof(filename))) fputs("ERROR: rpcclient not found!\n", stderr); } } else - perror(line); + perror(filename); /* * Finally, show the main menu template... */ + cgiStartHTML(cgiText(_("Administration"))); + cgiCopyTemplateLang("admin.tmpl"); cgiEndHTML(); @@ -3610,5 +2846,5 @@ match_string(const char *a, /* I - First string */ /* - * End of "$Id: admin.c 5107 2006-02-15 19:14:17Z mike $". + * End of "$Id: admin.c 5240 2006-03-07 21:55:29Z mike $". */ diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c index fb598f84f..274c8e9b8 100644 --- a/cgi-bin/ipp-var.c +++ b/cgi-bin/ipp-var.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-var.c 5184 2006-02-26 15:13:44Z mike $" + * "$Id: ipp-var.c 5235 2006-03-06 13:02:23Z mike $" * * CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS). * @@ -661,7 +661,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */ if ((server = getenv("SERVER_NAME")) == NULL) server = ""; - httpGetHostname(servername, sizeof(servername)); + httpGetHostname(NULL, servername, sizeof(servername)); /* * Then flag whether we are using SSL on this connection... @@ -1277,5 +1277,5 @@ cgiText(const char *message) /* I - Message */ /* - * End of "$Id: ipp-var.c 5184 2006-02-26 15:13:44Z mike $". + * End of "$Id: ipp-var.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/conf/Makefile b/conf/Makefile index 82a796509..e806900af 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5185 2006-02-26 15:27:14Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Configuration file makefile for the Common UNIX Printing System (CUPS). # @@ -28,7 +28,7 @@ include ../Makedefs # Config files... # -KEEP = client.conf cupsd.conf +KEEP = cupsd.conf REPLACE = mime.convs mime.types @@ -46,6 +46,13 @@ all: clean: +# +# Dummy depend... +# + +depend: + + # # Install files... # @@ -81,5 +88,20 @@ install: all # -# End of "$Id: Makefile 5185 2006-02-26 15:27:14Z mike $". +# Uninstall files... +# + +uninstall: + for file in $(KEEP) $(REPLACE) cupsd.conf.default; do \ + $(RM) $(SERVERROOT)/$$file; \ + done + -$(RMDIR) $(SERVERROOT) + -if test x$(PAMDIR) != x; then \ + $(RM) $(BUILDROOT)$(PAMDIR)/cups; \ + $(RMDIR) $(BUILDROOT)$(PAMDIR); \ + fi + + +# +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/conf/client.conf b/conf/client.conf deleted file mode 100644 index dfe332165..000000000 --- a/conf/client.conf +++ /dev/null @@ -1,67 +0,0 @@ -# -# "$Id: client.conf 4494 2005-02-18 02:18:11Z mike $" -# -# Sample client configuration file for the Common UNIX Printing System -# (CUPS). -# -# Copyright 1997-2005 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 -# 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 missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636 USA -# -# Voice: (301) 373-9600 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org -# - -######################################################################## -# # -# This is the CUPS client configuration file. This file is used to # -# define client-specific parameters, such as the default server or # -# default encryption settings. # -# # -######################################################################## - -# -# ServerName: the hostname of your server. By default CUPS will use the -# hostname of the system or the value of the CUPS_SERVER environment -# variable. ONLY ONE SERVER NAME MAY BE SPECIFIED AT A TIME. To use -# more than one server you must use a local scheduler with browsing -# and possibly polling. -# - -#ServerName myhost.domain.com - -# -# Encryption: whether or not to use encryption; this depends on having -# the OpenSSL library linked into the CUPS library. -# -# Possible values: -# -# Always - Always use encryption (SSL) -# Never - Never use encryption -# Required - Use TLS encryption upgrade -# IfRequested - Use encryption if the server requests it -# -# The default value is "IfRequested". This parameter can also be set -# using the CUPS_ENCRYPTION environment variable. -# - -#Encryption Always -#Encryption Never -#Encryption Required -#Encryption IfRequested - - -# -# End of "$Id: client.conf 4494 2005-02-18 02:18:11Z mike $". -# diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index abad61d56..ccc3b460b 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-common.m4 5144 2006-02-21 20:44:01Z mike $" +dnl "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $" dnl dnl Common configuration stuff for the Common UNIX Printing System (CUPS). dnl @@ -63,6 +63,7 @@ AC_PATH_PROG(LD,ld) AC_PATH_PROG(LN,ln) AC_PATH_PROG(MV,mv) AC_PATH_PROG(RM,rm) +AC_PATH_PROG(RM,rmdir) AC_PATH_PROG(SED,sed) AC_PATH_PROG(STRIP,strip) @@ -263,5 +264,5 @@ AC_SUBST(DEFAULT_IPP_PORT) AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT) dnl -dnl End of "$Id: cups-common.m4 5144 2006-02-21 20:44:01Z mike $". +dnl End of "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $". dnl diff --git a/cups/Dependencies b/cups/Dependencies index 9b68b1299..e979f0371 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -1,11 +1,13 @@ # DO NOT DELETE +adminutil.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h +adminutil.o: language.h globals.h string.h ../config.h i18n.h normalize.h +adminutil.o: transcode.h debug.h array.o: array.h string.h ../config.h debug.h attr.o: ppd.h array.h file.h debug.h string.h ../config.h auth.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h auth.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h -backchannel.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h -backchannel.o: file.h language.h +backchannel.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h backend.o: backend.h string.h ../config.h custom.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h custom.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h @@ -13,28 +15,28 @@ dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h dest.o: array.h file.h language.h i18n.h normalize.h transcode.h dir.o: dir.h string.h ../config.h debug.h emit.o: ppd.h array.h file.h string.h ../config.h -encode.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h file.h -encode.o: language.h ipp-private.h debug.h -file.o: http-private.h ../config.h http.h string.h md5.h ipp-private.h ipp.h +encode.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h +encode.o: ipp-private.h string.h ../config.h debug.h +file.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h string.h file.o: ../cups/debug.h file.h -getputfile.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h -getputfile.o: file.h language.h debug.h -globals.o: http-private.h ../config.h http.h string.h md5.h ipp-private.h -globals.o: ipp.h globals.h cups.h ppd.h array.h file.h language.h i18n.h +getputfile.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h +getputfile.o: string.h ../config.h debug.h +globals.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h +globals.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h globals.o: normalize.h transcode.h -http.o: http-private.h ../config.h http.h string.h md5.h ipp-private.h ipp.h -http.o: globals.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h +http.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h +http.o: string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h http.o: transcode.h debug.h http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h http-addr.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h -http-addrlist.o: http-private.h ../config.h http.h string.h md5.h -http-addrlist.o: ipp-private.h ipp.h globals.h cups.h ppd.h array.h file.h -http-addrlist.o: language.h i18n.h normalize.h transcode.h debug.h +http-addrlist.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h +http-addrlist.o: globals.h string.h cups.h ppd.h array.h file.h language.h +http-addrlist.o: i18n.h normalize.h transcode.h debug.h http-support.o: debug.h globals.h string.h ../config.h cups.h ipp.h http.h http-support.o: md5.h ppd.h array.h file.h language.h i18n.h normalize.h http-support.o: transcode.h -ipp.o: http-private.h ../config.h http.h string.h md5.h ipp-private.h ipp.h -ipp.o: globals.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h +ipp.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h globals.h +ipp.o: string.h cups.h ppd.h array.h file.h language.h i18n.h normalize.h ipp.o: transcode.h debug.h ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h ipp-support.o: array.h file.h language.h i18n.h normalize.h transcode.h @@ -45,15 +47,16 @@ language.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h language.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h localize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h localize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h -mark.o: ppd.h array.h file.h string.h ../config.h debug.h +mark.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h +mark.o: ../config.h debug.h md5.o: md5.h string.h ../config.h -md5passwd.o: http.h string.h ../config.h md5.h +md5passwd.o: http.h md5.h string.h ../config.h normalize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h normalize.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h notify.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h notify.o: array.h file.h language.h i18n.h normalize.h transcode.h -options.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h -options.o: file.h language.h debug.h +options.o: cups.h ipp.h http.h md5.h ppd.h array.h file.h language.h string.h +options.o: ../config.h debug.h page.o: ppd.h array.h file.h string.h ../config.h ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h ppd.o: file.h language.h i18n.h normalize.h transcode.h debug.h @@ -66,14 +69,16 @@ tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h tempfile.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h transcode.o: array.h file.h language.h i18n.h normalize.h transcode.h -usersys.o: http-private.h ../config.h http.h string.h md5.h ipp-private.h -usersys.o: ipp.h globals.h cups.h ppd.h array.h file.h language.h i18n.h +usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h +usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h usersys.o: normalize.h transcode.h util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h util.o: array.h file.h language.h i18n.h normalize.h transcode.h debug.h +testadmin.o: adminutil.h cups.h ipp.h http.h md5.h ppd.h array.h file.h +testadmin.o: language.h string.h ../config.h testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h testfile.o: string.h ../config.h file.h debug.h -testhttp.o: http.h string.h ../config.h md5.h +testhttp.o: http.h md5.h string.h ../config.h testi18n.o: language.h array.h string.h ../config.h transcode.h normalize.h testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h testlang.o: i18n.h language.h array.h diff --git a/cups/Makefile b/cups/Makefile index cbd6e36f4..750b80bc9 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5138 2006-02-21 10:49:06Z mike $" +# "$Id: Makefile 5240 2006-03-07 21:55:29Z mike $" # # API library Makefile for the Common UNIX Printing System (CUPS). # @@ -31,6 +31,7 @@ include ../Makedefs # LIBOBJS = \ + adminutil.o \ array.o \ attr.o \ auth.o \ @@ -70,6 +71,7 @@ LIBOBJS = \ util.o OBJS = \ $(LIBOBJS) \ + testadmin.o \ testarray.o \ testfile.o \ testhttp.o \ @@ -85,6 +87,7 @@ OBJS = \ # HEADERS = \ + adminutil.h \ array.h \ cups.h \ dir.h \ @@ -106,6 +109,7 @@ HEADERS = \ TARGETS = \ $(LIBCUPS) \ libcups.a \ + testadmin \ testarray \ testfile \ testhttp \ @@ -169,6 +173,26 @@ installhdrs: done +# +# Uninstall object and target files... +# + +uninstall: + $(RM) $(LIBDIR)/libcups.2.dylib + $(RM) $(LIBDIR)/libcups.a + $(RM) $(LIBDIR)/libcups.dylib + $(RM) $(LIBDIR)/libcups_s.a + $(RM) $(LIBDIR)/libcups.sl + $(RM) $(LIBDIR)/libcups.sl.2 + $(RM) $(LIBDIR)/libcups.so + $(RM) $(LIBDIR)/libcups.so.2 + -$(RMDIR) $(LIBDIR) + for file in $(HEADERS); do \ + $(RM) $(INCLUDEDIR)/cups/$$file; \ + done + -$(RMDIR) $(INCLUDEDIR)/cups + + # # libcups.so.2, libcups.sl.2 # @@ -230,6 +254,9 @@ libcups.a: $(LIBOBJS) # # CUPS language bindings for various scripting languages... # +# NOTE: Not currently used or functional - see the scripting/php directory +# for the hand-written bindings... +# phpcups.so: $(LIBCUPS) php_cups_wrap.o echo Linking $@... @@ -248,6 +275,16 @@ php_cups_wrap.c: cups.h swig -php -o $@ -module cups cups.h +# +# testadmin (dependency on static CUPS library is intentional) +# + +testadmin: testadmin.o libcups.a + echo Linking $@... + $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \ + $(SSLLIBS) $(COMMONLIBS) $(LIBZ) + + # # testarray (dependency on static CUPS library is intentional) # @@ -357,5 +394,5 @@ include Dependencies # -# End of "$Id: Makefile 5138 2006-02-21 10:49:06Z mike $". +# End of "$Id: Makefile 5240 2006-03-07 21:55:29Z mike $". # diff --git a/cups/adminutil.c b/cups/adminutil.c new file mode 100644 index 000000000..44ffe6ed9 --- /dev/null +++ b/cups/adminutil.c @@ -0,0 +1,1900 @@ +/* + * "$Id: adminutil.c 5240 2006-03-07 21:55:29Z mike $" + * + * Administration utility API definitions for the Common UNIX Printing + * System (CUPS). + * + * MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO + * CHANGE AT ANY TIME. USE AT YOUR OWN RISK. + * + * Copyright 2001-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products 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 missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer. + * cupsAdminExportSamba() - Export a printer to Samba. + * _cupsAdminGetServerSettings() - Get settings from the server. + * _cupsAdminSetServerSettings() - Set settings on the server. + * do_samba_command() - Do a SAMBA command. + * get_cupsd_conf() - Get the current cupsd.conf file. + * invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings. + * write_option() - Write a CUPS option to a PPD file. + */ + +/* + * Include necessary headers... + */ + +#include "adminutil.h" +#include "globals.h" +#include "debug.h" +#include +#include +#include +#include +#include + + +/* + * Local functions... + */ + +static int do_samba_command(const char *command, + const char *address, + const char *subcommand, + const char *authfile, + FILE *logfile); +static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg, + time_t last_update, char *name, + int namelen, int *remote); +static void invalidate_cupsd_cache(_cups_globals_t *cg); +static void write_option(cups_file_t *dstfp, int order, + const char *name, const char *text, + const char *attrname, + ipp_attribute_t *suppattr, + ipp_attribute_t *defattr, int defval, + int valcount); + + +/* + * 'cupsAdminCreateWindowsPPD()' - Create the Windows PPD file for a printer. + */ + +char * /* O - PPD file or NULL */ +cupsAdminCreateWindowsPPD( + http_t *http, /* I - Connection to server */ + const char *dest, /* I - Printer or class */ + char *buffer, /* I - Filename buffer */ + int bufsize) /* I - Size of filename buffer */ +{ + const char *src; /* Source PPD filename */ + cups_file_t *srcfp, /* Source PPD file */ + *dstfp; /* Destination PPD file */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *suppattr, /* IPP -supported attribute */ + *defattr; /* IPP -default attribute */ + cups_lang_t *language; /* Current language */ + char line[256], /* Line from PPD file */ + junk[256], /* Extra junk to throw away */ + *ptr, /* Pointer into line */ + uri[1024], /* Printer URI */ + option[41], /* Option */ + choice[41]; /* Choice */ + int jcloption, /* In a JCL option? */ + linenum; /* Current line number */ + time_t curtime; /* Current time */ + struct tm *curdate; /* Current date */ + static const char *pattrs[] = /* Printer attributes we want */ + { + "job-hold-until-supported", + "job-hold-until-default", + "job-sheets-supported", + "job-sheets-default", + "job-priority-supported", + "job-priority-default" + }; + + + /* + * Range check the input... + */ + + if (buffer) + *buffer = '\0'; + + if (!http || !dest || !buffer || bufsize < 2) + return (NULL); + + /* + * Get the PPD file... + */ + + if ((src = cupsGetPPD2(http, dest)) == NULL) + return (NULL); + + /* + * Get the supported banner pages, etc. for the printer... + */ + + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + + httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, + "localhost", 0, "/printers/%s", dest); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, + "printer-uri", NULL, uri); + + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), + NULL, pattrs); + + /* + * Do the request and get back a response... + */ + + response = cupsDoRequest(http, request, "/"); + if (!response || cupsLastError() > IPP_OK_CONFLICT) + { + unlink(src); + return (NULL); + } + + /* + * Open the original PPD file... + */ + + if ((srcfp = cupsFileOpen(src, "rb")) == NULL) + return (NULL); + + /* + * Create a temporary output file using the destination buffer... + */ + + if ((dstfp = cupsTempFile2(buffer, bufsize)) < 0) + { + cupsFileClose(srcfp); + + unlink(src); + + return (NULL); + } + + /* + * Write a new header explaining that this isn't the original PPD... + */ + + cupsFilePuts(dstfp, "*PPD-Adobe: \"4.3\"\n"); + + curtime = time(NULL); + curdate = gmtime(&curtime); + + cupsFilePrintf(dstfp, "*%% Modified on %04d%02d%02d%02d%02d%02d+0000 " + "for CUPS Windows Driver\n", + curdate->tm_year + 1900, curdate->tm_mon + 1, curdate->tm_mday, + curdate->tm_hour, curdate->tm_min, curdate->tm_sec); + + /* + * Read the existing PPD file, converting all PJL commands to CUPS + * job ticket comments... + */ + + jcloption = 0; + linenum = 0; + language = cupsLangDefault(); + + while (cupsFileGets(srcfp, line, sizeof(line))) + { + linenum ++; + + if (!strncmp(line, "*PPD-Adobe:", 11)) + { + /* + * Already wrote the PPD header... + */ + + continue; + } + else if (!strncmp(line, "*JCLBegin:", 10) || + !strncmp(line, "*JCLToPSInterpreter:", 20) || + !strncmp(line, "*JCLEnd:", 8) || + !strncmp(line, "*Protocols:", 11)) + { + /* + * Don't use existing JCL keywords; we'll create our own, below... + */ + + cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n" + "*%%%s", line + 1); + continue; + } + else if (!strncmp(line, "*JCLOpenUI", 10)) + { + jcloption = 1; + cupsFilePuts(dstfp, line); + } + else if (!strncmp(line, "*JCLCloseUI", 11)) + { + jcloption = 0; + cupsFilePuts(dstfp, line); + } + else if (jcloption && + strncmp(line, "*End", 4) && + strncmp(line, "*Default", 8) && + strncmp(line, "*OrderDependency", 16)) + { + if ((ptr = strchr(line, ':')) == NULL) + { + snprintf(line, sizeof(line), + _cupsLangString(language, _("Missing value on line %d!\n")), + linenum); + _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line); + + cupsFileClose(srcfp); + cupsFileClose(dstfp); + + unlink(src); + unlink(buffer); + + *buffer = '\0'; + + return (NULL); + } + + if ((ptr = strchr(ptr, '\"')) == NULL) + { + snprintf(line, sizeof(line), + _cupsLangString(language, + _("Missing double quote on line %d!\n")), + linenum); + _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line); + + cupsFileClose(srcfp); + cupsFileClose(dstfp); + + unlink(src); + unlink(buffer); + + *buffer = '\0'; + + return (NULL); + } + + if (sscanf(line, "*%40s%*[ \t]%40[^/]", option, choice) != 2) + { + snprintf(line, sizeof(line), + _cupsLangString(language, + _("Bad option + choice on line %d!\n")), + linenum); + _cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line); + + cupsFileClose(srcfp); + cupsFileClose(dstfp); + + unlink(src); + unlink(buffer); + + *buffer = '\0'; + + return (NULL); + } + + if (strchr(ptr + 1, '\"') == NULL) + { + /* + * Skip remaining... + */ + + while (cupsFileGets(srcfp, junk, sizeof(junk)) != NULL) + { + linenum ++; + + if (!strncmp(junk, "*End", 4)) + break; + } + } + + snprintf(ptr + 1, sizeof(line) - (ptr - line + 1), + "%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice); + + cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s", line); + } + else + cupsFilePuts(dstfp, line); + } + + cupsFileClose(srcfp); + unlink(src); + + /* + * Now add the CUPS-specific attributes and options... + */ + + cupsFilePuts(dstfp, "\n*% CUPS Job Ticket support and options...\n"); + cupsFilePuts(dstfp, "*Protocols: PJL\n"); + cupsFilePuts(dstfp, "*JCLBegin: \"%!PS-Adobe-3.0<0A>\"\n"); + cupsFilePuts(dstfp, "*JCLToPSInterpreter: \"\"\n"); + cupsFilePuts(dstfp, "*JCLEnd: \"\"\n"); + + cupsFilePuts(dstfp, "\n*OpenGroup: CUPS/CUPS Options\n\n"); + + if ((defattr = ippFindAttribute(response, "job-hold-until-default", + IPP_TAG_ZERO)) != NULL && + (suppattr = ippFindAttribute(response, "job-hold-until-supported", + IPP_TAG_ZERO)) != NULL) + write_option(dstfp, 10, "cupsJobHoldUntil", "Hold Until", "job-hold-until", + suppattr, defattr, 0, 1); + + if ((defattr = ippFindAttribute(response, "job-priority-default", + IPP_TAG_INTEGER)) != NULL && + (suppattr = ippFindAttribute(response, "job-priority-supported", + IPP_TAG_RANGE)) != NULL) + write_option(dstfp, 11, "cupsJobPriority", "Priority", "job-priority", + suppattr, defattr, 0, 1); + + if ((defattr = ippFindAttribute(response, "job-sheets-default", + IPP_TAG_ZERO)) != NULL && + (suppattr = ippFindAttribute(response, "job-sheets-supported", + IPP_TAG_ZERO)) != NULL) + { + write_option(dstfp, 20, "cupsJobSheetsStart", "Start Banner", + "job-sheets", suppattr, defattr, 0, 2); + write_option(dstfp, 21, "cupsJobSheetsEnd", "End Banner", + "job-sheets", suppattr, defattr, 1, 2); + } + + cupsFilePuts(dstfp, "*CloseGroup: CUPS\n"); + cupsFileClose(dstfp); + + ippDelete(response); + + return (buffer); +} + + +/* + * 'cupsAdminExportSamba()' - Export a printer to Samba. + */ + +int /* O - 1 on success, 0 on failure */ +cupsAdminExportSamba( + const char *dest, /* I - Destination to export */ + const char *ppd, /* I - PPD file */ + const char *samba_server, /* I - Samba server */ + const char *samba_user, /* I - Samba username */ + const char *samba_password, /* I - Samba password */ + FILE *logfile) /* I - Log file, if any */ +{ + int status; /* Status of smbclient/rpcclient commands */ + int have_drivers; /* Have drivers? */ + char file[1024], /* File to test for */ + authfile[1024], /* Temporary authentication file */ + address[1024], /* Address for command */ + subcmd[1024], /* Sub-command */ + message[1024]; /* Error message */ + cups_file_t *fp; /* Authentication file */ + cups_lang_t *language; /* Current language */ + _cups_globals_t *cg = _cupsGlobals(); + /* Global data */ + + + /* + * Range check input... + */ + + if (!dest || !ppd || !samba_server || !samba_user || !samba_password) + { + _cupsSetError(IPP_INTERNAL_ERROR, NULL); + return (0); + } + + /* + * Create a temporary authentication file for Samba... + */ + + if ((fp = cupsTempFile2(authfile, sizeof(authfile))) == NULL) + { + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + return (0); + } + + cupsFilePrintf(fp, "username = %s\n", samba_user); + cupsFilePrintf(fp, "password = %s\n", samba_password); + cupsFileClose(fp); + + /* + * See which drivers are available; the new CUPS v6 and Adobe drivers + * depend on the Windows 2k PS driver, so copy that driver first: + * + * Files: + * + * ps5ui.dll + * pscript.hlp + * pscript.ntf + * pscript5.dll + */ + + have_drivers = 0; + language = cupsLangDefault(); + + snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", cg->cups_datadir); + if (!access(file, 0)) + { + have_drivers |= 1; + + /* + * Windows 2k driver is installed; do the smbclient commands needed + * to copy the Win2k drivers over... + */ + + snprintf(address, sizeof(address), "//%s/print$", samba_server); + + snprintf(subcmd, sizeof(subcmd), + "mkdir W32X86;" + "put %s W32X86/%s.ppd;" + "put %s/drivers/ps5ui.dll W32X86/ps5ui.dll;" + "put %s/drivers/pscript.hlp W32X86/pscript.hlp;" + "put %s/drivers/pscript.ntf W32X86/pscript.ntf;" + "put %s/drivers/pscript5.dll W32X86/pscript5.dll", + ppd, dest, cg->cups_datadir, cg->cups_datadir, + cg->cups_datadir, cg->cups_datadir); + + if ((status = do_samba_command("smbclient", address, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to copy Windows 2000 printer " + "driver files (%d)!")), status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + + /* + * See if we also have the CUPS driver files; if so, use them! + */ + + snprintf(file, sizeof(file), "%s/drivers/cupsps6.dll", cg->cups_datadir); + if (!access(file, 0)) + { + /* + * Copy the CUPS driver files over... + */ + + snprintf(subcmd, sizeof(subcmd), + "put %s/drivers/cups6.ini W32X86/cups6.ini;" + "put %s/drivers/cupsps6.dll W32X86/cupsps6.dll;" + "put %s/drivers/cupsui6.dll W32X86/cupsui6.dll", + cg->cups_datadir, cg->cups_datadir, cg->cups_datadir); + + if ((status = do_samba_command("smbclient", address, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to copy CUPS printer driver " + "files (%d)!")), status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + + /* + * Do the rpcclient command needed for the CUPS drivers... + */ + + snprintf(subcmd, sizeof(subcmd), + "adddriver \"Windows NT x86\" \"%s:" + "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:" + "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf," + "cups6.ini,cupsps6.dll,cupsui6.dll\"", + dest, dest, dest); + } + else + { + /* + * Don't have the CUPS drivers, so just use the standard Windows + * drivers... + */ + + snprintf(subcmd, sizeof(subcmd), + "adddriver \"Windows NT x86\" \"%s:" + "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:" + "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"", + dest, dest, dest); + } + + if ((status = do_samba_command("rpcclient", samba_server, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to install Windows 2000 printer " + "driver files (%d)!")), status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + } + + snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", cg->cups_datadir); + if (!access(file, 0)) + { + have_drivers |= 2; + + /* + * Do the smbclient commands needed for the Adobe Win9x drivers... + */ + + snprintf(address, sizeof(address), "//%s/print$", samba_server); + + snprintf(subcmd, sizeof(subcmd), + "mkdir WIN40;" + "put %s WIN40/%s.PPD;" + "put %s/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;" + "put %s/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;" + "put %s/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;" + "put %s/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;" + "put %s/drivers/PSMON.DLL WIN40/PSMON.DLL;", + ppd, dest, cg->cups_datadir, cg->cups_datadir, + cg->cups_datadir, cg->cups_datadir, cg->cups_datadir); + + if ((status = do_samba_command("smbclient", address, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to copy Windows 9x printer " + "driver files (%d)!")), status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + + /* + * Do the rpcclient commands needed for the Adobe Win9x drivers... + */ + + snprintf(subcmd, sizeof(subcmd), + "adddriver \"Windows 4.0\" \"%s:ADOBEPS4.DRV:%s.PPD:NULL:" + "ADOBEPS4.HLP:PSMON.DLL:RAW:" + "ADOBEPS4.DRV,%s.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM," + "ICONLIB.DLL\"", + dest, dest, dest); + + if ((status = do_samba_command("rpcclient", samba_server, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to install Windows 9x printer " + "driver files (%d)!")), status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + } + + if (logfile && !(have_drivers & 1)) + { + if (!have_drivers) + strlcpy(message, + _cupsLangString(language, + _("No Windows printer drivers are installed!")), + sizeof(message)); + else + strlcpy(message, + _cupsLangString(language, + _("Warning, no Windows 2000 printer drivers " + "are installed!")), + sizeof(message)); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + _cupsLangPrintf(logfile, "%s\n", message); + } + + if (have_drivers == 0) + return (0); + + /* + * Finally, associate the drivers we just added with the queue... + */ + + snprintf(subcmd, sizeof(subcmd), "setdriver %s %s", dest, dest); + + if ((status = do_samba_command("rpcclient", samba_server, subcmd, + authfile, logfile)) != 0) + { + snprintf(message, sizeof(message), + _cupsLangString(language, + _("Unable to set Windows printer driver (%d)!\n")), + status); + + _cupsSetError(IPP_INTERNAL_ERROR, message); + + if (logfile) + _cupsLangPrintf(logfile, "%s\n", message); + + unlink(authfile); + + return (0); + } + + unlink(authfile); + + return (1); +} + + +/* + * '_cupsAdminGetServerSettings()' - Get settings from the server. + * + * The returned settings should be freed with cupsFreeOptions() when + * you are done with them. + * + * @since CUPS 1.2@ + */ + +int /* O - 1 on success, 0 on failure */ +_cupsAdminGetServerSettings( + http_t *http, /* I - Connection to server */ + int *num_settings, /* O - Number of settings */ + cups_option_t **settings) /* O - Settings */ +{ + int i; /* Looping var */ + cups_file_t *cupsd; /* cupsd.conf file */ + char cupsdconf[1024]; /* cupsd.conf filename */ + int remote; /* Remote cupsd.conf file? */ + http_status_t status; /* Status of getting cupsd.conf */ + char line[1024], /* Line from cupsd.conf file */ + *value; /* Value on line */ + cups_option_t *setting; /* Current setting */ + _cups_globals_t *cg = _cupsGlobals(); /* Global data */ + + + /* + * Range check input... + */ + + if (!http || !num_settings || !settings) + { + _cupsSetError(IPP_INTERNAL_ERROR, NULL); + + if (num_settings) + *num_settings = 0; + + if (settings) + *settings = NULL; + + return (0); + } + + *num_settings = 0; + *settings = NULL; + + /* + * Get the cupsd.conf file... + */ + + if ((status = get_cupsd_conf(http, cg, cg->cupsd_update, cupsdconf, + sizeof(cupsdconf), &remote)) == HTTP_OK) + { + if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL) + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + } + else + cupsd = NULL; + + if (cupsd) + { + /* + * Read the file, keeping track of what settings are enabled... + */ + + int remote_access = 0, /* Remote access allowed? */ + remote_admin = 0, /* Remote administration allowed? */ + browsing = 1, /* Browsing enabled? */ + browse_allow = 1, /* Browse address set? */ + browse_address = 0, /* Browse address set? */ + cancel_policy = 1, /* Cancel-job policy set? */ + debug_logging = 0; /* LogLevel debug set? */ + int linenum = 0, /* Line number in file */ + in_location = 0, /* In a location section? */ + in_policy = 0, /* In a policy section? */ + in_cancel_job = 0, /* In a cancel-job section? */ + in_admin_location = 0; /* In the /admin location? */ + + + invalidate_cupsd_cache(cg); + + cg->cupsd_update = time(NULL); + httpGetHostname(http, cg->cupsd_hostname, sizeof(cg->cupsd_hostname)); + + while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) + { + if (!value) + continue; + + if (!strcasecmp(line, "Port")) + { + remote_access = 1; + } + else if (!strcasecmp(line, "Listen")) + { + char *port; /* Pointer to port number, if any */ + + + if ((port = strrchr(value, ':')) != NULL) + *port = '\0'; + + if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")) + remote_access = 1; + } + else if (!strcasecmp(line, "Browsing")) + { + browsing = !strcasecmp(value, "yes") || !strcasecmp(value, "on") || + !strcasecmp(value, "true"); + } + else if (!strcasecmp(line, "BrowseAddress")) + { + browse_address = 1; + } + else if (!strcasecmp(line, "BrowseAllow")) + { + browse_allow = 1; + } + else if (!strcasecmp(line, "BrowseOrder")) + { + browse_allow = !strncasecmp(value, "deny,", 5); + } + else if (!strcasecmp(line, "LogLevel")) + { + debug_logging = !strncasecmp(value, "debug", 5); + } + else if (!strcasecmp(line, "")) + { + in_policy = 0; + } + else if (!strcasecmp(line, "")) + { + in_cancel_job = 0; + } + else if (!strcasecmp(line, "Require") && in_cancel_job) + { + cancel_policy = 0; + } + else if (!strcasecmp(line, "")) + { + in_admin_location = 0; + in_location = 0; + } + else if (!strcasecmp(line, "Allow") && in_admin_location && + strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")) + { + remote_admin = 1; + } + else if (line[0] != '<' && !in_location && !in_policy) + cg->cupsd_num_settings = cupsAddOption(line, value, + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + } + + cupsFileClose(cupsd); + + cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, + debug_logging ? "1" : "0", + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + + cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, + (remote_access && remote_admin) ? + "1" : "0", + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + + cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS, + (browsing && browse_allow) ? + "1" : "0", + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + + cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, + (remote_access && browsing && + browse_address) ? "1" : "0", + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + + cg->cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, + cancel_policy ? "1" : "0", + cg->cupsd_num_settings, + &(cg->cupsd_settings)); + } + else if (status != HTTP_NOT_MODIFIED) + invalidate_cupsd_cache(cg); + + /* + * Remove any temporary files and copy the settings array... + */ + + if (remote) + unlink(cupsdconf); + + for (i = cg->cupsd_num_settings, setting = cg->cupsd_settings; + i > 0; + i --, setting ++) + *num_settings = cupsAddOption(setting->name, setting->value, + *num_settings, settings); + + return (cg->cupsd_num_settings > 0); +} + + +/* + * '_cupsAdminSetServerSettings()' - Set settings on the server. + * + * @since CUPS 1.2@ + */ + +int /* O - 1 on success, 0 on failure */ +_cupsAdminSetServerSettings( + http_t *http, /* I - Connection to server */ + int num_settings, /* I - Number of settings */ + cups_option_t *settings) /* I - Settings */ +{ + int i; /* Looping var */ + http_status_t status; /* GET/PUT status */ + cups_file_t *cupsd; /* cupsd.conf file */ + char cupsdconf[1024]; /* cupsd.conf filename */ + int remote; /* Remote cupsd.conf file? */ + char tempfile[1024]; /* Temporary new cupsd.conf */ + cups_file_t *temp; /* Temporary file */ + char line[1024], /* Line from cupsd.conf file */ + *value; /* Value on line */ + int linenum, /* Line number in file */ + in_location, /* In a location section? */ + in_policy, /* In a policy section? */ + in_default_policy, /* In the default policy section? */ + in_cancel_job, /* In a cancel-job section? */ + in_admin_location, /* In the /admin location? */ + in_conf_location, /* In the /admin/conf location? */ + in_root_location; /* In the / location? */ + const char *val; /* Setting value */ + int remote_printers, /* Show remote printers */ + share_printers, /* Share local printers */ + remote_admin, /* Remote administration allowed? */ + user_cancel_any, /* Cancel-job policy set? */ + debug_logging; /* LogLevel debug set? */ + int wrote_port_listen, /* Wrote the port/listen lines? */ + wrote_browsing, /* Wrote the browsing lines? */ + wrote_policy, /* Wrote the policy? */ + wrote_loglevel, /* Wrote the LogLevel line? */ + wrote_admin_location, /* Wrote the /admin location? */ + wrote_conf_location, /* Wrote the /admin/conf location? */ + wrote_root_location; /* Wrote the / location? */ + int indent; /* Indentation */ + int cupsd_num_settings; /* New number of settings */ + cups_option_t *cupsd_settings, /* New settings */ + *setting; /* Current setting */ + _cups_globals_t *cg = _cupsGlobals(); /* Global data */ + + + /* + * Range check input... + */ + + if (!http || !num_settings || !settings) + { + _cupsSetError(IPP_INTERNAL_ERROR, NULL); + + return (0); + } + + /* + * Get the cupsd.conf file... + */ + + if ((status = get_cupsd_conf(http, cg, 0, cupsdconf, sizeof(cupsdconf), + &remote)) == HTTP_OK) + { + if ((cupsd = cupsFileOpen(cupsdconf, "r")) == NULL) + { + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + return (0); + } + } + else + return (0); + + /* + * Get basic settings... + */ + + if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings, + settings)) != NULL) + debug_logging = atoi(val); + else + debug_logging = 0; + + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings, + settings)) != NULL) + remote_admin = atoi(val); + else + remote_admin = 0; + + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings, + settings)) != NULL) + remote_printers = atoi(val); + else + remote_printers = 1; + + if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings, + settings)) != NULL) + share_printers = atoi(val); + else + share_printers = 0; + + if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings, + settings)) != NULL) + user_cancel_any = atoi(val); + else + user_cancel_any = 0; + + /* + * Create a temporary file for the new cupsd.conf file... + */ + + if ((temp = cupsTempFile2(tempfile, sizeof(tempfile))) == NULL) + { + cupsFileClose(cupsd); + + if (remote) + unlink(cupsdconf); + + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + return (0); + } + + /* + * Copy the old file to the new, making changes along the way... + */ + + cupsd_num_settings = 0; + in_admin_location = 0; + in_cancel_job = 0; + in_conf_location = 0; + in_default_policy = 0; + in_location = 0; + in_policy = 0; + in_root_location = 0; + linenum = 0; + wrote_admin_location = 0; + wrote_browsing = 0; + wrote_conf_location = 0; + wrote_loglevel = 0; + wrote_policy = 0; + wrote_port_listen = 0; + wrote_root_location = 0; + indent = 0; + + while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) + { + if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) + { + if (!wrote_port_listen) + { + wrote_port_listen = 1; + + if (share_printers || remote_admin) + { + cupsFilePuts(temp, "# Allow remote access\n"); + cupsFilePrintf(temp, "Port %d\n", ippPort()); + } + else + { + cupsFilePuts(temp, "# Only listen for connections from the local machine.\n"); + cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort()); + } + +#ifdef CUPS_DEFAULT_DOMAINSOCKET + if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0)) + cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n"); +#endif /* CUPS_DEFAULT_DOMAINSOCKET */ + } + } + else if (!strcasecmp(line, "Browsing") || + !strcasecmp(line, "BrowseAddress") || + !strcasecmp(line, "BrowseAllow") || + !strcasecmp(line, "BrowseDeny") || + !strcasecmp(line, "BrowseOrder")) + { + if (!wrote_browsing) + { + wrote_browsing = 1; + + if (remote_printers || share_printers) + { + if (remote_printers && share_printers) + cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n"); + else if (remote_printers) + cupsFilePuts(temp, "# Show shared printers on the local network.\n"); + else + cupsFilePuts(temp, "# Share local printers on the local network.\n"); + + cupsFilePuts(temp, "Browsing On\n"); + cupsFilePuts(temp, "BrowseOrder allow,deny\n"); + + if (remote_printers) + cupsFilePuts(temp, "BrowseAllow @LOCAL\n"); + + if (share_printers) + cupsFilePuts(temp, "BrowseAddress @LOCAL\n"); + } + else + { + cupsFilePuts(temp, "# Disable printer sharing and shared printers.\n"); + cupsFilePuts(temp, "Browsing Off\n"); + } + } + } + else if (!strcasecmp(line, "LogLevel")) + { + wrote_loglevel = 1; + + if (debug_logging) + { + cupsFilePuts(temp, "# Show troubleshooting information in error_log.\n"); + cupsFilePuts(temp, "LogLevel debug\n"); + } + else + { + cupsFilePuts(temp, "# Show general information in error_log.\n"); + cupsFilePuts(temp, "LogLevel info\n"); + } + } + else if (!strcasecmp(line, "\n", line, value); + indent += 2; + } + else if (!strcasecmp(line, "")) + { + indent -= 2; + if (!wrote_policy && in_default_policy) + { + wrote_policy = 1; + + if (!user_cancel_any) + cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" + " \n" + " Order deny,allow\n" + " Allow @SYSTEM\n" + " Allow @OWNER\n" + " \n"); + } + + in_policy = 0; + in_default_policy = 0; + + cupsFilePuts(temp, "\n"); + } + else if (!strcasecmp(line, "\n", line, value); + } + else if (!strcasecmp(line, "")) + { + in_location = 0; + indent -= 2; + if (in_admin_location) + { + wrote_admin_location = 1; + + if (remote_admin) + cupsFilePuts(temp, " # Allow remote administration...\n"); + else + cupsFilePuts(temp, " # Restrict access to the admin pages...\n"); + + cupsFilePuts(temp, " Order allow,deny\n"); + + if (remote_admin) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + } + else if (in_conf_location) + { + wrote_conf_location = 1; + + if (remote_admin) + cupsFilePuts(temp, " # Allow remote access to the configuration files...\n"); + else + cupsFilePuts(temp, " # Restrict access to the configuration files...\n"); + + cupsFilePuts(temp, " Order allow,deny\n"); + + if (remote_admin) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + } + else if (in_root_location) + { + wrote_root_location = 1; + + if (remote_admin && share_printers) + cupsFilePuts(temp, " # Allow shared printing and remote administration...\n"); + else if (remote_admin) + cupsFilePuts(temp, " # Allow remote administration...\n"); + else if (share_printers) + cupsFilePuts(temp, " # Allow shared printing...\n"); + else + cupsFilePuts(temp, " # Restrict access to the server...\n"); + + cupsFilePuts(temp, " Order allow,deny\n"); + + if (remote_admin || share_printers) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + } + + in_admin_location = 0; + in_conf_location = 0; + in_root_location = 0; + + cupsFilePuts(temp, "\n"); + } + else if (!strcasecmp(line, "\n"); + } + } + else if (!strcasecmp(line, "") && in_cancel_job) + { + indent -= 2; + + if (in_cancel_job == 1) + cupsFilePuts(temp, " \n"); + + wrote_policy = 1; + + if (!user_cancel_any) + cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" + " \n" + " Order deny,allow\n" + " Require user @OWNER @SYSTEM\n" + " \n"); + + in_cancel_job = 0; + } + else if ((in_admin_location || in_conf_location || in_root_location) && + (!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") || + !strcasecmp(line, "Order"))) + continue; + else if (in_cancel_job == 2) + continue; + else if (!strcasecmp(line, "\n", line, value); + else if (line[0] == '<') + { + if (value) + { + cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value); + indent += 2; + } + else + { + if (line[1] == '/') + indent -= 2; + + cupsFilePrintf(temp, "%*s%s\n", indent, "", line); + } + } + else if (!in_policy && !in_location && + (val = cupsGetOption(line, num_settings, settings)) != NULL && + !cupsGetOption(line, cupsd_num_settings, cupsd_settings)) + { + /* + * Add this directive to the list of directives we have written... + */ + + cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings, + &cupsd_settings); + + /* + * Write the new value in its place, without indentation since we + * only support setting root directives, not in sections... + */ + + cupsFilePrintf(temp, "%s %s\n", line, value); + } + else if (value) + { + if (!in_policy && !in_location) + { + /* + * Record the non-policy, non-location directives that we find + * in the server settings, since we cache this info and record it + * in _cupsAdminGetServerSettings()... + */ + + cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings, + &cupsd_settings); + } + + cupsFilePrintf(temp, "%*s%s %s\n", indent, "", line, value); + } + else + cupsFilePrintf(temp, "%*s%s\n", indent, "", line); + } + + /* + * Write any missing info... + */ + + if (!wrote_browsing) + { + if (remote_printers || share_printers) + { + if (remote_printers && share_printers) + cupsFilePuts(temp, "# Enable printer sharing and shared printers.\n"); + else if (remote_printers) + cupsFilePuts(temp, "# Show shared printers on the local network.\n"); + else + cupsFilePuts(temp, "# Share local printers on the local network.\n"); + + cupsFilePuts(temp, "Browsing On\n"); + cupsFilePuts(temp, "BrowseOrder allow,deny\n"); + + if (remote_printers) + cupsFilePuts(temp, "BrowseAllow @LOCAL\n"); + + if (share_printers) + cupsFilePuts(temp, "BrowseAddress @LOCAL\n"); + } + else + { + cupsFilePuts(temp, "# Disable printer sharing and shared printers.\n"); + cupsFilePuts(temp, "Browsing Off\n"); + } + } + + if (!wrote_loglevel) + { + if (debug_logging) + { + cupsFilePuts(temp, "# Show troubleshooting information in error_log.\n"); + cupsFilePuts(temp, "LogLevel debug\n"); + } + else + { + cupsFilePuts(temp, "# Show general information in error_log.\n"); + cupsFilePuts(temp, "LogLevel info\n"); + } + } + + if (!wrote_port_listen) + { + if (share_printers || remote_admin) + { + cupsFilePuts(temp, "# Allow remote access\n"); + cupsFilePrintf(temp, "Port %d\n", ippPort()); + } + else + { + cupsFilePuts(temp, "# Only listen for connections from the local machine.\n"); + cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort()); + } + +#ifdef CUPS_DEFAULT_DOMAINSOCKET + if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0)) + cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n"); +#endif /* CUPS_DEFAULT_DOMAINSOCKET */ + } + + if (!wrote_root_location) + { + if (remote_admin && share_printers) + cupsFilePuts(temp, "# Allow shared printing and remote administration...\n"); + else if (remote_admin) + cupsFilePuts(temp, "# Allow remote administration...\n"); + else if (share_printers) + cupsFilePuts(temp, "# Allow shared printing...\n"); + else + cupsFilePuts(temp, "# Restrict access to the server...\n"); + + cupsFilePuts(temp, "\n" + " Order allow,deny\n"); + + if (remote_admin || share_printers) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + + cupsFilePuts(temp, "\n"); + } + + if (!wrote_admin_location) + { + if (remote_admin) + cupsFilePuts(temp, "# Allow remote administration...\n"); + else + cupsFilePuts(temp, "# Restrict access to the admin pages...\n"); + + cupsFilePuts(temp, "\n" + " Order allow,deny\n"); + + if (remote_admin) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + + cupsFilePuts(temp, "\n"); + } + + if (!wrote_conf_location) + { + if (remote_admin) + cupsFilePuts(temp, "# Allow remote access to the configuration files...\n"); + else + cupsFilePuts(temp, "# Restrict access to the configuration files...\n"); + + cupsFilePuts(temp, "\n" + " AuthType Basic\n" + " Require user @SYSTEM\n" + " Order allow,deny\n"); + + if (remote_admin) + cupsFilePuts(temp, " Allow @LOCAL\n"); + else + cupsFilePuts(temp, " Allow localhost\n"); + + cupsFilePuts(temp, "\n"); + } + + if (!wrote_policy) + { + cupsFilePuts(temp, "\n" + " # Job-related operations must be done by the owner or an adminstrator...\n" + " \n" + " Require user @OWNER @SYSTEM\n" + " Order deny,allow\n" + " \n" + " # All administration operations require an adminstrator to authenticate...\n" + " \n" + " AuthType Basic\n" + " Require user @SYSTEM\n" + " Order deny,allow\n" + "\n"); + + if (!user_cancel_any) + cupsFilePuts(temp, " # Only the owner or an administrator can cancel a job...\n" + " \n" + " Require user @OWNER @SYSTEM\n" + " Order deny,allow\n" + " \n"); + + cupsFilePuts(temp, " \n" + " Order deny,allow\n" + " \n" + "\n"); + } + + for (i = num_settings, setting = settings; i > 0; i --, setting ++) + if (setting->name[0] != '_' && + !cupsGetOption(setting->name, cupsd_num_settings, cupsd_settings)) + { + /* + * Add this directive to the list of directives we have written... + */ + + cupsd_num_settings = cupsAddOption(setting->name, setting->value, + cupsd_num_settings, &cupsd_settings); + + /* + * Write the new value in its place, without indentation since we + * only support setting root directives, not in sections... + */ + + cupsFilePrintf(temp, "%s %s\n", setting->name, setting->value); + } + + cupsFileClose(cupsd); + cupsFileClose(temp); + + /* + * Upload the configuration file to the server... + */ + + status = cupsPutFile(http, "/admin/conf/cupsd.conf", tempfile); + + if (status == HTTP_CREATED) + { + /* + * Updated OK, add the basic settings... + */ + + cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, + debug_logging ? "1" : "0", + cupsd_num_settings, &cupsd_settings); + cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, + remote_admin ? "1" : "0", + cupsd_num_settings, &cupsd_settings); + cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS, + remote_printers ? "1" : "0", + cupsd_num_settings, &cupsd_settings); + cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, + share_printers ? "1" : "0", + cupsd_num_settings, &cupsd_settings); + cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, + user_cancel_any ? "1" : "0", + cupsd_num_settings, &cupsd_settings); + + /* + * Save the new values... + */ + + invalidate_cupsd_cache(cg); + + cg->cupsd_num_settings = cupsd_num_settings; + cg->cupsd_settings = cupsd_settings; + cg->cupsd_update = time(NULL); + + httpGetHostname(http, cg->cupsd_hostname, sizeof(cg->cupsd_hostname)); + } + else + cupsFreeOptions(cupsd_num_settings, cupsd_settings); + + /* + * Remote our temp files and return... + */ + + if (remote) + unlink(cupsdconf); + + unlink(tempfile); + + return (status == HTTP_CREATED); +} + + +/* + * 'do_samba_command()' - Do a SAMBA command. + */ + +static int /* O - Status of command */ +do_samba_command(const char *command, /* I - Command to run */ + const char *address, /* I - Address for command */ + const char *subcmd, /* I - Sub-command */ + const char *authfile, /* I - Samba authentication file */ + FILE *logfile) /* I - Optional log file */ +{ + int status; /* Status of command */ + int pid; /* Process ID of child */ + + + if (logfile) + _cupsLangPrintf(logfile, + _("Running command: %s %s -N -A %s -c \'%s\'\n"), + command, address, authfile, subcmd); + + if ((pid = fork()) == 0) + { + /* + * Child goes here, redirect stdin/out/err and execute the command... + */ + + close(0); + open("/dev/null", O_RDONLY); + + close(1); + + if (logfile) + dup(fileno(logfile)); + else + open("/dev/null", O_WRONLY); + + close(2); + dup(1); + + execlp(command, command, address, "-N", "-A", authfile, "-c", subcmd, + (char *)0); + exit(errno); + } + else if (pid < 0) + { + status = -1; + + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to run \"%s\": %s\n"), + command, strerror(errno)); + } + else + { + /* + * Wait for the process to complete... + */ + + while (wait(&status) != pid); + } + + if (logfile) + _cupsLangPuts(logfile, "\n"); + + DEBUG_printf(("status=%d\n", status)); + + if (WIFEXITED(status)) + return (WEXITSTATUS(status)); + else + return (-WTERMSIG(status)); +} + + +/* + * 'get_cupsd_conf()' - Get the current cupsd.conf file. + */ + +static http_status_t /* O - Status of request */ +get_cupsd_conf( + http_t *http, /* I - Connection to server */ + _cups_globals_t *cg, /* I - Global data */ + time_t last_update, /* I - Last update time for file */ + char *name, /* I - Filename buffer */ + int namesize, /* I - Size of filename buffer */ + int *remote) /* O - Remote file? */ +{ + int fd; /* Temporary file descriptor */ + struct stat info; /* cupsd.conf file information */ + http_status_t status; /* Status of getting cupsd.conf */ + char host[HTTP_MAX_HOST]; /* Hostname for connection */ + + + /* + * See if we already have the data we need... + */ + + httpGetHostname(http, host, sizeof(host)); + + if (strcasecmp(cg->cupsd_hostname, host)) + invalidate_cupsd_cache(cg); + + snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot); + *remote = 0; + + if (!strcasecmp(host, "localhost") && !access(name, R_OK)) + { + /* + * Read the local file rather than using HTTP... + */ + + if (stat(name, &info)) + { + *name = '\0'; + + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + + return (HTTP_SERVER_ERROR); + } + else if (last_update && info.st_mtime <= last_update) + status = HTTP_NOT_MODIFIED; + else + status = HTTP_OK; + } + else + { + /* + * Read cupsd.conf via a HTTP GET request... + */ + + if ((fd = cupsTempFd(name, sizeof(name))) < 0) + { + *name = '\0'; + + _cupsSetError(IPP_INTERNAL_ERROR, strerror(errno)); + + invalidate_cupsd_cache(cg); + + return (HTTP_SERVER_ERROR); + } + + *remote = 1; + + httpClearFields(http); + + if (last_update) + httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE, + httpGetDateString(last_update)); + + status = cupsGetFd(http, "/admin/conf/cupsd.conf", fd); + + close(fd); + + if (status != HTTP_OK) + { + unlink(name); + *name = '\0'; + } + } + + return (status); +} + + +/* + * 'invalidate_cupsd_cache()' - Invalidate the cached cupsd.conf settings. + */ + +static void +invalidate_cupsd_cache( + _cups_globals_t *cg) /* I - Global data */ +{ + cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings); + + cg->cupsd_hostname[0] = '\0'; + cg->cupsd_update = 0; + cg->cupsd_num_settings = 0; + cg->cupsd_settings = NULL; +} + + +/* + * 'write_option()' - Write a CUPS option to a PPD file. + */ + +static void +write_option(cups_file_t *dstfp, /* I - PPD file */ + int order, /* I - Order dependency */ + const char *name, /* I - Option name */ + const char *text, /* I - Option text */ + const char *attrname, /* I - Attribute name */ + ipp_attribute_t *suppattr, /* I - IPP -supported attribute */ + ipp_attribute_t *defattr, /* I - IPP -default attribute */ + int defval, /* I - Default value number */ + int valcount) /* I - Number of values */ +{ + int i; /* Looping var */ + + + cupsFilePrintf(dstfp, "*JCLOpenUI *%s/%s: PickOne\n" + "*OrderDependency: %d JCLSetup *%s\n", + name, text, order, name); + + if (defattr->value_tag == IPP_TAG_INTEGER) + { + /* + * Do numeric options with a range or list... + */ + + cupsFilePrintf(dstfp, "*Default%s: %d\n", name, + defattr->values[defval].integer); + + if (suppattr->value_tag == IPP_TAG_RANGE) + { + /* + * List each number in the range... + */ + + for (i = suppattr->values[0].range.lower; + i <= suppattr->values[0].range.upper; + i ++) + { + cupsFilePrintf(dstfp, "*%s %d: \"", name, i); + + if (valcount == 1) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", + attrname, i); + else if (defval == 0) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, i); + else if (defval < (valcount - 1)) + cupsFilePrintf(dstfp, ",%d\"\n", i); + else + cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", i); + } + } + else + { + /* + * List explicit numbers... + */ + + for (i = 0; i < suppattr->num_values; i ++) + { + cupsFilePrintf(dstfp, "*%s %d: \"", name, suppattr->values[i].integer); + + if (valcount == 1) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", attrname, + suppattr->values[i].integer); + else if (defval == 0) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, + suppattr->values[i].integer); + else if (defval < (valcount - 1)) + cupsFilePrintf(dstfp, ",%d\"\n", suppattr->values[i].integer); + else + cupsFilePrintf(dstfp, ",%d\n\"\n*End\n", suppattr->values[i].integer); + } + } + } + else + { + /* + * Do text options with a list... + */ + + cupsFilePrintf(dstfp, "*Default%s: %s\n", name, + defattr->values[defval].string.text); + + for (i = 0; i < suppattr->num_values; i ++) + { + cupsFilePrintf(dstfp, "*%s %s: \"", name, + suppattr->values[i].string.text); + + if (valcount == 1) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\n\"\n*End\n", attrname, + suppattr->values[i].string.text); + else if (defval == 0) + cupsFilePrintf(dstfp, "%%cupsJobTicket: %s=%s\"\n", attrname, + suppattr->values[i].string.text); + else if (defval < (valcount - 1)) + cupsFilePrintf(dstfp, ",%s\"\n", suppattr->values[i].string.text); + else + cupsFilePrintf(dstfp, ",%s\n\"\n*End\n", + suppattr->values[i].string.text); + } + } + + cupsFilePrintf(dstfp, "*JCLCloseUI: *%s\n\n", name); +} + + +/* + * End of "$Id: adminutil.c 5240 2006-03-07 21:55:29Z mike $". + */ diff --git a/cups/adminutil.h b/cups/adminutil.h new file mode 100644 index 000000000..8b66d1b8d --- /dev/null +++ b/cups/adminutil.h @@ -0,0 +1,89 @@ +/* + * "$Id: adminutil.h 5235 2006-03-06 13:02:23Z mike $" + * + * Administration utility API definitions for the Common UNIX Printing + * System (CUPS). + * + * MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO + * CHANGE AT ANY TIME. USE AT YOUR OWN RISK. + * + * Copyright 2001-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products 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 missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + */ + +#ifndef _CUPS_ADMINUTIL_H_ +# define _CUPS_ADMINUTIL_H_ + +/* + * Include necessary headers... + */ + +# include "cups.h" + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Constants... + */ + +# define CUPS_SERVER_DEBUG_LOGGING "_debug_logging" +# define CUPS_SERVER_REMOTE_ADMIN "_remote_admin" +# define CUPS_SERVER_REMOTE_PRINTERS "_remote_printers" +# define CUPS_SERVER_SHARE_PRINTERS "_share_printers" +# define CUPS_SERVER_USER_CANCEL_ANY "_user_cancel_any" + + +/* + * Functions... + */ + +extern int cupsAdminExportSamba(const char *dest, const char *ppd, + const char *samba_server, + const char *samba_user, + const char *samba_password, + FILE *logfile); +extern char *cupsAdminCreateWindowsPPD(http_t *http, const char *dest, + char *buffer, int bufsize); + +extern int _cupsAdminGetServerSettings(http_t *http, + int *num_settings, + cups_option_t **settings); +extern int _cupsAdminSetServerSettings(http_t *http, + int num_settings, + cups_option_t *settings); + + +# ifdef __cplusplus +} +# endif /* __cplusplus */ + +#endif /* !_CUPS_ADMINUTIL_H_ */ + +/* + * End of "$Id: adminutil.h 5235 2006-03-06 13:02:23Z mike $". + */ diff --git a/cups/cups.h b/cups/cups.h index 17db3d1d0..64b389a08 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -1,5 +1,5 @@ /* - * "$Id: cups.h 5156 2006-02-23 04:24:32Z mike $" + * "$Id: cups.h 5233 2006-03-06 03:39:28Z mike $" * * API definitions for the Common UNIX Printing System (CUPS). * @@ -61,10 +61,10 @@ extern "C" { * Constants... */ -# define CUPS_VERSION 1.0190 +# define CUPS_VERSION 1.0200 # define CUPS_VERSION_MAJOR 1 # define CUPS_VERSION_MINOR 2 -# define CUPS_VERSION_PATCH -10 +# define CUPS_VERSION_PATCH 0 # define CUPS_DATE_ANY -1 @@ -244,5 +244,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len); #endif /* !_CUPS_CUPS_H_ */ /* - * End of "$Id: cups.h 5156 2006-02-23 04:24:32Z mike $". + * End of "$Id: cups.h 5233 2006-03-06 03:39:28Z mike $". */ diff --git a/cups/emit.c b/cups/emit.c index f914f14d0..2aeda0114 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -1,5 +1,5 @@ /* - * "$Id: emit.c 5086 2006-02-07 02:45:26Z mike $" + * "$Id: emit.c 5238 2006-03-07 04:41:42Z mike $" * * PPD code emission routines for the Common UNIX Printing System (CUPS). * @@ -32,10 +32,12 @@ * ppdCollect2() - Collect all marked options that reside in the * specified section and minimum order. * ppdEmit() - Emit code for marked options to a file. - * ppdEmitAfterOrder() - Emit a subset of the code for marked options to a file. + * ppdEmitAfterOrder() - Emit a subset of the code for marked options to a + * file. * ppdEmitFd() - Emit code for marked options to a file. * ppdEmitJCL() - Emit code for JCL options to a file. * ppdEmitJCLEnd() - Emit JCLEnd code to a file. + * ppdEmitString() - Get a string containing the code for marked options. * ppd_handle_media() - Handle media selection... * ppd_sort() - Sort options by ordering numbers... */ @@ -47,6 +49,7 @@ #include "ppd.h" #include #include "string.h" +#include #if defined(WIN32) || defined(__EMX__) # include @@ -200,268 +203,40 @@ ppdEmitAfterOrder( ppd_file_t *ppd, /* I - PPD file record */ FILE *fp, /* I - File to write to */ ppd_section_t section, /* I - Section to write */ - int limit, /* I - Non-zero to use min_order, 0 to include all */ - float min_order) /* I - Lowest order dependency to include */ + int limit, /* I - Non-zero to use min_order */ + float min_order) /* I - Lowest OrderDependency */ { - int i, /* Looping var */ - count; /* Number of choices */ - ppd_choice_t **choices; /* Choices */ - ppd_size_t *size; /* Custom page size */ + char *buffer; /* Option code */ + int status; /* Return status */ /* - * Use PageSize or PageRegion as required... + * Range check input... */ - ppd_handle_media(ppd); + if (!ppd || !fp) + return (-1); /* - * Collect the options we need to emit and emit them! + * Get the string... */ - if ((count = ppdCollect2(ppd, section, min_order, &choices)) == 0) - return (0); - - for (i = 0; i < count; i ++) - if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL) - { - /* - * Send wrapper commands to prevent printer errors for unsupported - * options... - */ - - if (fputs("[{\n", fp) < 0) - { - free(choices); - return (-1); - } - - /* - * Send DSC comments with option... - */ - - if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || - !strcasecmp(choices[i]->option->keyword, "PageRegion")) && - !strcasecmp(choices[i]->choice, "Custom")) - { - /* - * Variable size; write out standard size options, using the - * parameter positions defined in the PPD file... - */ - - ppd_attr_t *attr; /* PPD attribute */ - int pos, /* Position of custom value */ - orientation; /* Orientation to use */ - float values[5]; /* Values for custom command */ - int isfloat[5]; /* Whether each value is float or int */ - - fputs("%%BeginFeature: *CustomPageSize True\n", fp); - - size = ppdPageSize(ppd, "Custom"); - - memset(values, 0, sizeof(values)); - memset(isfloat, 0, sizeof(isfloat)); - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Width")) != NULL) - { - pos = atoi(attr->value) - 1; - - if (pos < 0 || pos > 4) - pos = 0; - } - else - pos = 0; - - values[pos] = size->width; - isfloat[pos] = 1; - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Height")) != NULL) - { - pos = atoi(attr->value) - 1; - - if (pos < 0 || pos > 4) - pos = 1; - } - else - pos = 1; - - values[pos] = size->length; - isfloat[pos] = 1; - - /* - * According to the Adobe PPD specification, an orientation of 1 - * will produce a print that comes out upside-down with the X - * axis perpendicular to the direction of feed, which is exactly - * what we want to be consistent with non-PS printers. - * - * We could also use an orientation of 3 to produce output that - * comes out rightside-up (this is the default for many large format - * printer PPDs), however for consistency we will stick with the - * value 1. - * - * If we wanted to get fancy, we could use orientations of 0 or - * 2 and swap the width and length, however we don't want to get - * fancy, we just want it to work consistently. - * - * The orientation value is range limited by the Orientation - * parameter definition, so certain non-PS printer drivers that - * only support an Orientation of 0 will get the value 0 as - * expected. - */ - - orientation = 1; - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", - "Orientation")) != NULL) - { - int min_orient, max_orient; /* Minimum and maximum orientations */ - - - if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient, - &max_orient) != 3) - pos = 4; - else - { - pos --; - - if (pos < 0 || pos > 4) - pos = 4; - - if (orientation > max_orient) - orientation = max_orient; - else if (orientation < min_orient) - orientation = min_orient; - } - } - else - pos = 4; - - values[pos] = orientation; - - for (pos = 0; pos < 5; pos ++) - if (isfloat[pos]) - fprintf(fp, "%.2f\n", values[pos]); - else - fprintf(fp, "%.0f\n", values[pos]); - - if (choices[i]->code == NULL) - { - /* - * This can happen with certain buggy PPD files that don't include - * a CustomPageSize command sequence... We just use a generic - * Level 2 command sequence... - */ - - fputs(ppd_custom_code, fp); - } - } - else if (!strcasecmp(choices[i]->choice, "Custom")) - { - /* - * Custom option... - */ - - ppd_coption_t *coption; /* Custom option */ - ppd_cparam_t *cparam; /* Custom parameter */ - const char *s; /* Pointer into string value */ - - - /* - * TODO: Support custom options with more than 1 parameter... - */ - - if ((coption = ppdFindCustomOption(ppd, choices[i]->option->keyword)) - != NULL && - (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params)) != NULL) - { - if (fprintf(fp, "%%%%BeginFeature: *Custom%s True\n", - coption->keyword) < 0) - { - free(choices); - return (-1); - } - - switch (cparam->type) - { - case PPD_CUSTOM_CURVE : - case PPD_CUSTOM_INVCURVE : - case PPD_CUSTOM_POINTS : - case PPD_CUSTOM_REAL : - if (fprintf(fp, "%f\n", cparam->current.custom_real) < 0) - { - free(choices); - return (-1); - } - break; - - case PPD_CUSTOM_INT : - if (fprintf(fp, "%d\n", cparam->current.custom_int) < 0) - { - free(choices); - return (-1); - } - break; - - case PPD_CUSTOM_PASSCODE : - case PPD_CUSTOM_PASSWORD : - case PPD_CUSTOM_STRING : - putc('(', fp); - - for (s = cparam->current.custom_string; *s; s ++) - if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127) - fprintf(fp, "\\%03o", *s & 255); - else - putc(*s, fp); - - if (fputs(")\n", fp) < 0) - { - free(choices); - return (-1); - } - break; - } - } - } - else if (fprintf(fp, "%%%%BeginFeature: *%s %s\n", - choices[i]->option->keyword, - choices[i]->choice) < 0) - { - free(choices); - return (-1); - } + buffer = ppdEmitString(ppd, section, min_order); - if (choices[i]->code != NULL && choices[i]->code[0] != '\0') - { - if (fputs(choices[i]->code, fp) < 0) - { - free(choices); - return (-1); - } - - if (choices[i]->code[strlen(choices[i]->code) - 1] != '\n') - putc('\n', fp); - } + /* + * Write it as needed and return... + */ - if (fputs("%%EndFeature\n", fp) < 0) - { - free(choices); - return (-1); - } + if (buffer) + { + status = fputs(buffer, fp) < 0 ? -1 : 0; - if (fputs("} stopped cleartomark\n", fp) < 0) - { - free(choices); - return (-1); - } - } - else if (fputs(choices[i]->code, fp) < 0) - { - free(choices); - return (-1); - } + free(buffer); + } + else + status = 0; - free(choices); - return (0); + return (status); } @@ -474,194 +249,58 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */ int fd, /* I - File to write to */ ppd_section_t section) /* I - Section to write */ { - int i, /* Looping var */ - count, /* Number of choices */ - custom_size; /* Non-zero if this option is a custom size */ - ppd_choice_t **choices; /* Choices */ - ppd_size_t *size; /* Custom page size */ - char buf[1024]; /* Output buffer for feature */ + char *buffer, /* Option code */ + *bufptr; /* Pointer into code */ + size_t buflength; /* Length of option code */ + ssize_t bytes; /* Bytes written */ + int status; /* Return status */ /* - * Use PageSize or PageRegion as required... + * Range check input... */ - ppd_handle_media(ppd); + if (!ppd || fd < 0) + return (-1); /* - * Collect the options we need to emit and emit them! + * Get the string... */ - if ((count = ppdCollect(ppd, section, &choices)) == 0) - return (0); - - for (i = 0; i < count; i ++) - if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL) - { - /* - * Send wrapper commands to prevent printer errors for unsupported - * options... - */ - - if (write(fd, "[{\n", 3) < 1) - { - free(choices); - return (-1); - } - - /* - * Send DSC comments with option... - */ - - if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || - !strcasecmp(choices[i]->option->keyword, "PageRegion")) && - !strcasecmp(choices[i]->choice, "Custom")) - { - custom_size = 1; - - strcpy(buf, "%%BeginFeature: *CustomPageSize True\n"); - } - else - { - custom_size = 0; - - snprintf(buf, sizeof(buf), "%%%%BeginFeature: *%s %s\n", - choices[i]->option->keyword, choices[i]->choice); - } - - if (write(fd, buf, strlen(buf)) < 1) - { - free(choices); - return (-1); - } - - if (custom_size) - { - /* - * Variable size; write out standard size options, using the - * parameter positions defined in the PPD file... - */ - - ppd_attr_t *attr; /* PPD attribute */ - int pos, /* Position of custom value */ - values[5], /* Values for custom command */ - orientation; /* Orientation to use */ - - - size = ppdPageSize(ppd, "Custom"); - - memset(values, 0, sizeof(values)); - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Width")) != NULL) - { - pos = atoi(attr->value) - 1; - - if (pos < 0 || pos > 4) - pos = 0; - } - else - pos = 0; - - values[pos] = (int)size->width; - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Height")) != NULL) - { - pos = atoi(attr->value) - 1; - - if (pos < 0 || pos > 4) - pos = 1; - } - else - pos = 1; - - values[pos] = (int)size->length; - - if (size->width < size->length) - orientation = 1; - else - orientation = 0; - - if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", - "Orientation")) != NULL) - { - int min_orient, max_orient; /* Minimum and maximum orientations */ - - - if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient, - &max_orient) != 3) - pos = 4; - else - { - pos --; - - if (pos < 0 || pos > 4) - pos = 4; + buffer = ppdEmitString(ppd, section, 0.0); - if (orientation > max_orient) - orientation = max_orient; - else if (orientation < min_orient) - orientation = min_orient; - } - } - else - pos = 4; - - values[pos] = orientation; - - snprintf(buf, sizeof(buf), "%d %d %d %d %d\n", values[0], values[1], - values[2], values[3], values[4]); - - if (write(fd, buf, strlen(buf)) < 1) - { - free(choices); - return (-1); - } - - if (choices[i]->code == NULL) - { - /* - * This can happen with certain buggy PPD files that don't include - * a CustomPageSize command sequence... We just use a generic - * Level 2 command sequence... - */ - - if (write(fd, ppd_custom_code, strlen(ppd_custom_code)) < 1) - { - free(choices); - return (-1); - } - } - } + /* + * Write it as needed and return... + */ - if (choices[i]->code != NULL && choices[i]->code[0] != '\0') - { - if (write(fd, choices[i]->code, strlen(choices[i]->code)) < 1) - { - free(choices); - return (-1); - } - } + if (buffer) + { + buflength = strlen(buffer); + bufptr = buffer; + bytes = 0; - if (write(fd, "%%EndFeature\n", 13) < 1) + while (buflength > 0) + { + if ((bytes = write(fd, bufptr, buflength)) < 0) { - free(choices); - return (-1); - } + if (errno == EAGAIN || errno == EINTR) + continue; - if (write(fd, "} stopped cleartomark\n", 22) < 1) - { - free(choices); - return (-1); + break; } - } - else if (write(fd, choices[i]->code, strlen(choices[i]->code)) < 1) - { - free(choices); - return (-1); + + buflength -= bytes; + bufptr += bytes; } - free(choices); - return (0); + status = bytes < 0 ? -1 : 0; + + free(buffer); + } + else + status = 0; + + return (status); } @@ -684,7 +323,7 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */ * Range check the input... */ - if (ppd == NULL || ppd->jcl_begin == NULL || ppd->jcl_ps == NULL) + if (!ppd || !ppd->jcl_begin || !ppd->jcl_ps) return (0); /* @@ -780,24 +419,17 @@ int /* O - 0 on success, -1 on failure */ ppdEmitJCLEnd(ppd_file_t *ppd, /* I - PPD file record */ FILE *fp) /* I - File to write to */ { - ppd_attr_t *attr; /* PPD attributes */ - - /* * Range check the input... */ - if (ppd == NULL) + if (!ppd) return (0); - if (ppd->jcl_end == NULL) + if (!ppd->jcl_end) { if (ppd->num_filters == 0) - fputc(0x04, fp); - - if ((attr = ppdFindAttr(ppd, "cupsProtocol", NULL)) != NULL && - attr->value != NULL && !strcasecmp(attr->value, "TBCP")) - fputs("\033%-12345X", stdout); + putc(0x04, fp); return (0); } @@ -828,6 +460,365 @@ ppdEmitJCLEnd(ppd_file_t *ppd, /* I - PPD file record */ } +/* + * 'ppdEmitString()' - Get a string containing the code for marked options. + * + * When "min_order" is greater than zero, this function only includes options + * whose OrderDependency value is greater than or equal to "min_order". + * Otherwise, all options in the specified section are included in the + * returned string. + * + * The return string is allocated on the heap and should be freed using + * free() when you are done with it. + * + * @since CUPS 1.2@ + */ + +char * /* O - String containing option code */ +ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */ + ppd_section_t section, /* I - Section to write */ + float min_order) /* I - Lowest OrderDependency */ +{ + int i, j, /* Looping vars */ + count; /* Number of choices */ + ppd_choice_t **choices; /* Choices */ + ppd_size_t *size; /* Custom page size */ + ppd_coption_t *coption; /* Custom option */ + ppd_cparam_t *cparam; /* Custom parameter */ + size_t bufsize; /* Size of string buffer needed */ + char *buffer, /* String buffer */ + *bufptr, /* Pointer into buffer */ + *bufend; /* End of buffer */ + struct lconv *loc; /* Locale data */ + + + /* + * Range check input... + */ + + if (!ppd) + return (NULL); + + /* + * Use PageSize or PageRegion as required... + */ + + ppd_handle_media(ppd); + + /* + * Collect the options we need to emit... + */ + + if ((count = ppdCollect2(ppd, section, min_order, &choices)) == 0) + return (NULL); + + /* + * Count the number of bytes that are required to hold all of the + * option code... + */ + + for (i = 0, bufsize = 1; i < count; i ++) + { + if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL) + { + bufsize += 3; /* [{\n */ + + if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || + !strcasecmp(choices[i]->option->keyword, "PageRegion")) && + !strcasecmp(choices[i]->choice, "Custom")) + { + bufsize += 37; /* %%BeginFeature: *CustomPageSize True */ + bufsize += 50; /* Five 9-digit numbers + newline */ + } + else if (!strcasecmp(choices[i]->choice, "Custom") && + (coption = ppdFindCustomOption(ppd, + choices[i]->option->keyword)) + != NULL) + { + bufsize += 23 + strlen(choices[i]->option->keyword); + /* %%BeginFeature: *keyword True */ + + + for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params); + cparam; + cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) + { + switch (cparam->type) + { + case PPD_CUSTOM_CURVE : + case PPD_CUSTOM_INVCURVE : + case PPD_CUSTOM_POINTS : + case PPD_CUSTOM_REAL : + case PPD_CUSTOM_INT : + bufsize += 10; + break; + + case PPD_CUSTOM_PASSCODE : + case PPD_CUSTOM_PASSWORD : + case PPD_CUSTOM_STRING : + bufsize += 3 + 4 * strlen(cparam->current.custom_string); + break; + } + } + } + else + bufsize += 19 + strlen(choices[i]->option->keyword) + + strlen(choices[i]->choice); + /* %%BeginFeature: *keyword choice */ + + bufsize += 13; /* %%EndFeature\n */ + bufsize += 22; /* } stopped cleartomark\n */ + } + + if (choices[i]->code) + bufsize += strlen(choices[i]->code); + else + bufsize += strlen(ppd_custom_code); + } + + /* + * Allocate memory... + */ + + if ((buffer = calloc(1, bufsize)) == NULL) + { + free(choices); + return (NULL); + } + + bufend = buffer + bufsize - 1; + loc = localeconv(); + + /* + * Copy the option code to the buffer... + */ + + for (i = 0, bufptr = buffer; i < count; i ++, bufptr += strlen(bufptr)) + if (section != PPD_ORDER_EXIT && section != PPD_ORDER_JCL) + { + /* + * Add wrapper commands to prevent printer errors for unsupported + * options... + */ + + strlcpy(bufptr, "[{\n", bufend - bufptr + 1); + bufptr += 3; + + /* + * Send DSC comments with option... + */ + + if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || + !strcasecmp(choices[i]->option->keyword, "PageRegion")) && + !strcasecmp(choices[i]->choice, "Custom")) + { + /* + * Variable size; write out standard size options, using the + * parameter positions defined in the PPD file... + */ + + ppd_attr_t *attr; /* PPD attribute */ + int pos, /* Position of custom value */ + orientation; /* Orientation to use */ + float values[5]; /* Values for custom command */ + + + strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n", + bufend - bufptr + 1); + bufptr += 37; + + size = ppdPageSize(ppd, "Custom"); + + memset(values, 0, sizeof(values)); + + if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Width")) != NULL) + { + pos = atoi(attr->value) - 1; + + if (pos < 0 || pos > 4) + pos = 0; + } + else + pos = 0; + + values[pos] = size->width; + + if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Height")) != NULL) + { + pos = atoi(attr->value) - 1; + + if (pos < 0 || pos > 4) + pos = 1; + } + else + pos = 1; + + values[pos] = size->length; + + /* + * According to the Adobe PPD specification, an orientation of 1 + * will produce a print that comes out upside-down with the X + * axis perpendicular to the direction of feed, which is exactly + * what we want to be consistent with non-PS printers. + * + * We could also use an orientation of 3 to produce output that + * comes out rightside-up (this is the default for many large format + * printer PPDs), however for consistency we will stick with the + * value 1. + * + * If we wanted to get fancy, we could use orientations of 0 or + * 2 and swap the width and length, however we don't want to get + * fancy, we just want it to work consistently. + * + * The orientation value is range limited by the Orientation + * parameter definition, so certain non-PS printer drivers that + * only support an Orientation of 0 will get the value 0 as + * expected. + */ + + orientation = 1; + + if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", + "Orientation")) != NULL) + { + int min_orient, max_orient; /* Minimum and maximum orientations */ + + + if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient, + &max_orient) != 3) + pos = 4; + else + { + pos --; + + if (pos < 0 || pos > 4) + pos = 4; + + if (orientation > max_orient) + orientation = max_orient; + else if (orientation < min_orient) + orientation = min_orient; + } + } + else + pos = 4; + + values[pos] = orientation; + + for (pos = 0; pos < 5; pos ++) + { + bufptr = _cupsStrFormatd(bufptr, bufend, values[pos], loc); + *bufptr++ = '\n'; + } + + if (!choices[i]->code) + { + /* + * This can happen with certain buggy PPD files that don't include + * a CustomPageSize command sequence... We just use a generic + * Level 2 command sequence... + */ + + strlcpy(bufptr, ppd_custom_code, bufend - bufptr + 1); + bufptr += strlen(bufptr); + } + } + else if (!strcasecmp(choices[i]->choice, "Custom") && + (coption = ppdFindCustomOption(ppd, + choices[i]->option->keyword)) + != NULL) + { + /* + * Custom option... + */ + + const char *s; /* Pointer into string value */ + + + snprintf(bufptr, bufend - bufptr + 1, + "%%%%BeginFeature: *Custom%s True\n", coption->keyword); + bufptr += strlen(bufptr); + + for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params); + cparam; + cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) + { + switch (cparam->type) + { + case PPD_CUSTOM_CURVE : + case PPD_CUSTOM_INVCURVE : + case PPD_CUSTOM_POINTS : + case PPD_CUSTOM_REAL : + bufptr = _cupsStrFormatd(bufptr, bufend, + cparam->current.custom_real, loc); + *bufptr++ = '\n'; + break; + + case PPD_CUSTOM_INT : + snprintf(bufptr, bufend - bufptr + 1, "%d\n", + cparam->current.custom_int); + bufptr += strlen(bufptr); + break; + + case PPD_CUSTOM_PASSCODE : + case PPD_CUSTOM_PASSWORD : + case PPD_CUSTOM_STRING : + *bufptr++ = '('; + + for (s = cparam->current.custom_string; *s; s ++) + if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127) + { + snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *s & 255); + bufptr += strlen(bufptr); + } + else + *bufptr++ = *s; + + *bufptr++ = ')'; + *bufptr++ = '\n'; + break; + } + } + } + else + { + snprintf(bufptr, bufend - bufptr + 1, "%%%%BeginFeature: *%s %s\n", + choices[i]->option->keyword, choices[i]->choice); + bufptr += strlen(bufptr); + } + + if (choices[i]->code && choices[i]->code[0]) + { + j = strlen(choices[i]->code); + memcpy(bufptr, choices[i]->code, j); + bufptr += j; + + if (choices[i]->code[j - 1] != '\n') + *bufptr++ = '\n'; + } + + strlcpy(bufptr, "%%EndFeature\n" + "} stopped cleartomark\n", bufend - bufptr + 1); + bufptr += strlen(bufptr); + } + else + { + strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1); + bufptr += strlen(bufptr); + } + + /* + * Nul-terminate, free, and return... + */ + + *bufptr = '\0'; + + free(choices); + + return (buffer); +} + + /* * 'ppd_handle_media()' - Handle media selection... */ @@ -926,5 +917,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */ /* - * End of "$Id: emit.c 5086 2006-02-07 02:45:26Z mike $". + * End of "$Id: emit.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/encode.c b/cups/encode.c index b0bbdda5a..a57b0a850 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -1,5 +1,5 @@ /* - * "$Id: encode.c 5151 2006-02-22 22:43:17Z mike $" + * "$Id: encode.c 5230 2006-03-05 17:01:51Z mike $" * * Option encoding routines for the Common UNIX Printing System (CUPS). * @@ -341,7 +341,7 @@ cupsEncodeOptions2( * Allocate memory for the attribute values... */ - if ((attr = _ipp_add_attr(ipp, count)) == NULL) + if ((attr = _ippAddAttr(ipp, count)) == NULL) { /* * Ran out of memory! @@ -552,5 +552,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */ /* - * End of "$Id: encode.c 5151 2006-02-22 22:43:17Z mike $". + * End of "$Id: encode.c 5230 2006-03-05 17:01:51Z mike $". */ diff --git a/cups/getputfile.c b/cups/getputfile.c index 6c534a70f..9dc7f7a9c 100644 --- a/cups/getputfile.c +++ b/cups/getputfile.c @@ -1,5 +1,5 @@ /* - * "$Id: getputfile.c 5147 2006-02-22 16:37:44Z mike $" + * "$Id: getputfile.c 5235 2006-03-06 13:02:23Z mike $" * * Get/put file functions for the Common UNIX Printing System (CUPS). * @@ -68,6 +68,8 @@ cupsGetFd(http_t *http, /* I - HTTP connection to server */ int bytes; /* Number of bytes read */ char buffer[8192]; /* Buffer for file */ http_status_t status; /* HTTP status from server */ + char if_modified_since[HTTP_MAX_VALUE]; + /* If-Modified-Since header */ /* @@ -89,10 +91,14 @@ cupsGetFd(http_t *http, /* I - HTTP connection to server */ * Then send GET requests to the HTTP server... */ + strlcpy(if_modified_since, httpGetField(http, HTTP_FIELD_IF_MODIFIED_SINCE), + sizeof(if_modified_since)); + do { httpClearFields(http); httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring); + httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE, if_modified_since); if (httpGet(http, resource)) { @@ -482,5 +488,5 @@ cupsPutFile(http_t *http, /* I - HTTP connection to server */ /* - * End of "$Id: getputfile.c 5147 2006-02-22 16:37:44Z mike $". + * End of "$Id: getputfile.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/globals.c b/cups/globals.c index 3cbcadd17..98d5cf1ca 100644 --- a/cups/globals.c +++ b/cups/globals.c @@ -1,5 +1,5 @@ /* - * "$Id: globals.c 5047 2006-02-02 05:14:15Z mike $" + * "$Id: globals.c 5235 2006-03-06 13:02:23Z mike $" * * Global variable access routines for the Common UNIX Printing System (CUPS). * @@ -160,11 +160,13 @@ globals_destructor(void *value) /* I - Data to free */ if (cg->http) httpClose(cg->http); - _cups_sp_flush(cg); + _cupsStrFlush(cg); _cupsLangFlush(cg); _cupsCharmapFlush(cg); _cupsNormalizeMapsFlush(cg); + cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings); + free(value); } @@ -211,5 +213,5 @@ _cupsGlobals(void) /* - * End of "$Id: globals.c 5047 2006-02-02 05:14:15Z mike $". + * End of "$Id: globals.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/globals.h b/cups/globals.h index 1fae0efb2..15661d587 100644 --- a/cups/globals.h +++ b/cups/globals.h @@ -1,5 +1,5 @@ /* - * "$Id: globals.h 5138 2006-02-21 10:49:06Z mike $" + * "$Id: globals.h 5235 2006-03-06 13:02:23Z mike $" * * Global variable definitions for the Common UNIX Printing System (CUPS). * @@ -66,6 +66,14 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/ *cups_statedir, /* CUPS_STATEDIR environment var */ *localedir; /* LOCALDIR environment var */ + /* adminutil.c */ + time_t cupsd_update; /* Last time we got or set cupsd.conf */ + char cupsd_hostname[HTTP_MAX_HOST]; + /* Hostname for connection */ + int cupsd_num_settings; + /* Number of server settings */ + cups_option_t *cupsd_settings;/* Server settings */ + /* http.c */ char http_date[256]; /* Date+time buffer */ @@ -148,7 +156,7 @@ extern void _cupsLangFlush(_cups_globals_t *cg); extern void _cupsCharmapFlush(_cups_globals_t *cg); extern void _cupsNormalizeMapsFlush(_cups_globals_t *cg); extern void _cupsSetError(ipp_status_t status, const char *message); -extern void _cups_sp_flush(_cups_globals_t *cg); +extern void _cupsStrFlush(_cups_globals_t *cg); /* @@ -161,5 +169,5 @@ extern void _cups_sp_flush(_cups_globals_t *cg); #endif /* !_CUPS_GLOBALS_H_ */ /* - * End of "$Id: globals.h 5138 2006-02-21 10:49:06Z mike $". + * End of "$Id: globals.h 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/http-addr.c b/cups/http-addr.c index ec0f7b269..665829867 100644 --- a/cups/http-addr.c +++ b/cups/http-addr.c @@ -1,5 +1,5 @@ /* - * "$Id: http-addr.c 5161 2006-02-24 03:11:46Z mike $" + * "$Id: http-addr.c 5235 2006-03-06 13:02:23Z mike $" * * HTTP address routines for the Common UNIX Printing System (CUPS). * @@ -490,35 +490,43 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */ /* - * 'httpGetHostname()' - Get the FQDN for the local system. + * 'httpGetHostname()' - Get the FQDN for the connection or local system. * - * This function uses both gethostname() and gethostbyname() to - * get the local hostname with domain. + * When "http" points to a connected socket, return the hostname or + * address that was used in the call to httpConnect() or httpConnectEncrypt(). + * Otherwise, return the FQDN for the local system using both gethostname() + * and gethostbyname() to get the local hostname with domain. * * @since CUPS 1.2@ */ -const char * /* O - FQDN for this system */ -httpGetHostname(char *s, /* I - String buffer for name */ - int slen) /* I - Size of buffer */ +const char * /* O - FQDN for connection or system */ +httpGetHostname(http_t *http, /* I - HTTP connection or NULL */ + char *s, /* I - String buffer for name */ + int slen) /* I - Size of buffer */ { struct hostent *host; /* Host entry to get FQDN */ - /* - * Get the hostname... - */ - - gethostname(s, slen); - - if (!strchr(s, '.')) + if (http) + strlcpy(s, http->hostname, slen); + else { /* - * The hostname is not a FQDN, so look it up... + * Get the hostname... */ - if ((host = gethostbyname(s)) != NULL) - strlcpy(s, host->h_name, slen); + gethostname(s, slen); + + if (!strchr(s, '.')) + { + /* + * The hostname is not a FQDN, so look it up... + */ + + if ((host = gethostbyname(s)) != NULL) + strlcpy(s, host->h_name, slen); + } } /* @@ -530,5 +538,5 @@ httpGetHostname(char *s, /* I - String buffer for name */ /* - * End of "$Id: http-addr.c 5161 2006-02-24 03:11:46Z mike $". + * End of "$Id: http-addr.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/http.c b/cups/http.c index dc0da3892..2e380988e 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1,5 +1,5 @@ /* - * "$Id: http.c 5222 2006-03-03 18:57:56Z mike $" + * "$Id: http.c 5226 2006-03-04 22:03:18Z mike $" * * HTTP routines for the Common UNIX Printing System (CUPS). * @@ -539,6 +539,8 @@ httpGetBlocking(http_t *http) /* I - HTTP connection */ /* * 'httpGetCookie()' - Get any cookie data from the response. + * + * @since CUPS 1.1.19@ */ const char * /* O - Cookie data or NULL */ @@ -2754,5 +2756,5 @@ http_write_ssl(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: http.c 5222 2006-03-03 18:57:56Z mike $". + * End of "$Id: http.c 5226 2006-03-04 22:03:18Z mike $". */ diff --git a/cups/http.h b/cups/http.h index 6ff09a20f..1c520b932 100644 --- a/cups/http.h +++ b/cups/http.h @@ -1,5 +1,5 @@ /* - * "$Id: http.h 5147 2006-02-22 16:37:44Z mike $" + * "$Id: http.h 5235 2006-03-06 13:02:23Z mike $" * * Hyper-Text Transport Protocol definitions for the Common UNIX Printing * System (CUPS). @@ -462,7 +462,7 @@ extern int httpFlushWrite(http_t *http); extern int httpGetBlocking(http_t *http); extern const char *httpGetDateString2(time_t t, char *s, int slen); extern int httpGetFd(http_t *http); -extern const char *httpGetHostname(char *s, int slen); +extern const char *httpGetHostname(http_t *http, char *s, int slen); extern off_t httpGetLength2(http_t *http); extern http_status_t httpGetStatus(http_t *http); extern char *httpGetSubField2(http_t *http, http_field_t field, @@ -491,5 +491,5 @@ extern ssize_t httpWrite2(http_t *http, const char *buffer, #endif /* !_CUPS_HTTP_H_ */ /* - * End of "$Id: http.h 5147 2006-02-22 16:37:44Z mike $". + * End of "$Id: http.h 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/i18n.h b/cups/i18n.h index c2f3f474e..e5658f239 100644 --- a/cups/i18n.h +++ b/cups/i18n.h @@ -1,5 +1,5 @@ /* - * "$Id: i18n.h 4924 2006-01-13 01:55:20Z mike $" + * "$Id: i18n.h 5238 2006-03-07 04:41:42Z mike $" * * (Private) localization support for the Common UNIX Printing System (CUPS). * @@ -60,10 +60,6 @@ typedef struct _cups_message_s /**** Message catalog entry ****/ * Prototypes... */ -/**** New in CUPS 1.1.20 ****/ -extern void _cupsRestoreLocale(int category, char *oldlocale); -extern char *_cupsSaveLocale(int category, const char *locale); - /**** New in CUPS 1.2 ****/ extern const char *_cupsEncodingName(cups_encoding_t encoding); extern int _cupsLangPrintf(FILE *fp, const char *message, ...) @@ -84,5 +80,5 @@ extern const char *_cupsMessageLookup(cups_array_t *a, const char *m); #endif /* !_CUPS_I18N_H_ */ /* - * End of "$Id: i18n.h 4924 2006-01-13 01:55:20Z mike $". + * End of "$Id: i18n.h 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/ipp-private.h b/cups/ipp-private.h index 37473987f..af303f1da 100644 --- a/cups/ipp-private.h +++ b/cups/ipp-private.h @@ -1,5 +1,5 @@ /* - * "$Id: ipp-private.h 4973 2006-01-25 02:36:02Z mike $" + * "$Id: ipp-private.h 5230 2006-03-05 17:01:51Z mike $" * * Private IPP definitions for the Common UNIX Printing System (CUPS). * @@ -47,8 +47,8 @@ extern "C" { * Prototypes for private functions... */ -extern ipp_attribute_t *_ipp_add_attr(ipp_t *, int); -extern void _ipp_free_attr(ipp_attribute_t *); +extern ipp_attribute_t *_ippAddAttr(ipp_t *, int); +extern void _ippFreeAttr(ipp_attribute_t *); /* @@ -61,5 +61,5 @@ extern void _ipp_free_attr(ipp_attribute_t *); #endif /* !_CUPS_IPP_H_ */ /* - * End of "$Id: ipp-private.h 4973 2006-01-25 02:36:02Z mike $". + * End of "$Id: ipp-private.h 5230 2006-03-05 17:01:51Z mike $". */ diff --git a/cups/ipp.c b/cups/ipp.c index e9be31fe6..d34c35ccb 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 5047 2006-02-02 05:14:15Z mike $" + * "$Id: ipp.c 5231 2006-03-05 17:22:27Z mike $" * * Internet Printing Protocol support functions for the Common UNIX * Printing System (CUPS). @@ -57,8 +57,8 @@ * connection. * ippWriteFile() - Write data for an IPP message to a file. * ippWriteIO() - Write data for an IPP message. - * _ipp_add_attr() - Add a new attribute to the request. - * _ipp_free_attr() - Free an attribute. + * _ippAddAttr() - Add a new attribute to the request. + * _ippFreeAttr() - Free an attribute. * ipp_length() - Compute the length of an IPP message or * collection value. * ipp_read_http() - Semi-blocking read on a HTTP connection... @@ -111,10 +111,10 @@ ippAddBoolean(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_BOOLEAN; attr->values[0].boolean = value; @@ -145,10 +145,10 @@ ippAddBooleans(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_BOOLEAN; @@ -183,10 +183,10 @@ ippAddCollection(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_BEGIN_COLLECTION; attr->values[0].collection = value; @@ -220,10 +220,10 @@ ippAddCollections( if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_BEGIN_COLLECTION; @@ -256,10 +256,10 @@ ippAddDate(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL || value == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_DATE; memcpy(attr->values[0].date, value, 11); @@ -288,10 +288,10 @@ ippAddInteger(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = type; attr->values[0].integer = value; @@ -320,10 +320,10 @@ ippAddIntegers(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = type; @@ -356,14 +356,14 @@ ippAddOctetString(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); /* * Initialize the attribute data... */ - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_STRING; attr->values[0].unknown.length = datalen; @@ -402,7 +402,7 @@ ippAddString(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); /* @@ -432,13 +432,13 @@ ippAddString(ipp_t *ipp, /* I - IPP message */ * Initialize the attribute data... */ - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = type; attr->values[0].string.charset = ((int)type & IPP_TAG_COPY) ? (char *)charset : - charset ? _cups_sp_alloc(charset) : NULL; + charset ? _cupsStrAlloc(charset) : NULL; attr->values[0].string.text = ((int)type & IPP_TAG_COPY) ? (char *)value : - value ? _cups_sp_alloc(value) : NULL; + value ? _cupsStrAlloc(value) : NULL; return (attr); } @@ -466,14 +466,14 @@ ippAddStrings( if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); /* * Initialize the attribute data... */ - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = type; @@ -483,7 +483,7 @@ ippAddStrings( { if (i == 0) value->string.charset = ((int)type & IPP_TAG_COPY) ? (char *)charset : - charset ? _cups_sp_alloc(charset) : NULL; + charset ? _cupsStrAlloc(charset) : NULL; else value->string.charset = attr->values[0].string.charset; @@ -495,10 +495,10 @@ ippAddStrings( if (type == IPP_TAG_LANGUAGE && !strcasecmp(values[i], "C")) value->string.text = ((int)type & IPP_TAG_COPY) ? "en" : - _cups_sp_alloc("en"); + _cupsStrAlloc("en"); else value->string.text = ((int)type & IPP_TAG_COPY) ? (char *)values[i] : - _cups_sp_alloc(values[i]); + _cupsStrAlloc(values[i]); } } @@ -523,10 +523,10 @@ ippAddRange(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_RANGE; attr->values[0].range.lower = lower; @@ -556,10 +556,10 @@ ippAddRanges(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_RANGE; @@ -594,10 +594,10 @@ ippAddResolution(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 1)) == NULL) + if ((attr = _ippAddAttr(ipp, 1)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_RESOLUTION; attr->values[0].resolution.xres = xres; @@ -629,10 +629,10 @@ ippAddResolutions(ipp_t *ipp, /* I - IPP message */ if (ipp == NULL || name == NULL || num_values < 1) return (NULL); - if ((attr = _ipp_add_attr(ipp, num_values)) == NULL) + if ((attr = _ippAddAttr(ipp, num_values)) == NULL) return (NULL); - attr->name = _cups_sp_alloc(name); + attr->name = _cupsStrAlloc(name); attr->group_tag = group; attr->value_tag = IPP_TAG_RESOLUTION; @@ -665,7 +665,7 @@ ippAddSeparator(ipp_t *ipp) /* I - IPP message */ if (ipp == NULL) return (NULL); - if ((attr = _ipp_add_attr(ipp, 0)) == NULL) + if ((attr = _ippAddAttr(ipp, 0)) == NULL) return (NULL); attr->group_tag = IPP_TAG_ZERO; @@ -743,7 +743,7 @@ ippDelete(ipp_t *ipp) /* I - IPP message */ for (attr = ipp->attrs; attr != NULL; attr = next) { next = attr->next; - _ipp_free_attr(attr); + _ippFreeAttr(attr); } free(ipp); @@ -791,7 +791,7 @@ ippDeleteAttribute( * Free memory used by the attribute... */ - _ipp_free_attr(current); + _ippFreeAttr(current); } } @@ -1254,7 +1254,7 @@ ippReadIO(void *src, /* I - Data source */ if (ipp->current) ipp->prev = ipp->current; - attr = ipp->current = _ipp_add_attr(ipp, 1); + attr = ipp->current = _ippAddAttr(ipp, 1); DEBUG_printf(("ippReadIO: membername, ipp->current=%p, ipp->prev=%p\n", ipp->current, ipp->prev)); @@ -1280,14 +1280,14 @@ ippReadIO(void *src, /* I - Data source */ if (ipp->current) ipp->prev = ipp->current; - attr = ipp->current = _ipp_add_attr(ipp, 1); + attr = ipp->current = _ippAddAttr(ipp, 1); DEBUG_printf(("ippReadIO: name=\'%s\', ipp->current=%p, ipp->prev=%p\n", buffer, ipp->current, ipp->prev)); attr->group_tag = ipp->curtag; attr->value_tag = tag; - attr->name = _cups_sp_alloc((char *)buffer); + attr->name = _cupsStrAlloc((char *)buffer); attr->num_values = 0; } else @@ -1347,7 +1347,7 @@ ippReadIO(void *src, /* I - Data source */ } buffer[n] = '\0'; - value->string.text = _cups_sp_alloc((char *)buffer); + value->string.text = _cupsStrAlloc((char *)buffer); DEBUG_printf(("ippReadIO: value = \'%s\'\n", value->string.text)); break; @@ -1427,13 +1427,13 @@ ippReadIO(void *src, /* I - Data source */ string[n] = '\0'; } - value->string.charset = _cups_sp_alloc((char *)string); + value->string.charset = _cupsStrAlloc((char *)string); bufptr += 2 + n; n = (bufptr[0] << 8) | bufptr[1]; bufptr[2 + n] = '\0'; - value->string.text = _cups_sp_alloc((char *)bufptr + 2); + value->string.text = _cupsStrAlloc((char *)bufptr + 2); break; case IPP_TAG_BEGIN_COLLECTION : @@ -1480,7 +1480,7 @@ ippReadIO(void *src, /* I - Data source */ } buffer[n] = '\0'; - attr->name = _cups_sp_alloc((char *)buffer); + attr->name = _cupsStrAlloc((char *)buffer); /* * Since collection members are encoded differently than @@ -2400,17 +2400,17 @@ ippWriteIO(void *dst, /* I - Destination */ /* - * '_ipp_add_attr()' - Add a new attribute to the request. + * '_ippAddAttr()' - Add a new attribute to the request. */ ipp_attribute_t * /* O - New attribute */ -_ipp_add_attr(ipp_t *ipp, /* I - IPP message */ +_ippAddAttr(ipp_t *ipp, /* I - IPP message */ int num_values) /* I - Number of values */ { ipp_attribute_t *attr; /* New attribute */ - DEBUG_printf(("_ipp_add_attr(%p, %d)\n", ipp, num_values)); + DEBUG_printf(("_ippAddAttr(%p, %d)\n", ipp, num_values)); if (ipp == NULL || num_values < 0) return (NULL); @@ -2430,24 +2430,24 @@ _ipp_add_attr(ipp_t *ipp, /* I - IPP message */ ipp->last = attr; } - DEBUG_printf(("_ipp_add_attr(): %p\n", attr)); + DEBUG_printf(("_ippAddAttr(): %p\n", attr)); return (attr); } /* - * '_ipp_free_attr()' - Free an attribute. + * '_ippFreeAttr()' - Free an attribute. */ void -_ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */ +_ippFreeAttr(ipp_attribute_t *attr) /* I - Attribute to free */ { int i; /* Looping var */ ipp_value_t *value; /* Current value */ - DEBUG_printf(("_ipp_free_attr(): %p\n", attr)); + DEBUG_printf(("_ippFreeAttr(): %p\n", attr)); switch (attr->value_tag) { @@ -2463,7 +2463,7 @@ _ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */ for (i = 0, value = attr->values; i < attr->num_values; i ++, value ++) - _cups_sp_free(value->string.text); + _cupsStrFree(value->string.text); break; case IPP_TAG_TEXTLANG : @@ -2473,8 +2473,8 @@ _ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */ i ++, value ++) { if (value->string.charset && i == 0) - _cups_sp_free(value->string.charset); - _cups_sp_free(value->string.text); + _cupsStrFree(value->string.charset); + _cupsStrFree(value->string.text); } break; @@ -2506,7 +2506,7 @@ _ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */ } if (attr->name) - _cups_sp_free(attr->name); + _cupsStrFree(attr->name); free(attr); } @@ -2798,5 +2798,5 @@ ipp_write_file(int *fd, /* I - File descriptor */ /* - * End of "$Id: ipp.c 5047 2006-02-02 05:14:15Z mike $". + * End of "$Id: ipp.c 5231 2006-03-05 17:22:27Z mike $". */ diff --git a/cups/language.c b/cups/language.c index 169c38af9..1d1533fd3 100644 --- a/cups/language.c +++ b/cups/language.c @@ -1,5 +1,5 @@ /* - * "$Id: language.c 5109 2006-02-15 20:11:10Z mike $" + * "$Id: language.c 5238 2006-03-07 04:41:42Z mike $" * * I18N/language support for the Common UNIX Printing System (CUPS). * @@ -38,8 +38,6 @@ * _cupsMessageFree() - Free a messages array. * _cupsMessageLoad() - Load a .po file into a messages array. * _cupsMessageLookup() - Lookup a message string. - * _cupsRestoreLocale() - Restore the original locale... - * _cupsSaveLocale() - Set the locale and save a copy of the old locale... * appleLangDefault() - Get the default locale string. * cups_cache_lookup() - Lookup a language in the cache... * cups_message_compare() - Compare two messages. @@ -271,15 +269,12 @@ cupsLangGet(const char *language) /* I - Language or locale */ langname[16], /* Requested language name */ country[16], /* Country code */ charset[16], /* Character set */ -#ifdef CODESET *csptr, /* Pointer to CODESET string */ -#endif /* CODESET */ *ptr, /* Pointer into language/charset */ real[48], /* Real language name */ filename[1024]; /* Filename for language locale file */ cups_encoding_t encoding; /* Encoding to use */ cups_lang_t *lang; /* Current language... */ - char *oldlocale; /* Old locale name */ _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ static const char * const locale_encodings[] = @@ -327,19 +322,38 @@ cupsLangGet(const char *language) /* I - Language or locale */ DEBUG_printf(("cupsLangGet(language=\"%s\")\n", language ? language : "(null)")); #ifdef __APPLE__ + /* + * Set the character set to UTF-8... + */ + + strcpy(charset, "UTF8"); + /* * Apple's setlocale doesn't give us the user's localization * preference so we have to look it up this way... */ - if (language == NULL) + if (!language) language = appleLangDefault(); + #else - if (language == NULL) + /* + * Set the charset to "unknown"... + */ + + charset[0] = '\0'; + + /* + * Use setlocale() to determine the currently set locale, and then + * fallback to environment variables to avoid setting the locale, + * since setlocale() is not thread-safe! + */ + + if (!language) { /* * First see if the locale has been set; if it is still "C" or - * "POSIX", set the locale to the default... + * "POSIX", use the environment to get the default... */ # ifdef LC_MESSAGES @@ -352,14 +366,46 @@ cupsLangGet(const char *language) /* I - Language or locale */ ptr ? ptr : "(null)")); if (!ptr || !strcmp(ptr, "C") || !strcmp(ptr, "POSIX")) -# ifdef LC_MESSAGES { - ptr = setlocale(LC_MESSAGES, ""); - setlocale(LC_CTYPE, ""); + /* + * Get the character set from the LC_CTYPE locale setting... + */ + + if ((ptr = getenv("LC_CTYPE")) == NULL) + if ((ptr = getenv("LC_ALL")) == NULL) + if ((ptr = getenv("LANG")) == NULL) + ptr = "en_US"; + + if ((csptr = strchr(ptr, '.')) != NULL) + { + /* + * Extract the character set from the environment... + */ + + for (ptr = charset, csptr ++; *csptr; csptr ++) + if (ptr < (charset + sizeof(charset) - 1) && isalnum(*csptr & 255)) + *ptr++ = *csptr; + + *ptr = '\0'; + } + else + { + /* + * Default to UTF-8... + */ + + strcpy(charset, "UTF8"); + } + + /* + * Get the locale for messages from the LC_MESSAGES locale setting... + */ + + if ((ptr = getenv("LC_MESSAGES")) == NULL) + if ((ptr = getenv("LC_ALL")) == NULL) + if ((ptr = getenv("LANG")) == NULL) + ptr = "en_US"; } -# else - ptr = setlocale(LC_ALL, ""); -# endif /* LC_MESSAGES */ if (ptr) { @@ -380,27 +426,19 @@ cupsLangGet(const char *language) /* I - Language or locale */ if (!language) { /* - * Switch to the value of the "LANG" environment variable, and if - * that is NULL as well, use "C". + * Switch to the POSIX ("C") locale... */ - if ((language = getenv("LANG")) == NULL) - language = "C"; + language = "C"; } - /* - * Set the charset to "unknown"... - */ - - charset[0] = '\0'; - #ifdef CODESET /* * On systems that support the nl_langinfo(CODESET) call, use * this value as the character set... */ - if ((csptr = nl_langinfo(CODESET)) != NULL) + if (!charset[0] && (csptr = nl_langinfo(CODESET)) != NULL) { /* * Copy all of the letters and numbers in the CODESET string... @@ -417,22 +455,6 @@ cupsLangGet(const char *language) /* I - Language or locale */ } #endif /* CODESET */ - /* - * Set the locale back to POSIX while we do string ops, since - * apparently some buggy C libraries break ctype() for non-I18N - * chars... - */ - -#if defined(__APPLE__) - /* The ctype bug isn't in Apple's libc */ - (void)locale; /* anti-compiler-warning-code */ - (void)oldlocale; /* anti-compiler-warning-code */ -#elif !defined(LC_CTYPE) - oldlocale = _cupsSaveLocale(LC_ALL, "C"); -#else - oldlocale = _cupsSaveLocale(LC_CTYPE, "C"); -#endif /* __APPLE__ */ - /* * Parse the language string passed in to a locale string. "C" is the * standard POSIX locale and is copied unchanged. Otherwise the @@ -501,18 +523,6 @@ cupsLangGet(const char *language) /* I - Language or locale */ } } - /* - * Restore the locale... - */ - -#if defined(__APPLE__) - /* The ctype bug isn't in Apple's libc */ -#elif !defined(LC_CTYPE) - _cupsRestoreLocale(LC_ALL, oldlocale); -#else - _cupsRestoreLocale(LC_CTYPE, oldlocale); -#endif /* __APPLE__ */ - DEBUG_printf(("cupsLangGet: langname=\"%s\", country=\"%s\", charset=\"%s\"\n", langname, country, charset)); @@ -900,66 +910,6 @@ _cupsMessageLookup(cups_array_t *a, /* I - Message array */ } -/* - * '_cupsRestoreLocale()' - Restore the original locale... - */ - -void -_cupsRestoreLocale(int category, /* I - Category */ - char *oldlocale) /* I - Old locale or NULL */ -{ - DEBUG_printf(("_cupsRestoreLocale(category=%d, oldlocale=\"%s\")\n", - category, oldlocale)); - - if (oldlocale) - { - /* - * Reset the locale and free the locale string... - */ - - setlocale(category, oldlocale); - free(oldlocale); - } -} - - -/* - * '_cupsSaveLocale()' - Set the locale and save a copy of the old locale... - */ - -char * /* O - Old locale or NULL */ -_cupsSaveLocale(int category, /* I - Category */ - const char *locale) /* I - New locale or NULL */ -{ - char *oldlocale; /* Old locale */ - - - DEBUG_printf(("_cupsSaveLocale(category=%d, locale=\"%s\")\n", - category, locale)); - - /* - * Get the old locale and copy it... - */ - - if ((oldlocale = setlocale(category, NULL)) != NULL) - oldlocale = strdup(oldlocale); - - DEBUG_printf((" oldlocale=\"%s\"\n", oldlocale ? oldlocale : "(null)")); - - /* - * Set the new locale... - */ - - setlocale(category, locale); - - /* - * Return a copy of the old locale... - */ - - return (oldlocale); -} - - #ifdef __APPLE__ /* * Code & data to translate OSX's language names to their ISO 639-1 locale. @@ -1296,5 +1246,5 @@ cups_unquote(char *d, /* O - Unquoted string */ /* - * End of "$Id: language.c 5109 2006-02-15 20:11:10Z mike $". + * End of "$Id: language.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/libcups_s.exp b/cups/libcups_s.exp index 000766cdf..bcf6d564b 100644 --- a/cups/libcups_s.exp +++ b/cups/libcups_s.exp @@ -1,21 +1,27 @@ -_cups_hstrerror -_cups_md5_append -_cups_md5_finish -_cups_md5_init -_cups_strlcat -_cups_strlcpy +_cupsAdminGetServerSettings +_cupsAdminSetServerSettings +_cupsCharmapFlush _cupsEncodingName _cupsGetPassword _cupsGlobals +_cupsLangFlush _cupsLangPrintf _cupsLangPuts _cupsLangString +_cupsMD5Append +_cupsMD5Finish +_cupsMD5Init _cupsMessageFree _cupsMessageLoad _cupsMessageLookup -_cupsRestoreLocale -_cupsSaveLocale -_httpReadCDSA -_httpWriteCDSA -_ipp_add_attr -_ipp_free_attr +_cupsNormalizeMapsFlush +_cupsSetError +_cupsStrAlloc +_cups_strcpy +_cupsStrFlush +_cupsStrFree +_cups_strlcat +_cups_strlcpy +_cupsStrStatistics +_ippAddAttr +_ippFreeAttr diff --git a/cups/mark.c b/cups/mark.c index bb29bcbcf..5cbac1b76 100644 --- a/cups/mark.c +++ b/cups/mark.c @@ -1,5 +1,5 @@ /* - * "$Id: mark.c 5190 2006-02-27 02:42:07Z mike $" + * "$Id: mark.c 5238 2006-03-07 04:41:42Z mike $" * * Option marking routines for the Common UNIX Printing System (CUPS). * @@ -323,6 +323,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ int i, j; /* Looping vars */ ppd_option_t *o; /* Option pointer */ ppd_choice_t *c; /* Choice pointer */ + struct lconv *loc; /* Locale data */ DEBUG_printf(("ppdMarkOption(ppd=%p, option=\"%s\", choice=\"%s\")\n", @@ -354,6 +355,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ if ((o = ppdFindOption(ppd, option)) == NULL) return (0); + loc = localeconv(); if (!strncasecmp(choice, "Custom.", 7)) { @@ -380,7 +382,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ ppd_coption_t *coption; /* Custom option */ ppd_cparam_t *cparam; /* Custom parameter */ - char units[33]; /* Custom points units */ + char *units; /* Custom points units */ if ((coption = ppdFindCustomOption(ppd, option)) != NULL) { @@ -392,24 +394,27 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ case PPD_CUSTOM_CURVE : case PPD_CUSTOM_INVCURVE : case PPD_CUSTOM_REAL : - cparam->current.custom_real = atof(choice + 7); + cparam->current.custom_real = _cupsStrScand(choice + 7, NULL, + loc); break; case PPD_CUSTOM_POINTS : - if (sscanf(choice + 7, "%f%s", &(cparam->current.custom_points), - units) < 2) - strcpy(units, "pt"); - - if (!strcasecmp(units, "cm")) - cparam->current.custom_points *= 72.0 / 2.54; - else if (!strcasecmp(units, "mm")) - cparam->current.custom_points *= 72.0 / 25.4; - else if (!strcasecmp(units, "m")) - cparam->current.custom_points *= 72.0 / 0.0254; - else if (!strcasecmp(units, "in")) - cparam->current.custom_points *= 72.0; - else if (!strcasecmp(units, "ft")) - cparam->current.custom_points *= 12 * 72.0; + cparam->current.custom_points = _cupsStrScand(choice + 7, + &units, loc); + + if (units) + { + if (!strcasecmp(units, "cm")) + cparam->current.custom_points *= 72.0 / 2.54; + else if (!strcasecmp(units, "mm")) + cparam->current.custom_points *= 72.0 / 25.4; + else if (!strcasecmp(units, "m")) + cparam->current.custom_points *= 72.0 / 0.0254; + else if (!strcasecmp(units, "in")) + cparam->current.custom_points *= 72.0; + else if (!strcasecmp(units, "ft")) + cparam->current.custom_points *= 12 * 72.0; + } break; case PPD_CUSTOM_INT : @@ -436,7 +441,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ ppd_coption_t *coption; /* Custom option */ ppd_cparam_t *cparam; /* Custom parameter */ - char units[33]; /* Custom points units */ + char *units; /* Custom points units */ int num_vals; /* Number of values */ cups_option_t *vals, /* Values */ *val; /* Value */ @@ -459,24 +464,27 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ case PPD_CUSTOM_CURVE : case PPD_CUSTOM_INVCURVE : case PPD_CUSTOM_REAL : - cparam->current.custom_real = atof(val->value); + cparam->current.custom_real = _cupsStrScand(val->value, NULL, + loc); break; case PPD_CUSTOM_POINTS : - if (sscanf(val->value, "%f%s", &(cparam->current.custom_points), - units) < 2) - strcpy(units, "pt"); - - if (!strcasecmp(units, "cm")) - cparam->current.custom_points *= 72.0 / 2.54; - else if (!strcasecmp(units, "mm")) - cparam->current.custom_points *= 72.0 / 25.4; - else if (!strcasecmp(units, "m")) - cparam->current.custom_points *= 72.0 / 0.0254; - else if (!strcasecmp(units, "in")) - cparam->current.custom_points *= 72.0; - else if (!strcasecmp(units, "ft")) - cparam->current.custom_points *= 12 * 72.0; + cparam->current.custom_points = _cupsStrScand(val->value, &units, + loc); + + if (units) + { + if (!strcasecmp(units, "cm")) + cparam->current.custom_points *= 72.0 / 2.54; + else if (!strcasecmp(units, "mm")) + cparam->current.custom_points *= 72.0 / 25.4; + else if (!strcasecmp(units, "m")) + cparam->current.custom_points *= 72.0 / 0.0254; + else if (!strcasecmp(units, "in")) + cparam->current.custom_points *= 72.0; + else if (!strcasecmp(units, "ft")) + cparam->current.custom_points *= 12 * 72.0; + } break; case PPD_CUSTOM_INT : @@ -648,5 +656,5 @@ ppd_defaults(ppd_file_t *ppd, /* I - PPD file */ /* - * End of "$Id: mark.c 5190 2006-02-27 02:42:07Z mike $". + * End of "$Id: mark.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/md5-apple.h b/cups/md5-apple.h index d4770ccd1..4284ad4ab 100644 --- a/cups/md5-apple.h +++ b/cups/md5-apple.h @@ -1,5 +1,5 @@ /* - * "$Id: md5-apple.h 4695 2005-09-23 17:07:14Z mike $" + * "$Id: md5-apple.h 5232 2006-03-05 17:59:19Z mike $" * * MD5 MacOS X compatibility header for the Common UNIX Printing * System (CUPS). @@ -28,12 +28,12 @@ */ void md5_init(_cups_md5_state_t *pms) - { _cups_md5_init(pms); } + { _cupsMD5Init(pms); } void md5_append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) - { _cups_md5_append(pms, data, nbytes); } + { _cupsMD5Append(pms, data, nbytes); } void md5_finish(_cups_md5_state_t *pms, unsigned char digest[16]) - { _cups_md5_finish(pms, digest); } + { _cupsMD5Finish(pms, digest); } /* - * End of "$Id: md5-apple.h 4695 2005-09-23 17:07:14Z mike $". + * End of "$Id: md5-apple.h 5232 2006-03-05 17:59:19Z mike $". */ diff --git a/cups/md5.c b/cups/md5.c index a0469408c..9a3fab987 100644 --- a/cups/md5.c +++ b/cups/md5.c @@ -26,7 +26,7 @@ ghost@aladdin.com */ -/*$Id: md5.c 4695 2005-09-23 17:07:14Z mike $ */ +/*$Id: md5.c 5232 2006-03-05 17:59:19Z mike $ */ /* Independent implementation of MD5 (RFC 1321). @@ -273,7 +273,7 @@ _cups_md5_process(_cups_md5_state_t *pms, const unsigned char *data /*[64]*/) } void -_cups_md5_init(_cups_md5_state_t *pms) +_cupsMD5Init(_cups_md5_state_t *pms) { pms->count[0] = pms->count[1] = 0; pms->abcd[0] = 0x67452301; @@ -283,7 +283,7 @@ _cups_md5_init(_cups_md5_state_t *pms) } void -_cups_md5_append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) +_cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) { const unsigned char *p = data; int left = nbytes; @@ -321,7 +321,7 @@ _cups_md5_append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) } void -_cups_md5_finish(_cups_md5_state_t *pms, unsigned char digest[16]) +_cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]) { static const unsigned char pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -336,9 +336,9 @@ _cups_md5_finish(_cups_md5_state_t *pms, unsigned char digest[16]) for (i = 0; i < 8; ++i) data[i] = (unsigned char)(pms->count[i >> 2] >> ((i & 3) << 3)); /* Pad to 56 bytes mod 64. */ - _cups_md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); + _cupsMD5Append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); /* Append the length. */ - _cups_md5_append(pms, data, 8); + _cupsMD5Append(pms, data, 8); for (i = 0; i < 16; ++i) digest[i] = (unsigned char)(pms->abcd[i >> 2] >> ((i & 3) << 3)); } diff --git a/cups/md5.h b/cups/md5.h index 72b338b50..3b0281c0f 100644 --- a/cups/md5.h +++ b/cups/md5.h @@ -26,7 +26,7 @@ ghost@aladdin.com */ -/*$Id: md5.h 4512 2005-05-12 19:47:56Z mike $ */ +/*$Id: md5.h 5232 2006-03-05 17:59:19Z mike $ */ /* Independent implementation of MD5 (RFC 1321). @@ -60,13 +60,13 @@ extern "C" { # endif /* __cplusplus */ /* Initialize the algorithm. */ -void _cups_md5_init(_cups_md5_state_t *pms); +void _cupsMD5Init(_cups_md5_state_t *pms); /* Append a string to the message. */ -void _cups_md5_append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes); +void _cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes); /* Finish the message and return the digest. */ -void _cups_md5_finish(_cups_md5_state_t *pms, unsigned char digest[16]); +void _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]); # ifdef __cplusplus } /* end extern "C" */ diff --git a/cups/md5passwd.c b/cups/md5passwd.c index 1b9029a29..df8a75881 100644 --- a/cups/md5passwd.c +++ b/cups/md5passwd.c @@ -1,5 +1,5 @@ /* - * "$Id: md5passwd.c 4828 2005-11-11 12:53:38Z mike $" + * "$Id: md5passwd.c 5232 2006-03-05 17:59:19Z mike $" * * MD5 password support for the Common UNIX Printing System (CUPS). * @@ -59,9 +59,9 @@ httpMD5(const char *username, /* I - User name */ */ snprintf(line, sizeof(line), "%s:%s:%s", username, realm, passwd); - _cups_md5_init(&state); - _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line)); - _cups_md5_finish(&state, sum); + _cupsMD5Init(&state); + _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line)); + _cupsMD5Finish(&state, sum); /* * Return the sum... @@ -94,9 +94,9 @@ httpMD5Final(const char *nonce, /* I - Server nonce value */ */ snprintf(line, sizeof(line), "%s:%s", method, resource); - _cups_md5_init(&state); - _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line)); - _cups_md5_finish(&state, sum); + _cupsMD5Init(&state); + _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line)); + _cupsMD5Finish(&state, sum); httpMD5String(sum, a2); /* @@ -107,9 +107,9 @@ httpMD5Final(const char *nonce, /* I - Server nonce value */ snprintf(line, sizeof(line), "%s:%s:%s", md5, nonce, a2); - _cups_md5_init(&state); - _cups_md5_append(&state, (unsigned char *)line, (int)strlen(line)); - _cups_md5_finish(&state, sum); + _cupsMD5Init(&state); + _cupsMD5Append(&state, (unsigned char *)line, (int)strlen(line)); + _cupsMD5Finish(&state, sum); return (httpMD5String(sum, md5)); } @@ -147,5 +147,5 @@ httpMD5String(const unsigned char *sum, /* I - MD5 sum data */ /* - * End of "$Id: md5passwd.c 4828 2005-11-11 12:53:38Z mike $". + * End of "$Id: md5passwd.c 5232 2006-03-05 17:59:19Z mike $". */ diff --git a/cups/page.c b/cups/page.c index 0c340297a..f9ac4ef85 100644 --- a/cups/page.c +++ b/cups/page.c @@ -1,5 +1,5 @@ /* - * "$Id: page.c 4494 2005-02-18 02:18:11Z mike $" + * "$Id: page.c 5238 2006-03-07 04:41:42Z mike $" * * Page size functions for the Common UNIX Printing System (CUPS). * @@ -45,28 +45,29 @@ * 'ppdPageSize()' - Get the page size record for the given size. */ -ppd_size_t * /* O - Size record for page or NULL */ -ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ - const char *name) /* I - Size name */ +ppd_size_t * /* O - Size record for page or NULL */ +ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ + const char *name) /* I - Size name */ { - int i; /* Looping var */ - float w, l; /* Width and length of page */ - char units[255]; /* Page size units... */ + int i; /* Looping var */ + float w, l; /* Width and length of page */ + char *nameptr; /* Pointer into name */ + struct lconv *loc; /* Locale data */ - if (ppd == NULL) + if (!ppd) return (NULL); - if (name != NULL) + if (name) { - if (strncmp(name, "Custom.", 7) == 0 && ppd->variable_sizes) + if (!strncmp(name, "Custom.", 7) && ppd->variable_sizes) { /* * Find the custom page size... */ for (i = 0; i < ppd->num_sizes; i ++) - if (strcmp("Custom", ppd->sizes[i].name) == 0) + if (!strcmp("Custom", ppd->sizes[i].name)) break; if (i == ppd->num_sizes) @@ -81,11 +82,16 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ * Custom.WIDTHxLENGTH[pt] - Size in points */ - units[0] = '\0'; - if (sscanf(name + 7, "%fx%f%254s", &w, &l, units) < 2) + loc = localeconv(); + w = _cupsStrScand(name + 7, &nameptr, loc); + if (!nameptr || *nameptr != 'x') return (NULL); - if (strcasecmp(units, "in") == 0) + l = _cupsStrScand(nameptr, &nameptr, loc); + if (!nameptr) + return (NULL); + + if (!strcasecmp(nameptr, "in")) { ppd->sizes[i].width = w * 72.0f; ppd->sizes[i].length = l * 72.0f; @@ -94,7 +100,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ ppd->sizes[i].right = w * 72.0f - ppd->custom_margins[2]; ppd->sizes[i].top = l * 72.0f - ppd->custom_margins[3]; } - else if (strcasecmp(units, "cm") == 0) + else if (!strcasecmp(nameptr, "cm")) { ppd->sizes[i].width = w / 2.54f * 72.0f; ppd->sizes[i].length = l / 2.54f * 72.0f; @@ -103,7 +109,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ ppd->sizes[i].right = w / 2.54f * 72.0f - ppd->custom_margins[2]; ppd->sizes[i].top = l / 2.54f * 72.0f - ppd->custom_margins[3]; } - else if (strcasecmp(units, "mm") == 0) + else if (!strcasecmp(nameptr, "mm")) { ppd->sizes[i].width = w / 25.4f * 72.0f; ppd->sizes[i].length = l / 25.4f * 72.0f; @@ -131,7 +137,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ */ for (i = 0; i < ppd->num_sizes; i ++) - if (strcmp(name, ppd->sizes[i].name) == 0) + if (!strcasecmp(name, ppd->sizes[i].name)) return (ppd->sizes + i); } } @@ -187,5 +193,5 @@ ppdPageLength(ppd_file_t *ppd, /* I - PPD file */ /* - * End of "$Id: page.c 4494 2005-02-18 02:18:11Z mike $". + * End of "$Id: page.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/ppd.c b/cups/ppd.c index c13149320..f55f8865d 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -1,5 +1,5 @@ /* - * "$Id: ppd.c 5200 2006-02-28 00:10:32Z mike $" + * "$Id: ppd.c 5238 2006-03-07 04:41:42Z mike $" * * PPD file routines for the Common UNIX Printing System (CUPS). * @@ -393,7 +393,6 @@ ppdOpen(FILE *fp) /* I - File to read from */ ppd_file_t * /* O - PPD file record */ ppdOpen2(cups_file_t *fp) /* I - File to read from */ { - char *oldlocale; /* Old locale settings */ int i, j, k; /* Looping vars */ int count; /* Temporary count */ ppd_file_t *ppd; /* PPD file record */ @@ -420,6 +419,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ ppd_profile_t *profile; /* Pointer to color profile */ char **filter; /* Pointer to filter */ cups_lang_t *language; /* Default language */ + struct lconv *loc; /* Locale data */ int ui_keyword; /* Is this line a UI keyword? */ _cups_globals_t *cg = _cupsGlobals(); /* Global data */ @@ -554,12 +554,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ */ language = cupsLangDefault(); - -#ifdef LC_NUMERIC - oldlocale = _cupsSaveLocale(LC_NUMERIC, "C"); -#else - oldlocale = _cupsSaveLocale(LC_ALL, "C"); -#endif /* LC_NUMERIC */ + loc = localeconv(); /* * Read lines from the PPD file and add them to the file record... @@ -772,13 +767,18 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ memset(profile, 0, sizeof(ppd_profile_t)); strlcpy(profile->resolution, name, sizeof(profile->resolution)); strlcpy(profile->media_type, text, sizeof(profile->media_type)); - sscanf(string, "%f%f%f%f%f%f%f%f%f%f%f", &(profile->density), - &(profile->gamma), - profile->matrix[0] + 0, profile->matrix[0] + 1, - profile->matrix[0] + 2, profile->matrix[1] + 0, - profile->matrix[1] + 1, profile->matrix[1] + 2, - profile->matrix[2] + 0, profile->matrix[2] + 1, - profile->matrix[2] + 2); + + profile->density = _cupsStrScand(string, &sptr, loc); + profile->gamma = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[0][0] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[0][1] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[0][2] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[1][0] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[1][1] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[1][2] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[2][0] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[2][1] = _cupsStrScand(sptr, &sptr, loc); + profile->matrix[2][2] = _cupsStrScand(sptr, &sptr, loc); } else if (!strcmp(keyword, "cupsFilter")) { @@ -877,8 +877,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if (!strcmp(ctype, "curve")) { cparam->type = PPD_CUSTOM_CURVE; - cparam->minimum.custom_curve = atof(cminimum); - cparam->maximum.custom_curve = atof(cmaximum); + cparam->minimum.custom_curve = _cupsStrScand(cminimum, NULL, loc); + cparam->maximum.custom_curve = _cupsStrScand(cmaximum, NULL, loc); } else if (!strcmp(ctype, "int")) { @@ -889,8 +889,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ else if (!strcmp(ctype, "invcurve")) { cparam->type = PPD_CUSTOM_INVCURVE; - cparam->minimum.custom_invcurve = atof(cminimum); - cparam->maximum.custom_invcurve = atof(cmaximum); + cparam->minimum.custom_invcurve = _cupsStrScand(cminimum, NULL, loc); + cparam->maximum.custom_invcurve = _cupsStrScand(cmaximum, NULL, loc); } else if (!strcmp(ctype, "passcode")) { @@ -907,14 +907,14 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ else if (!strcmp(ctype, "points")) { cparam->type = PPD_CUSTOM_POINTS; - cparam->minimum.custom_points = atof(cminimum); - cparam->maximum.custom_points = atof(cmaximum); + cparam->minimum.custom_points = _cupsStrScand(cminimum, NULL, loc); + cparam->maximum.custom_points = _cupsStrScand(cmaximum, NULL, loc); } else if (!strcmp(ctype, "real")) { cparam->type = PPD_CUSTOM_REAL; - cparam->minimum.custom_real = atof(cminimum); - cparam->maximum.custom_real = atof(cmaximum); + cparam->minimum.custom_real = _cupsStrScand(cminimum, NULL, loc); + cparam->maximum.custom_real = _cupsStrScand(cmaximum, NULL, loc); } else if (!strcmp(ctype, "string")) { @@ -948,9 +948,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ } } else if (!strcmp(keyword, "HWMargins")) - sscanf(string, "%f%f%f%f", ppd->custom_margins + 0, - ppd->custom_margins + 1, ppd->custom_margins + 2, - ppd->custom_margins + 3); + { + for (i = 0, sptr = string; i < 4; i ++) + ppd->custom_margins[i] = _cupsStrScand(sptr, &sptr, loc); + } else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True")) { ppd_coption_t *coption; /* Custom option */ @@ -1344,7 +1345,9 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ else if (!strcmp(keyword, "OrderDependency") || !strcmp(keyword, "NonUIOrderDependency")) { - if (sscanf(string, "%f%40s%40s", &order, name, keyword) != 3) + order = _cupsStrScand(string, &sptr, loc); + + if (!sptr || sscanf(sptr, "%40s%40s", name, keyword) != 2) { cg->ppd_status = PPD_BAD_ORDER_DEPENDENCY; @@ -1560,7 +1563,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ goto error; } - sscanf(string, "%f%f", &(size->width), &(size->length)); + size->width = _cupsStrScand(string, &sptr, loc); + size->length = _cupsStrScand(sptr, NULL, loc); ppd_free(string); string = NULL; @@ -1581,8 +1585,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ goto error; } - sscanf(string, "%f%f%f%f", &(size->left), &(size->bottom), - &(size->right), &(size->top)); + size->left = _cupsStrScand(string, &sptr, loc); + size->bottom = _cupsStrScand(sptr, &sptr, loc); + size->right = _cupsStrScand(sptr, &sptr, loc); + size->top = _cupsStrScand(sptr, NULL, loc); ppd_free(string); string = NULL; @@ -1643,12 +1649,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ cupsLangFree(language); -#ifdef LC_NUMERIC - _cupsRestoreLocale(LC_NUMERIC, oldlocale); -#else - _cupsRestoreLocale(LC_ALL, oldlocale); -#endif /* LC_NUMERIC */ - #ifdef DEBUG if (!feof(fp)) printf("Premature EOF at %lu...\n", (unsigned long)ftell(fp)); @@ -1711,12 +1711,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ cupsLangFree(language); -#ifdef LC_NUMERIC - _cupsRestoreLocale(LC_NUMERIC, oldlocale); -#else - _cupsRestoreLocale(LC_ALL, oldlocale); -#endif /* LC_NUMERIC */ - return (NULL); } @@ -2885,5 +2879,5 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ /* - * End of "$Id: ppd.c 5200 2006-02-28 00:10:32Z mike $". + * End of "$Id: ppd.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/ppd.h b/cups/ppd.h index 2ec40c21f..d7688c3d5 100644 --- a/cups/ppd.h +++ b/cups/ppd.h @@ -1,5 +1,5 @@ /* - * "$Id: ppd.h 5190 2006-02-27 02:42:07Z mike $" + * "$Id: ppd.h 5238 2006-03-07 04:41:42Z mike $" * * PostScript Printer Description definitions for the Common UNIX Printing * System (CUPS). @@ -381,6 +381,8 @@ extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp, ppd_section_t section, int limit, float min_order); extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp); +extern char *ppdEmitString(ppd_file_t *ppd, ppd_section_t section, + float min_order); extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd, const char *keyword); extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt, @@ -403,5 +405,5 @@ extern ppd_file_t *ppdOpen2(cups_file_t *fp); #endif /* !_CUPS_PPD_H_ */ /* - * End of "$Id: ppd.h 5190 2006-02-27 02:42:07Z mike $". + * End of "$Id: ppd.h 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/string.c b/cups/string.c index b30c77075..b92773da3 100644 --- a/cups/string.c +++ b/cups/string.c @@ -1,5 +1,5 @@ /* - * "$Id: string.c 5047 2006-02-02 05:14:15Z mike $" + * "$Id: string.c 5238 2006-03-07 04:41:42Z mike $" * * String functions for the Common UNIX Printing System (CUPS). * @@ -25,10 +25,12 @@ * * Contents: * - * _cups_sp_alloc() - Allocate/reference a string. - * _cups_sp_flush() - Flush the string pool... - * _cups_sp_free() - Free/dereference a string. - * _cups_sp_statistics() - Return allocation statistics for string pool. + * _cupsStrAlloc() - Allocate/reference a string. + * _cupsStrFlush() - Flush the string pool... + * _cupsStrFormatd() - Format a floating-point number. + * _cupsStrFree() - Free/dereference a string. + * _cupsStrScand() - Scan a string for a floating-point number. + * _cupsStrStatistics() - Return allocation statistics for string pool. * _cups_strcpy() - Copy a string allowing for overlapping strings. * _cups_strdup() - Duplicate a string. * _cups_strcasecmp() - Do a case-insensitive comparison. @@ -57,11 +59,11 @@ static int compare_sp_items(_cups_sp_item_t *a, _cups_sp_item_t *b); /* - * '_cups_sp_alloc()' - Allocate/reference a string. + * '_cupsStrAlloc()' - Allocate/reference a string. */ char * /* O - String pointer */ -_cups_sp_alloc(const char *s) /* I - String */ +_cupsStrAlloc(const char *s) /* I - String */ { _cups_globals_t *cg; /* Global data */ _cups_sp_item_t *item, /* String pool item */ @@ -132,11 +134,11 @@ _cups_sp_alloc(const char *s) /* I - String */ /* - * '_cups_sp_flush()' - Flush the string pool... + * '_cupsStrFlush()' - Flush the string pool... */ void -_cups_sp_flush(_cups_globals_t *cg) /* I - Global data */ +_cupsStrFlush(_cups_globals_t *cg) /* I - Global data */ { _cups_sp_item_t *item; /* Current item */ @@ -154,11 +156,91 @@ _cups_sp_flush(_cups_globals_t *cg) /* I - Global data */ /* - * '_cups_sp_free()' - Free/dereference a string. + * '_cupsStrFormatd()' - Format a floating-point number. + */ + +char * /* O - Pointer to end of string */ +_cupsStrFormatd(char *buf, /* I - String */ + char *bufend, /* I - End of string buffer */ + double number, /* I - Number to format */ + struct lconv *loc) /* I - Locale data */ +{ + char *bufptr, /* Pointer into buffer */ + temp[1024], /* Temporary string */ + *tempdec, /* Pointer to decimal point */ + *tempptr; /* Pointer into temporary string */ + const char *dec; /* Decimal point */ + int declen; /* Length of decimal point */ + + + /* + * Format the number using the "%.12f" format and then eliminate + * unnecessary trailing 0's. + */ + + snprintf(temp, sizeof(temp), "%.12f", number); + for (tempptr = temp + strlen(temp) - 1; + tempptr > temp && *tempptr == '0'; + *tempptr-- = '\0'); + + /* + * Next, find the decimal point... + */ + + if (loc && loc->decimal_point) + { + dec = loc->decimal_point; + declen = strlen(dec); + } + else + { + dec = "."; + declen = 1; + } + + if (declen == 1) + tempdec = strchr(temp, *dec); + else + tempdec = strstr(temp, dec); + + /* + * Copy everything up to the decimal point... + */ + + if (tempdec) + { + for (tempptr = temp, bufptr = buf; + tempptr < tempdec && bufptr < bufend; + *bufptr++ = *tempptr++); + + tempdec += declen; + + if (*tempdec && bufptr < bufend) + { + *bufptr++ = '.'; + + while (*tempptr && bufptr < bufend) + *bufptr++ = *tempptr++; + } + + *bufptr = '\0'; + } + else + { + strlcpy(buf, temp, bufend - buf + 1); + bufptr = buf + strlen(buf); + } + + return (bufptr); +} + + +/* + * '_cupsStrFree()' - Free/dereference a string. */ void -_cups_sp_free(const char *s) +_cupsStrFree(const char *s) /* I - String to free */ { _cups_globals_t *cg; /* Global data */ _cups_sp_item_t *item, /* String pool item */ @@ -211,12 +293,103 @@ _cups_sp_free(const char *s) /* - * '_cups_sp_statistics()' - Return allocation statistics for string pool. + * '_cupsStrScand()' - Scan a string for a floating-point number. + * + * This function handles the locale-specific BS so that a decimal + * point is always the period (".")... + */ + +double /* O - Number */ +_cupsStrScand(const char *buf, /* I - Pointer to number */ + char **bufptr, /* O - New pointer or NULL on error */ + struct lconv *loc) /* I - Locale data */ +{ + char temp[1024], /* Temporary buffer */ + *tempptr; /* Pointer into temporary buffer */ + + + /* + * Range check input... + */ + + if (!buf) + return (0.0); + + /* + * Skip leading whitespace... + */ + + while (isspace(*buf & 255)) + buf ++; + + /* + * Copy leading sign, numbers, period, and then numbers... + */ + + tempptr = temp; + if (*buf == '-' || *buf == '+') + *tempptr++ = *buf++; + + while (isdigit(*buf & 255)) + if (tempptr < (temp + sizeof(temp) - 1)) + *tempptr++ = *buf++; + else + { + if (bufptr) + *bufptr = NULL; + + return (0.0); + } + + if (*buf == '.') + { + if (loc && loc->decimal_point) + { + strlcpy(tempptr, loc->decimal_point, sizeof(temp) - (tempptr - temp)); + tempptr += strlen(tempptr); + } + else if (tempptr < (temp + sizeof(temp) - 1)) + *tempptr++ = '.'; + else + { + if (bufptr) + *bufptr = NULL; + + return (0.0); + } + + while (isdigit(*buf & 255)) + if (tempptr < (temp + sizeof(temp) - 1)) + *tempptr++ = *buf++; + else + { + if (bufptr) + *bufptr = NULL; + + return (0.0); + } + } + + /* + * Nul-terminate the temporary string and return the value... + */ + + if (bufptr) + *bufptr = (char *)buf; + + *tempptr = '\0'; + + return (strtod(temp, NULL)); +} + + +/* + * '_cupsStrStatistics()' - Return allocation statistics for string pool. */ size_t /* O - Number of strings */ -_cups_sp_statistics(size_t *alloc_bytes,/* O - Allocated bytes */ - size_t *total_bytes)/* O - Total string bytes */ +_cupsStrStatistics(size_t *alloc_bytes, /* O - Allocated bytes */ + size_t *total_bytes) /* O - Total string bytes */ { size_t count, /* Number of strings */ abytes, /* Allocated string bytes */ @@ -455,5 +628,5 @@ compare_sp_items(_cups_sp_item_t *a, /* I - First item */ /* - * End of "$Id: string.c 5047 2006-02-02 05:14:15Z mike $". + * End of "$Id: string.c 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/string.h b/cups/string.h index 124cc7ede..1cec6aeec 100644 --- a/cups/string.h +++ b/cups/string.h @@ -1,5 +1,5 @@ /* - * "$Id: string.h 5047 2006-02-02 05:14:15Z mike $" + * "$Id: string.h 5238 2006-03-07 04:41:42Z mike $" * * String definitions for the Common UNIX Printing System (CUPS). * @@ -36,6 +36,7 @@ # include # include # include +# include # ifdef HAVE_STRING_H # include @@ -129,9 +130,19 @@ extern int _cups_vsnprintf(char *, size_t, const char *, va_list); * String pool functions... */ -extern char *_cups_sp_alloc(const char *s); -extern void _cups_sp_free(const char *s); -extern size_t _cups_sp_statistics(size_t *alloc_bytes, size_t *total_bytes); +extern char *_cupsStrAlloc(const char *s); +extern void _cupsStrFree(const char *s); +extern size_t _cupsStrStatistics(size_t *alloc_bytes, size_t *total_bytes); + + +/* + * Floating point number functions... + */ + +extern char *_cupsStrFormatd(char *buf, char *bufend, double number, + struct lconv *loc); +extern double _cupsStrScand(const char *buf, char **bufptr, + struct lconv *loc); /* @@ -145,5 +156,5 @@ extern size_t _cups_sp_statistics(size_t *alloc_bytes, size_t *total_bytes); #endif /* !_CUPS_STRING_H_ */ /* - * End of "$Id: string.h 5047 2006-02-02 05:14:15Z mike $". + * End of "$Id: string.h 5238 2006-03-07 04:41:42Z mike $". */ diff --git a/cups/testadmin.c b/cups/testadmin.c new file mode 100644 index 000000000..0f2e1d0c2 --- /dev/null +++ b/cups/testadmin.c @@ -0,0 +1,129 @@ +/* + * "$Id: testadmin.c 5240 2006-03-07 21:55:29Z mike $" + * + * Admin function test program for the Common UNIX Printing System (CUPS). + * + * Copyright 2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products 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 missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * main() - Main entry. + * show_settings() - Show settings in the array... + */ + +/* + * Include necessary headers... + */ + +#include "adminutil.h" +#include "string.h" + + +/* + * Local functions... + */ + +static void show_settings(int num_settings, cups_option_t *settings); + + +/* + * 'main()' - Main entry. + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line args */ + char *argv[]) /* I - Command-line arguments */ +{ + int i, /* Looping var */ + num_settings; /* Number of settings */ + cups_option_t *settings; /* Settings */ + http_t *http; /* Connection to server */ + + + /* + * Connect to the server using the defaults... + */ + + http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); + + /* + * Set the current configuration if we have anything on the command-line... + */ + + if (argc > 1) + { + for (i = 1, num_settings = 0; i < argc; i ++) + num_settings = cupsParseOptions(argv[i], num_settings, &settings); + + if (_cupsAdminSetServerSettings(http, num_settings, settings)) + { + puts("New server settings:"); + cupsFreeOptions(num_settings, settings); + } + else + { + printf("Server settings not changed: %s\n", cupsLastErrorString()); + return (1); + } + } + else + puts("Current server settings:"); + + /* + * Get the current configuration... + */ + + if (_cupsAdminGetServerSettings(http, &num_settings, &settings)) + { + show_settings(num_settings, settings); + cupsFreeOptions(num_settings, settings); + return (0); + } + else + { + printf(" %s\n", cupsLastErrorString()); + return (1); + } +} + + +/* + * 'show_settings()' - Show settings in the array... + */ + +static void +show_settings( + int num_settings, /* I - Number of settings */ + cups_option_t *settings) /* I - Settings */ +{ + while (num_settings > 0) + { + printf(" %s=%s\n", settings->name, settings->value); + + settings ++; + num_settings --; + } +} + + +/* + * End of "$Id: testadmin.c 5240 2006-03-07 21:55:29Z mike $". + */ diff --git a/cups/testhttp.c b/cups/testhttp.c index 71b8709f9..3fcffc659 100644 --- a/cups/testhttp.c +++ b/cups/testhttp.c @@ -1,5 +1,5 @@ /* - * "$Id: testhttp.c 5023 2006-01-29 14:39:44Z mike $" + * "$Id: testhttp.c 5235 2006-03-06 13:02:23Z mike $" * * HTTP test program for the Common UNIX Printing System (CUPS). * @@ -290,7 +290,7 @@ main(int argc, /* I - Number of command-line arguments */ fputs("httpGetHostname(): ", stdout); - if (httpGetHostname(hostname, sizeof(hostname))) + if (httpGetHostname(NULL, hostname, sizeof(hostname))) printf("PASS (%s)\n", hostname); else { @@ -515,5 +515,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: testhttp.c 5023 2006-01-29 14:39:44Z mike $". + * End of "$Id: testhttp.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/cups/util.c b/cups/util.c index 5a018b66f..aea6055a2 100644 --- a/cups/util.c +++ b/cups/util.c @@ -1,5 +1,5 @@ /* - * "$Id: util.c 5165 2006-02-24 21:20:30Z mike $" + * "$Id: util.c 5235 2006-03-06 13:02:23Z mike $" * * Printing utilities for the Common UNIX Printing System (CUPS). * @@ -839,7 +839,7 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */ * Remap local hostname to localhost... */ - httpGetHostname(localhost, sizeof(localhost)); + httpGetHostname(NULL, localhost, sizeof(localhost)); if (!strcasecmp(localhost, hostname)) strcpy(hostname, "localhost"); @@ -1641,5 +1641,5 @@ cups_get_printer_uri( /* - * End of "$Id: util.c 5165 2006-02-24 21:20:30Z mike $". + * End of "$Id: util.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/data/Makefile b/data/Makefile index 88c344f25..6910a1143 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5085 2006-02-06 13:27:53Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Datafile makefile for the Common UNIX Printing System (CUPS). # @@ -133,6 +133,13 @@ all: clean: +# +# Dummy depend... +# + +depend: + + # # Install files... # @@ -158,5 +165,30 @@ install: all # -# End of "$Id: Makefile 5085 2006-02-06 13:27:53Z mike $". +# Uninstall files... +# + +uninstall: + for file in $(BANNERS); do \ + $(RM) $(DATADIR)/banners/$$file; \ + done + for file in $(CHARMAPS); do \ + $(RM) $(DATADIR)/charmaps/$$file; \ + done + for file in $(CHARSETS); do \ + $(RM) $(DATADIR)/charsets/$$file; \ + done + for file in $(DATAFILES); do \ + $(RM) $(DATADIR)/data/$$file; \ + done + -$(RMDIR) $(DATADIR)/profiles + -$(RMDIR) $(DATADIR)/data + -$(RMDIR) $(DATADIR)/charsets + -$(RMDIR) $(DATADIR)/charmaps + -$(RMDIR) $(DATADIR)/banners + -$(RMDIR) $(DATADIR) + + +# +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/doc/Makefile b/doc/Makefile index ddfe235a3..de9b54782 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5224 2006-03-04 02:00:43Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Documentation makefile for the Common UNIX Printing System (CUPS). # @@ -40,7 +40,6 @@ WEBBUTTONS = \ images/button-add-class.gif \ images/button-add-printer.gif \ images/button-add-this-printer.gif \ - images/button-cancel.gif \ images/button-cancel-all-jobs.gif \ images/button-cancel-job.gif \ images/button-change-settings.gif \ @@ -188,6 +187,13 @@ all: clean: +# +# Dummy depend target... +# + +depend: + + # # Install all documentation files... # @@ -209,13 +215,40 @@ install: all $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \ if test -f $$lang/index.html; then \ $(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang; \ - fi \ + fi; \ for file in $(WEBBUTTONS); do \ if test -f $$lang/$$file; then \ $(INSTALL_MAN) $$lang/$$file $(DOCDIR)/$$lang/images; \ - fi \ + fi; \ + done \ + done + + +# +# Unnstall all documentation files... +# + +uninstall: + for file in $(WEBPAGES); do \ + $(RM) $(DOCDIR)/$$file; \ + done + for file in $(HELPFILES); do \ + $(INSTALL_MAN) $(DOCDIR)/help/$$file; \ + done + for file in $(WEBIMAGES) $(WEBBUTTONS); do \ + $(INSTALL_MAN) $(DOCDIR)/images/$$file; \ + done + -for lang in $(LANGUAGES); do \ + $(RM) $(DOCDIR)/$$lang/index.html; \ + for file in $(WEBBUTTONS); do \ + $(RM) $(DOCDIR)/$$lang/images/$$file; \ done \ + $(RMDIR) $(DOCDIR)/$$lang/images; \ + $(RMDIR) $(DOCDIR)/$$lang; \ done + -$(RMDIR) $(DOCDIR)/images + -$(RMDIR) $(DOCDIR)/help + -$(RMDIR) $(DOCDIR) # diff --git a/doc/cups-printable.css b/doc/cups-printable.css index 5019a4aaf..a6544b8d1 100644 --- a/doc/cups-printable.css +++ b/doc/cups-printable.css @@ -115,6 +115,10 @@ DD { margin-left: 54pt; } +DL.category DT { + font-weight: bold; +} + P.summary { margin-left: 54pt; font-family: monospace; diff --git a/doc/cups.css b/doc/cups.css index 298e66f39..53f5b8daa 100644 --- a/doc/cups.css +++ b/doc/cups.css @@ -227,6 +227,10 @@ DD { margin-left: 54pt; } +DL.category DT { + font-weight: bold; +} + P.summary { margin-left: 54pt; font-family: monospace; diff --git a/doc/help/cgi.html b/doc/help/cgi.html new file mode 100644 index 000000000..efb8efa0e --- /dev/null +++ b/doc/help/cgi.html @@ -0,0 +1,91 @@ + + + + Using CGI Programs + + + +

CUPS has traditionally provided a dynamic web interface +through dedicated CGI programs that are executed when users open +special directories on the CUPS server. Each CGI performs +administration, class, help, job, and printer functions as +directed by the user, but the actual programs that are run and +functions that are available are limited to those that were +originally designed into the scheduler.

+ +

Support is now available for CGI programs and specific +scripting languages, currently Java, Perl, PHP, and Python. The +interpreters for these languages are currently configured at +compile time. Future versions may expand the interface to allow +for generic support of scripting languages similar to the Apache +"AddHandler" directive, but with external programs instead of +modules.

+ +

Table 1 shows the MIME media types that are reserved for the +CGI support in CUPS. The names have been chosen to mirror those +used by Apache:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1: CGI MIME Media Types
MIME Media TypeDescription
application/x-httpd-cgiCGI script/program
application/x-httpd-javaJava program
application/x-httpd-perlPerl script
application/x-httpd-phpPHP script
application/x-httpd-pythonPython script
+ +

Configuring the Server

+ +

In order to enable the corresponding type, you must create a +new /etc/cups/cgi.types file which maps the filename +extensions to the appropriate MIME type, for example:

+ +
+application/x-httpd-cgi cgi
+application/x-httpd-java class
+application/x-httpd-perl pl
+application/x-httpd-php php
+application/x-httpd-python py
+
+ +

CGI scripts/programs (application/x-httpd-cgi) also must have +execution permissions to be treated as a CGI script or +program.

+ +

Limitations

+ +

CUPS implements most of the CGI/1.1 specification, with the +following exceptions:

+ +
    + +
  • No PATH_INFO or PATH_TRANSLATED support
  • + +
  • Limited HTTP field support; only the Content-Length + (CONTENT_LENGTH), Cookie (HTTP_COOKIE), and User-Agent + (HTTP_USER_AGENT) fields are placed in environment + variables at this time
  • + +
+ + + diff --git a/doc/help/ref-cupsd-conf.html b/doc/help/ref-cupsd-conf.html index ee69c1c05..2788879f7 100644 --- a/doc/help/ref-cupsd-conf.html +++ b/doc/help/ref-cupsd-conf.html @@ -14,6 +14,7 @@ BrowseLDAPServer BrowseLocalProtocols BrowseRemoteProtocols DefaultAuthType +DefaultEncryption DefaultPolicy FilterNice JobRetryInterval diff --git a/doc/help/whatsnew.html b/doc/help/whatsnew.html index 864ec23ff..7b5f0e59f 100644 --- a/doc/help/whatsnew.html +++ b/doc/help/whatsnew.html @@ -5,184 +5,520 @@ -

This document describes the new features in CUPS 1.2. If you +

CUPS 1.2 adds over 90 changes and new features to CUPS 1.1.x. +This page provides a high-level outline of these changes. If you have never used CUPS before, read the "Overview of CUPS" document instead. -CUPS 1.2 adds many new features to CUPS 1.1.x:

+HREF="overview.html">"Overview of CUPS" document instead.

-
    +

    Changes in CUPS 1.2

    -
  • Networking
  • +
    -
  • Printer Browsing
  • +
    Networking
    +
      -
    1. Web Interface
    2. +
    3. IPv6; CUPS now supports IPv6 + connectivity when the host operating system + provides it
    4. -
    5. IPP Support
    6. +
    7. Domain Sockets; CUPS now supports + the much faster UNIX domain sockets for local + printing
    8. -
    9. Scheduler
    10. +
    11. Auto-SSL; CUPS now automatically + detects when a client is connecting with SSL + encryption, so it can support both unencrypted, + SSL-encrypted, and TLS-encrypted connections over + a single port
    12. + +
    -
  • Localization and Internationalization
  • -
  • Printer Drivers
  • +
    Browsing
    +
      + +
    1. LDAP Support; CUPS now supports + printer sharing via the Lightweight Directory + Access Protocol, version 3
    2. + +
    3. Printer Lease Times; The server's + BrowseTimeout value is now included
    4. + +
    5. Network Default Options; The server + now advertises a printer's default options such + as job-sheets, media, and so forth
    6. + +
    7. Network Default Printer; CUPS now + advertises server-default printers so that + clients can choose the correct default network + printer
    8. + +
    9. "Delete Printer" Message; CUPS now + sends a final "delete printer" message to all + clients when a printer is deleted, allowing for + extremely long BrowseTimeout values without + side-effects
    10. -
    11. CUPS API
    12. +
    13. BrowseLocalOptions and + BrowseRemoteOptions Support; You can + configure CUPS to use specific IPP options for + local and remote printers, for example to + compress print jobs that are sent over a slow WAN + link
    14. -
    15. CUPS Imaging API
    16. +
    17. BrowseLocalProtocols and + BrowseRemoteProtocols Support; You can + configure CUPS to use different protocols for + advertising local shared printers and discovering + remote shared printers
    18. -
+ -

Networking

+
Web Interface
+
    -<-- -1. Networking - a. IPv6 - i. Next-generation Internet support - ii. ???? - b. Domain sockets - i. Enhanced performance under load for local clients. - ii. Authentication without passwords on platforms that support it. ---> +
  1. Improved Look and Feel; The web + interface has improved readability and a more + consistent design
  2. -

    CUPS 1.2 adds support for IPv6 and domain sockets. The IPv6 -support allows CUPS to work with the next-generation Internet as -well as taking advantage of automatic local network -configuration. Domain sockets provide 5 to 10 times faster -printing from the desktop.

    +
  3. New Searchable On-Line Help; The + on-line help has been reorganized into + categorized articles and references and can be + searched
  4. +
  5. Add This Printer; The administration + page offers a new Add This Printer + button for automatically-discovered printers, + making printer configuration even easier than + before
  6. -

    Printer Browsing

    +
  7. Export Printers to Samba; The + administration page now offers an Export + Printers to Samba button and function which + allows administrators to export printer drivers + to Windows clients via Samba
  8. -<-- -2. Printer Browsing - a. CUPS browsing updates - i. "Delete" bit for printers - ii. "lease-time" for printers so that clients and servers don't need - the same browse timeout/interval settings - iii. Additional attributes/default options for network-wide defaults - iv. Network default printer - v. Ability to control send and receive protocols independently - b. Rendevous support - c. LDAP support - d. Per-printer sharing ---> +
  9. Change Settings; The administration + page offers a new simple server settings form for + controlling common configuration settings such as + printer sharing and remote administration
  10. + +
  11. Edit Configuration File; The + administration page now provides a form for + editing the cupsd.conf file from your + web browser
  12. + +
  13. View Log Files; The administration + page now provides access to the + access_log, error_log, and + page_log log files
  14. + +
  15. Searchable Classes, Jobs, and + Printers; the class, job, and printer pages + can now be searched and shown in ascending or + descending order, with the results displayed in + groups of 10
  16. + +
  17. Links for Class Members; When + viewing a printer class, we now provide + hyperlinks to each of the class members - + previously only the names were shown
  18. + +
  19. Print Self-Test Page; When the + printer driver supports the CUPS command file + format, you can now print the printer's self-test + page
  20. + +
  21. Clean Print Heads; When the printer + driver supports the CUPS command file format, you + can now clean the printer's heads
  22. + +
  23. Set Default Options; You can now set + the default options for a printer, including the + new operation and error policies (the previous + incarnation of this was confusingly called + "Configure Printer")
  24. + +
  25. Set Default Printer; You can now + make a printer the default printer on the + network
  26. + +
  27. Set Allowed Users; You can now set + the list of users and/or groups that are allowed + or not allowed to access a printer or class
  28. + +
  29. Cancel All Jobs; You can now cancel + all jobs on a printer or class
  30. + +
  31. Move Job; You can now move an active + job to a different printer or class
  32. + +
  33. Move All Jobs; You can now move all + active jobs to a different printer or class
  34. + +
  35. Per-Printer Sharing; You can now + share (Publish) or hide (Unpublish) printers + individually
  36. + +
  37. Show All Jobs; You can now view all + jobs in addition to just the active or completed + jobs
  38. + +
+ + +
IPP Support
+
    + +
  1. IPP Notifications; CUPS now supports + the complete IPP notification specification to + provide asynchronous event notification to + clients and users
  2. + +
  3. ippget Notification Scheme; CUPS now + supports the required ippget pull + method for event notification, allowing + applications to receive events asychronously
  4. + +
  5. mailto Notification Scheme; CUPS now + supports mailto recipients as + proposed by the Printer Working Group, allowing + users to receive event notifications via + email
  6. + +
  7. CUPS Extensions to IPP + Notifications; CUPS adds several server + events (start, stop, restart, and audit) that can + be monitored via the IPP notification + operations
  8. + +
  9. CUPS-Get-Printers Improvements; The + CUPS-Get-Printers operation now returns all + queues by default and filters the results based + on the requesting-user-name + attribute
  10. + +
  11. Proxy Authentication; CUPS provides + the new CUPS-Authenticate-Job operation to + support proxy authentication of print jobs
  12. + +
  13. Unique Job IDs; CUPS maintains a new + job-uuid attribute which provides a + unique identifier that can be used to track a job + on your network or anywhere in the world
  14. + +
  15. port-monitor; CUPS now supports the + per-printer port-monitor and + port-monitor-supported attributes + for device-specific data/transport encoding
  16. + +
  17. printer-op-policy; CUPS supports new + printer-op-policy and + printer-op-policy-supported + attributes which provide per-printer fine-grained + access control policies
  18. + +
  19. printer-error-policy; CUPS supports + new printer-error-policy and + printer-error-policy-supported + attributes which provide per-printer control over + job error handling
  20. + +
  21. printer-is-shared; CUPS supports a + new printer-is-shared attribute + which provides per-printer sharing
  22. + +
  23. printer-state-change-time; CUPS now + tracks the last time and date of a change to the + printer configuration, enabled/disabled state, or + accepting/rejecting state
  24. + +
  25. printer-uri-supported; CUPS now + reports the IP address or hostname used by the + client in the printer-uri-supported + attribute - this prevents hostname resolution + issues on complex networks
  26. + +
  27. requested-attributes; CUPS now fully + supports limiting of attributes by name or group + - previously CUPS would only limit common + attributes and did not support attribute group + names
  28. + +
  29. Default Job Template Attributes; + CUPS now supports arbitrary default job template + attributes and applies them to print jobs as + needed
  30. + +
  31. which-jobs; The Get-Jobs operation + now supports a which-jobs value of + "all" to return all jobs regardless of state
  32. + +
  33. document-format-supported; The + document-format-supported attribute + now reflects the formats that are actually + supported by the printer
  34. + +
  35. printer-type; The + printer-type attribute now provides + bits for "not shared", "authenticated", and + "supports commands"
  36. + +
+ + +
Scheduler
+
    + +
  1. Remote Printer Caching; The scheduler + now maintains a remote printer cache so that + remote printers are not lost when the scheduler + or system is restarted
  2. + +
  3. Job Caching; The scheduler now + maintains a job cache so that completed jobs do + not need to be loaded into memory all of the time + - jobs are loaded and unloaded automatically for + optimum performance and memory usage
  4. + +
  5. Other Performance Improvements; + Thanks to new CUPS API interfaces, the schedule + now uses less memory, less CPU, and scales to + even larger installations
  6. + +
  7. Improved Logging; CUPS now logs the + IPP operation and status in in the + access_log file
  8. + +
  9. Policies; CUPS now provides + per-printer and server access control policies + based on IPP operations in addition to the + traditional location-based access control + available in previous releases
  10. + +
  11. DefaultAuthType; In conjunction with + the new policy support, CUPS now supports a + default authentication type that is used for IPP + operations requiring a username
  12. + +
  13. DefaultEncryption; When + authenticating a request, CUPS now uses the + DefaultEncryption setting in + addition to any location or policy encryption + setting in effect
  14. + +
  15. Per-Printer + document-format-supported; CUPS now + maintains per-printer + document-format-supported attributes + that reflect the formats that can be printed by a + particular printer
  16. + +
  17. Server-side Default Options; CUPS + now supports server-side default options for each + printer or class that are applied to new + jobs
  18. + +
  19. POSIX ACL Support; CUPS now uses + POSIX ACLs, when available, to allows multiple + system groups to be used for local certificate + authentication
  20. -

    CUPS 1.2 adds support for Bonjour/mDNS and LDAP-based printer -sharing. Printers can be shared or "published" individually, -allowing a server to only share specific printers, and you can -set which protocols to use for local and remote printers. -Previously CUPS would share all or none of its printers and use -the same protocols for local and remote printers.

    +
  21. RunAsUser Removed; The insecure + RunAsUser mode has been removed in favor of OS + mechanisms such as SELinux
  22. -

    CUPS Browse Protocol

    +
  23. Launchd Support; The schedule now + supports running via the MacOS X launchd program, + delaying cupsd startup until needed
  24. + +
  25. Dynamic Device Lookup; The scheduler + now queries the backends for devices as + needed - no more restarting to get new devices!
  26. + +
  27. Dynamic PPD/Printer Driver Lookup; + The scheduler now scans for PPD files and/or + printer drivers as needed - no more restarting + after installing drivers, and PPD files can be + generated dynamically!
  28. -

    The CUPS browse protocol has also been upgraded. New type -bits, authenticated, default, and deleted, provide key -information to clients. The "authenticated" type bit tells -clients that the print queue requires authentication when -printing. The "default" type bit tells clients that the print -queue should be used as the default unless the user sets a -different one. The "deleted" type bit is set when a printer is -deleted from the server - this allows the client to remove its -copy of a printer immediately rather than waiting for it to -timeout.

    +
  29. Port Monitor Support; CUPS now + supports "port monitor" filters between the + printer driver filters and backend to do printer- + and device-specific encoding and transport + functions.
  30. -

    Previously, a change to the BrowseTimeout setting on the -server had to be mirrored to each client. Browse packets now -include printer lease time information which allows the server to -use a different timeout setting than its clients, making -configuration simpler and more reliable.

    +
  31. Multi-File Job Improvements; CUPS + now sends multi-file jobs in a single connection + to the printer or remote server, preserving the + order of jobs
  32. -

    Browse packets can also now contain connection options to be -used when printing to the server. This allows the administrator -to require encryption or compress print jobs for certain -printers. This is most often used when printing over -limited-bandwidth WAN connections.

    +
  33. Environment Variable Support; The + scheduler now supports setting environment + variables for filters and CGI programs via the + Apache PassEnv and + SetEnv directives
  34. +
  35. Improved CGI Support; The scheduler + now supports more of the CGI/1.1 + specification
  36. -

    Web Interface

    +
  37. Log Files; Log files are now + accessible via HTTP requests using the + /conf/log/filename resource
  38. - +
  39. Power Management; The scheduler now + responds to power management events from the + operating system (currently MacOS X only)
  40. -

    The web interface features an all-new administration interface -which provides ...

    +
-

IPP Support

- - - - -

Scheduler

- - - - -

Localization and Internationalization

- - - - -

Printer Drivers

- - - - -

CUPS API

- - - - -

CUPS Imaging API

- - +
LPD Client Support
+
    + +
  1. Performance Improvements; CUPS no + longer loads every available printer before + accepting a print job
  2. + +
  3. Banner Support; Banner pages can now + be requested by an LPD client, with server-side + overrides as desired
  4. + +
  5. Multi-File Support; CUPS now creates + a single IPP job for multi-file LPD jobs
  6. + +
+ + +
Localization and Internationalization
+
    + +
  1. Command-Line Programs; All + command-line programs are now fully + localized
  2. + +
  3. Character Set Support; CUPS now + supports a wider range of character sets + including Big5 and Shift-JIS
  4. + +
  5. Globalized PPD Support; PPD files + can now contain multiple language + localizations
  6. + +
+ + +
Printer Drivers
+
    + +
  1. New Drivers; CUPS 1.2 adds Zebra + CPCL and EPL label printer drivers
  2. + +
  3. Driver Interfaces; CUPS now supports + driver interfaces which allow a driver to + advertise the printers it supports and + automatically generate the PPD file as + needed
  4. + +
  5. High-Definition Range Color; CUPS + 1.2 adds 16-bit per channel color support
  6. + +
  7. Raster Compression; The CUPS raster + format has been updated to use data + compression for faster printing
  8. + +
  9. Extended Printer Attributes; The + CUPS raster format has been extended to support + additional per-page printer-specific + attributes
  10. + +
  11. Back-Channel Data Support; Printer + drivers can now read data back from the printer + device
  12. + +
  13. Custom PPD Options; PPD files can + now contain options that accept custom + values
  14. + +
+ + +
CUPS API
+
    + +
  1. Thread Safety; All of the CUPS API + is now thread-safe on systems that support POSIX + threads
  2. + +
  3. Performance Improvements; Many of + the existing APIs have been optimized for + speed
  4. + +
  5. Array API; The new array API + provides a generic array container and is used to + implement many of the new CUPS 1.2 features and + performance improvements
  6. + +
  7. Directory API; The new directory API + allows applications to portably list the contents + of a directory
  8. + +
  9. File API; The new file API supports + optionally-compressed file IO and simple socket + communications without the limitations of + stdio
  10. + +
  11. HTTP API; The HTTP API now provides + many new URI and address handling functions, + accessor functions to key http_t + information, write-buffering functions, and large + file APIs
  12. + +
  13. IPP API; The IPP API now provides + functions to encode arbitrary options, add + octetString attributes, create + common IPP requests, convert IPP status and + operation code values to/from strings, and read + and write IPP messages via callbacks.
  14. + +
  15. PPD API; The PPD API has been + updated with new functions to support reading + from CUPS files, localization of globalized PPD + files, emission of arbitrary ranges of options, + custom option support, enhanced JCL support, and + access to all options in the PPD file
  16. + +
  17. Error Handling; The CUPS API now + provides a convenience function to get the full + error message of the last request
  18. + +
  19. Back-Channel API; The new + back-channel API provides backends and filters + with access to information sent back from a + printer
  20. + +
+ + +
CUPS Imaging API
+
    + +
  1. Image API; The new image API + provides access to image files of arbitrary size + and is based on the CUPS 1.1.x private image + filter APIs
  2. + +
  3. Raster API; The raster API provides + new functions to read and write the version 2 + raster page headers, and a new function to + generate a page header from marked PPD + options
  4. + +
+ + diff --git a/doc/index.html.in b/doc/index.html.in index d082fa8ac..b1bf01445 100644 --- a/doc/index.html.in +++ b/doc/index.html.in @@ -65,13 +65,13 @@ as perform system administration tasks. Click on any of the tabs above or on the buttons below to perform a task.

-Help -Add Class -Add Printer -Manage Classes -Manage Jobs -Manage Printers -Manage Server +Help +Add Class +Add Printer +Manage Classes +Manage Jobs +Manage Printers +Manage Server

If you are asked for a username and password, enter your login diff --git a/doc/ja/index.html.in b/doc/ja/index.html.in index 5b348005a..b87c016e5 100644 --- a/doc/ja/index.html.in +++ b/doc/ja/index.html.in @@ -65,13 +65,13 @@ BORDER="0" ALT=""> ボタンをクリックしてください。

-Help -クラスの追加 -プリンタの追加 -クラスの管理 -ジョブの管理 -プリンタの管理 -サーバの管理 +Help +クラスの追加 +プリンタの追加 +クラスの管理 +ジョブの管理 +プリンタの管理 +サーバの管理

ユーザ名とパスワードを尋ねられたら、あなたのユーザ名とパスワード、 diff --git a/filter/Makefile b/filter/Makefile index 06a31d5e1..6375bfbff 100644 --- a/filter/Makefile +++ b/filter/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5192 2006-02-27 03:08:47Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Filter makefile for the Common UNIX Printing System (CUPS). # @@ -103,6 +103,31 @@ installhdrs: $(INSTALL_DATA) raster.h $(INCLUDEDIR)/cups +# +# Uninstall all targets... +# + +uninstall: + for file in $(FILTERS); do \ + $(RM) $(SERVERBIN)/filter/$$file; \ + done + $(RM) $(SERVERBIN)/filter/rastertodymo + -$(RMDIR) $(SERVERBIN)/filter + -$(RMDIR) $(SERVERBIN) + $(RM) $(LIBDIR)/libcupsimage.2.dylib + $(RM) $(LIBDIR)/libcupsimage.a + $(RM) $(LIBDIR)/libcupsimage.dylib + $(RM) $(LIBDIR)/libcupsimage_s.a + $(RM) $(LIBDIR)/libcupsimage.sl + $(RM) $(LIBDIR)/libcupsimage.sl.2 + $(RM) $(LIBDIR)/libcupsimage.so + $(RM) $(LIBDIR)/libcupsimage.so.2 + -$(RMDIR) $(LIBDIR) + $(RM) $(INCLUDEDIR)/cups/image.h + $(RM) $(INCLUDEDIR)/cups/raster.h + -$(RMDIR) $(INCLUDEDIR)/cups + + # # Automatic API help files... # @@ -295,5 +320,5 @@ include Dependencies # -# End of "$Id: Makefile 5192 2006-02-27 03:08:47Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/fonts/Makefile b/fonts/Makefile index e22041de1..b6c37c9e9 100644 --- a/fonts/Makefile +++ b/fonts/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Fonts makefile for the Common UNIX Printing System (CUPS). # @@ -46,6 +46,13 @@ all: clean: +# +# Dummy depend target... +# + +depend: + + # # Install files... # @@ -58,5 +65,16 @@ install: all # -# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $". +# Uninstall files... +# + +uninstall: + for file in $(FONTS); do \ + $(RM) $(DATADIR)/fonts/$$file; \ + done + $(RMDIR) $(DATADIR)/fonts + + +# +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/locale/Makefile b/locale/Makefile index 1fef472e7..b20190daf 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5224 2006-03-04 02:00:43Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Locale file makefile for the Common UNIX Printing System (CUPS). # @@ -65,6 +65,18 @@ install: all done +# +# Uninstall files... +# + +uninstall: + -for loc in $(LANGUAGES) ; do \ + $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \ + $(RMDIR) $(LOCALEDIR)/$$loc ; \ + done + -$(RMDIR) $(LOCALEDIR) + + # # pot - Creates/updates the cups.pot template file, and merges changes # into existing message catalogs. @@ -102,5 +114,5 @@ translate.o: ../cups/http.h ../cups/i18n.h ../cups/language.h ../cups/string.h # -# End of "$Id: Makefile 5224 2006-03-04 02:00:43Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/locale/cups.pot b/locale/cups.pot index 9697db30e..281af4666 100644 --- a/locale/cups.pot +++ b/locale/cups.pot @@ -29,7 +29,7 @@ msgid "" msgstr "" "Project-Id-Version: CUPS 1.2\n" "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n" -"POT-Creation-Date: 2006-02-26 20:42-0500\n" +"POT-Creation-Date: 2006-03-05 22:39-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,31 +55,32 @@ msgstr "" #: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 cups/ppd.c:662 cups/ppd.c:996 #: cups/ppd.c:1169 cups/ppd.c:651 cups/ppd.c:983 cups/ppd.c:1148 +#: cups/ppd.c:972 cups/ppd.c:1137 msgid "General" msgstr "" #: cups/ppd.c:704 cups/ppd.c:1105 cups/ppd.c:710 cups/ppd.c:1224 -#: cups/ppd.c:697 cups/ppd.c:1201 +#: cups/ppd.c:697 cups/ppd.c:1201 cups/ppd.c:1190 msgid "Media Size" msgstr "" #: cups/ppd.c:706 cups/ppd.c:1107 cups/ppd.c:712 cups/ppd.c:1226 -#: cups/ppd.c:699 cups/ppd.c:1203 +#: cups/ppd.c:699 cups/ppd.c:1203 cups/ppd.c:1192 msgid "Media Type" msgstr "" #: cups/ppd.c:708 cups/ppd.c:1109 cups/ppd.c:714 cups/ppd.c:1228 -#: cups/ppd.c:701 cups/ppd.c:1205 +#: cups/ppd.c:701 cups/ppd.c:1205 cups/ppd.c:1194 msgid "Media Source" msgstr "" #: cups/ppd.c:710 cups/ppd.c:1111 cups/ppd.c:716 cups/ppd.c:1230 -#: cups/ppd.c:703 cups/ppd.c:1207 +#: cups/ppd.c:703 cups/ppd.c:1207 cups/ppd.c:1196 msgid "Output Mode" msgstr "" #: cups/ppd.c:712 cups/ppd.c:1113 cups/ppd.c:718 cups/ppd.c:1232 -#: cups/ppd.c:705 cups/ppd.c:1209 +#: cups/ppd.c:705 cups/ppd.c:1209 cups/ppd.c:1198 msgid "Resolution" msgstr "" @@ -87,11 +88,11 @@ msgstr "" msgid "Variable" msgstr "" -#: cups/ppd.c:1535 cups/ppd.c:1650 cups/ppd.c:1627 +#: cups/ppd.c:1535 cups/ppd.c:1650 cups/ppd.c:1627 cups/ppd.c:1616 msgid "Yes" msgstr "" -#: cups/ppd.c:1537 cups/ppd.c:1652 cups/ppd.c:1629 +#: cups/ppd.c:1537 cups/ppd.c:1652 cups/ppd.c:1629 cups/ppd.c:1618 msgid "No" msgstr "" @@ -100,12 +101,12 @@ msgid "Auto" msgstr "" #: scheduler/client.c:2247 scheduler/client.c:2251 scheduler/client.c:2274 -#: scheduler/client.c:2308 +#: scheduler/client.c:2308 scheduler/client.c:2349 msgid "Enter your username and password or the root username and password to access this page." msgstr "" #: scheduler/client.c:2252 scheduler/client.c:2256 scheduler/client.c:2279 -#: scheduler/client.c:2313 +#: scheduler/client.c:2313 scheduler/client.c:2354 msgid "You must use a https: URL to access this page." msgstr "" @@ -703,6 +704,7 @@ msgstr "" #: systemv/lpmove.c:84 systemv/accept.c:106 systemv/cancel.c:93 #: systemv/lpmove.c:89 berkeley/lpq.c:124 systemv/lp.c:136 #: systemv/lpstat.c:116 berkeley/lpr.c:116 systemv/lp.c:140 +#: systemv/cupsaddsmb.c:98 #, c-format msgid "%s: Sorry, no encryption support compiled in!\n" msgstr "" @@ -2608,7 +2610,7 @@ msgid "Edit Configuration File" msgstr "" #: cgi-bin/admin.c:2135 cgi-bin/admin.c:2147 cgi-bin/admin.c:2179 -#: cgi-bin/admin.c:2191 cgi-bin/printers.c:219 +#: cgi-bin/admin.c:2191 cgi-bin/printers.c:219 cgi-bin/printers.c:224 msgid "Unable to create temporary file:" msgstr "" @@ -2732,15 +2734,17 @@ msgid "Unable to change printer-is-shared attribute:" msgstr "" #: cgi-bin/classes.c:161 cgi-bin/classes.c:208 cgi-bin/classes.c:159 -#: cgi-bin/classes.c:206 +#: cgi-bin/classes.c:206 cgi-bin/classes.c:164 cgi-bin/classes.c:211 msgid "Classes" msgstr "" #: cgi-bin/classes.c:355 cgi-bin/classes.c:356 cgi-bin/classes.c:354 +#: cgi-bin/classes.c:359 msgid "Unable to get class list:" msgstr "" #: cgi-bin/classes.c:454 cgi-bin/classes.c:455 cgi-bin/classes.c:453 +#: cgi-bin/classes.c:458 msgid "Unable to get class status:" msgstr "" @@ -2782,15 +2786,18 @@ msgid "Job operation failed:" msgstr "" #: cgi-bin/printers.c:161 cgi-bin/printers.c:208 cgi-bin/printers.c:211 -#: cgi-bin/printers.c:166 cgi-bin/printers.c:335 +#: cgi-bin/printers.c:166 cgi-bin/printers.c:335 cgi-bin/printers.c:171 +#: cgi-bin/printers.c:340 msgid "Printers" msgstr "" #: cgi-bin/printers.c:362 cgi-bin/printers.c:366 cgi-bin/printers.c:518 +#: cgi-bin/printers.c:523 msgid "Unable to get printer list:" msgstr "" #: cgi-bin/printers.c:461 cgi-bin/printers.c:468 cgi-bin/printers.c:628 +#: cgi-bin/printers.c:633 msgid "Unable to get printer status:" msgstr "" @@ -2882,11 +2889,11 @@ msgstr "" msgid "Unknown" msgstr "" -#: cups/ppd.c:1033 cups/ppd.c:1020 +#: cups/ppd.c:1033 cups/ppd.c:1020 cups/ppd.c:1009 msgid "Custom" msgstr "" -#: cups/ppd.c:1259 cups/ppd.c:1236 +#: cups/ppd.c:1259 cups/ppd.c:1236 cups/ppd.c:1225 msgid "JCL" msgstr "" @@ -2894,17 +2901,17 @@ msgstr "" msgid "No authentication information provided!" msgstr "" -#: systemv/cupsaddsmb.c:440 +#: systemv/cupsaddsmb.c:440 systemv/cupsaddsmb.c:252 #, c-format msgid "Password for %s required to access %s via SAMBA: " msgstr "" -#: systemv/cupsaddsmb.c:451 +#: systemv/cupsaddsmb.c:451 cups/adminutil.c:626 #, c-format msgid "Running command: %s %s -N -U '%s%%%s' -c '%s'\n" msgstr "" -#: systemv/cupsaddsmb.c:479 +#: systemv/cupsaddsmb.c:479 cups/adminutil.c:656 #, c-format msgid "cupsaddsmb: Unable to run \"%s\": %s\n" msgstr "" @@ -3251,7 +3258,7 @@ msgstr "" msgid "%s: Invalid destination name in list \"%s\"!\n" msgstr "" -#: systemv/lpstat.c:571 +#: systemv/lpstat.c:571 systemv/cupsaddsmb.c:156 systemv/cupsaddsmb.c:177 #, c-format msgid "%s: Unable to connect to server\n" msgstr "" @@ -3330,7 +3337,7 @@ msgstr "" msgid "cupsd: Unknown argument \"%s\" - aborting!\n" msgstr "" -#: scheduler/main.c:2315 scheduler/main.c:2329 +#: scheduler/main.c:2315 scheduler/main.c:2329 scheduler/main.c:2304 msgid "" "Usage: cupsd [-c config-file] [-f] [-F] [-h] [-l]\n" "\n" @@ -3354,15 +3361,16 @@ msgstr "" msgid " WARN Non-Windows PPD files should use lines ending with only LF, not CR LF!\n" msgstr "" -#: cgi-bin/printers.c:218 cgi-bin/printers.c:289 +#: cgi-bin/printers.c:218 cgi-bin/printers.c:289 cgi-bin/printers.c:223 +#: cgi-bin/printers.c:294 msgid "Printer Maintenance" msgstr "" -#: cgi-bin/printers.c:292 +#: cgi-bin/printers.c:292 cgi-bin/printers.c:297 msgid "Unable to send maintenance job:" msgstr "" -#: systemv/cupsaddsmb.c:566 +#: systemv/cupsaddsmb.c:566 systemv/cupsaddsmb.c:233 #, c-format msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s\n" msgstr "" @@ -3402,6 +3410,77 @@ msgstr "" msgid " **FAIL** Bad cupsFilter value \"%s\"!\n" msgstr "" +#: cgi-bin/help.c:98 cgi-bin/help.c:139 cgi-bin/help.c:149 cgi-bin/help.c:179 +msgid "Help" +msgstr "" + +#: cups/adminutil.c:233 +#, c-format +msgid "Missing value on line %d!\n" +msgstr "" + +#: cups/adminutil.c:249 +#, c-format +msgid "Missing double quote on line %d!\n" +msgstr "" + +#: cups/adminutil.c:266 +#, c-format +msgid "Bad option + choice on line %d!\n" +msgstr "" + +#: cups/adminutil.c:417 +#, c-format +msgid "Unable to copy Windows 2000 printer driver files (%d)!\n" +msgstr "" + +#: cups/adminutil.c:445 +#, c-format +msgid "Unable to copy CUPS printer driver files (%d)!\n" +msgstr "" + +#: cups/adminutil.c:480 +#, c-format +msgid "Unable to install Windows 2000 printer driver files (%d)!\n" +msgstr "" + +#: cups/adminutil.c:514 +#, c-format +msgid "Unable to copy Windows 9x printer driver files (%d)!\n" +msgstr "" + +#: cups/adminutil.c:536 +#, c-format +msgid "Unable to install Windows 9x printer driver files (%d)!\n" +msgstr "" + +#: cups/adminutil.c:547 +msgid "No Windows printer drivers are installed!\n" +msgstr "" + +#: cups/adminutil.c:550 +msgid "Warning, no Windows 2000 printer drivers are installed!\n" +msgstr "" + +#: cups/adminutil.c:568 +#, c-format +msgid "Unable to set Windows printer driver (%d)!\n" +msgstr "" + +#: systemv/cupsaddsmb.c:278 +msgid "" +"Usage: cupsaddsmb [options] printer1 ... printerN\n" +" cupsaddsmb [options] -a\n" +"\n" +"Options:\n" +" -E Encrypt the connection to the server\n" +" -H samba-server Use the named SAMBA server\n" +" -U samba-user Authenticate using the named SAMBA user\n" +" -a Export all printers\n" +" -h cups-server Use the named CUPS server\n" +" -v Be verbose (show commands)\n" +msgstr "" + # # End of "$Id$". diff --git a/locale/cups_ja.po b/locale/cups_ja.po index cf0517f09..677c70806 100644 --- a/locale/cups_ja.po +++ b/locale/cups_ja.po @@ -25,7 +25,7 @@ msgid "" msgstr "" "Project-Id-Version: CUPS 1.2\n" "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n" -"POT-Creation-Date: 2006-02-26 20:42-0500\n" +"POT-Creation-Date: 2006-03-05 22:39-0500\n" "PO-Revision-Date: 2006-02-17 11:17+0900\n" "Last-Translator: Kenshi Muto \n" "Language-Team: Japanese \n" @@ -51,31 +51,32 @@ msgstr "補助" #: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 cups/ppd.c:662 cups/ppd.c:996 #: cups/ppd.c:1169 cups/ppd.c:651 cups/ppd.c:983 cups/ppd.c:1148 +#: cups/ppd.c:972 cups/ppd.c:1137 msgid "General" msgstr "一般" #: cups/ppd.c:704 cups/ppd.c:1105 cups/ppd.c:710 cups/ppd.c:1224 -#: cups/ppd.c:697 cups/ppd.c:1201 +#: cups/ppd.c:697 cups/ppd.c:1201 cups/ppd.c:1190 msgid "Media Size" msgstr "用紙サイズ" #: cups/ppd.c:706 cups/ppd.c:1107 cups/ppd.c:712 cups/ppd.c:1226 -#: cups/ppd.c:699 cups/ppd.c:1203 +#: cups/ppd.c:699 cups/ppd.c:1203 cups/ppd.c:1192 msgid "Media Type" msgstr "用紙形式" #: cups/ppd.c:708 cups/ppd.c:1109 cups/ppd.c:714 cups/ppd.c:1228 -#: cups/ppd.c:701 cups/ppd.c:1205 +#: cups/ppd.c:701 cups/ppd.c:1205 cups/ppd.c:1194 msgid "Media Source" msgstr "給紙" #: cups/ppd.c:710 cups/ppd.c:1111 cups/ppd.c:716 cups/ppd.c:1230 -#: cups/ppd.c:703 cups/ppd.c:1207 +#: cups/ppd.c:703 cups/ppd.c:1207 cups/ppd.c:1196 msgid "Output Mode" msgstr "出力モード" #: cups/ppd.c:712 cups/ppd.c:1113 cups/ppd.c:718 cups/ppd.c:1232 -#: cups/ppd.c:705 cups/ppd.c:1209 +#: cups/ppd.c:705 cups/ppd.c:1209 cups/ppd.c:1198 msgid "Resolution" msgstr "解像度" @@ -83,11 +84,11 @@ msgstr "解像度" msgid "Variable" msgstr "可変" -#: cups/ppd.c:1535 cups/ppd.c:1650 cups/ppd.c:1627 +#: cups/ppd.c:1535 cups/ppd.c:1650 cups/ppd.c:1627 cups/ppd.c:1616 msgid "Yes" msgstr "はい" -#: cups/ppd.c:1537 cups/ppd.c:1652 cups/ppd.c:1629 +#: cups/ppd.c:1537 cups/ppd.c:1652 cups/ppd.c:1629 cups/ppd.c:1618 msgid "No" msgstr "いいえ" @@ -96,7 +97,7 @@ msgid "Auto" msgstr "自動" #: scheduler/client.c:2247 scheduler/client.c:2251 scheduler/client.c:2274 -#: scheduler/client.c:2308 +#: scheduler/client.c:2308 scheduler/client.c:2349 msgid "" "Enter your username and password or the root username and password to access " "this page." @@ -105,7 +106,7 @@ msgstr "" "のユーザ名とパスワードを入力してください。" #: scheduler/client.c:2252 scheduler/client.c:2256 scheduler/client.c:2279 -#: scheduler/client.c:2313 +#: scheduler/client.c:2313 scheduler/client.c:2354 msgid "You must use a https: URL to access this page." msgstr "このページにアクセスするためには、https: URL を使う必要があります。" @@ -734,6 +735,7 @@ msgstr "lpq: サーバに連絡できません!\n" #: systemv/lpmove.c:84 systemv/accept.c:106 systemv/cancel.c:93 #: systemv/lpmove.c:89 berkeley/lpq.c:124 systemv/lp.c:136 #: systemv/lpstat.c:116 berkeley/lpr.c:116 systemv/lp.c:140 +#: systemv/cupsaddsmb.c:98 #, c-format msgid "%s: Sorry, no encryption support compiled in!\n" msgstr "%s: すみません、暗号化サポートはコンパイル時に組み込まれていません!\n" @@ -2835,7 +2837,7 @@ msgid "Edit Configuration File" msgstr "設定ファイルの編集" #: cgi-bin/admin.c:2135 cgi-bin/admin.c:2147 cgi-bin/admin.c:2179 -#: cgi-bin/admin.c:2191 cgi-bin/printers.c:219 +#: cgi-bin/admin.c:2191 cgi-bin/printers.c:219 cgi-bin/printers.c:224 msgid "Unable to create temporary file:" msgstr "テンポラリファイルを作成できません:" @@ -2959,15 +2961,17 @@ msgid "Unable to change printer-is-shared attribute:" msgstr "printer-is-shared 属性を変更できません:" #: cgi-bin/classes.c:161 cgi-bin/classes.c:208 cgi-bin/classes.c:159 -#: cgi-bin/classes.c:206 +#: cgi-bin/classes.c:206 cgi-bin/classes.c:164 cgi-bin/classes.c:211 msgid "Classes" msgstr "クラス" #: cgi-bin/classes.c:355 cgi-bin/classes.c:356 cgi-bin/classes.c:354 +#: cgi-bin/classes.c:359 msgid "Unable to get class list:" msgstr "クラスリストを取得できません:" #: cgi-bin/classes.c:454 cgi-bin/classes.c:455 cgi-bin/classes.c:453 +#: cgi-bin/classes.c:458 msgid "Unable to get class status:" msgstr "クラスの状態を取得できません:" @@ -3009,15 +3013,18 @@ msgid "Job operation failed:" msgstr "ジョブ操作に失敗しました:" #: cgi-bin/printers.c:161 cgi-bin/printers.c:208 cgi-bin/printers.c:211 -#: cgi-bin/printers.c:166 cgi-bin/printers.c:335 +#: cgi-bin/printers.c:166 cgi-bin/printers.c:335 cgi-bin/printers.c:171 +#: cgi-bin/printers.c:340 msgid "Printers" msgstr "プリンタ" #: cgi-bin/printers.c:362 cgi-bin/printers.c:366 cgi-bin/printers.c:518 +#: cgi-bin/printers.c:523 msgid "Unable to get printer list:" msgstr "プリンタリストを取得できません:" #: cgi-bin/printers.c:461 cgi-bin/printers.c:468 cgi-bin/printers.c:628 +#: cgi-bin/printers.c:633 msgid "Unable to get printer status:" msgstr "プリンタの状態を取得できません:" @@ -3109,11 +3116,11 @@ msgstr "不正なカスタムパラメータ" msgid "Unknown" msgstr "未知" -#: cups/ppd.c:1033 cups/ppd.c:1020 +#: cups/ppd.c:1033 cups/ppd.c:1020 cups/ppd.c:1009 msgid "Custom" msgstr "カスタム" -#: cups/ppd.c:1259 cups/ppd.c:1236 +#: cups/ppd.c:1259 cups/ppd.c:1236 cups/ppd.c:1225 msgid "JCL" msgstr "JCL" @@ -3121,17 +3128,17 @@ msgstr "JCL" msgid "No authentication information provided!" msgstr "認証情報が提供されていません!" -#: systemv/cupsaddsmb.c:440 +#: systemv/cupsaddsmb.c:440 systemv/cupsaddsmb.c:252 #, c-format msgid "Password for %s required to access %s via SAMBA: " msgstr "SAMBA 経由で %2$s にアクセスするのに必要な %1$s のパスワード: " -#: systemv/cupsaddsmb.c:451 +#: systemv/cupsaddsmb.c:451 cups/adminutil.c:626 #, c-format msgid "Running command: %s %s -N -U '%s%%%s' -c '%s'\n" msgstr "コマンドを実行中: %s %s -N -U '%s%%%s' -c '%s'\n" -#: systemv/cupsaddsmb.c:479 +#: systemv/cupsaddsmb.c:479 cups/adminutil.c:656 #, c-format msgid "cupsaddsmb: Unable to run \"%s\": %s\n" msgstr "cupsaddsmb: \"%s\" を実行できません: %s\n" @@ -3512,7 +3519,7 @@ msgstr "%s: エラー - '-b' オプションのあとに宛先を指定する必 msgid "%s: Invalid destination name in list \"%s\"!\n" msgstr "%s: リスト \"%s\" に無効な宛先名があります!\n" -#: systemv/lpstat.c:571 +#: systemv/lpstat.c:571 systemv/cupsaddsmb.c:156 systemv/cupsaddsmb.c:177 #, c-format msgid "%s: Unable to connect to server\n" msgstr "%s: サーバに接続できません\n" @@ -3593,7 +3600,7 @@ msgstr "cupsd: \"%c\" は未知のオプションです - 停止します!\n" msgid "cupsd: Unknown argument \"%s\" - aborting!\n" msgstr "cupsd: \"%s\" は未知の引数です - 停止します!\n" -#: scheduler/main.c:2315 scheduler/main.c:2329 +#: scheduler/main.c:2315 scheduler/main.c:2329 scheduler/main.c:2304 msgid "" "Usage: cupsd [-c config-file] [-f] [-F] [-h] [-l]\n" "\n" @@ -3630,17 +3637,18 @@ msgstr "" " 警告 非 Windows PPD ファイルは、CR LF でなく LF のみを行末に使うべ" "きです!\n" -#: cgi-bin/printers.c:218 cgi-bin/printers.c:289 +#: cgi-bin/printers.c:218 cgi-bin/printers.c:289 cgi-bin/printers.c:223 +#: cgi-bin/printers.c:294 #, fuzzy msgid "Printer Maintenance" msgstr "プリンタは共有されていません!" -#: cgi-bin/printers.c:292 +#: cgi-bin/printers.c:292 cgi-bin/printers.c:297 #, fuzzy msgid "Unable to send maintenance job:" msgstr "ジョブを移動できません" -#: systemv/cupsaddsmb.c:566 +#: systemv/cupsaddsmb.c:566 systemv/cupsaddsmb.c:233 #, fuzzy, c-format msgid "cupsaddsmb: No PPD file for printer \"%s\" - %s\n" msgstr "" @@ -3685,3 +3693,88 @@ msgstr "" #, c-format msgid " **FAIL** Bad cupsFilter value \"%s\"!\n" msgstr "" + +#: cgi-bin/help.c:98 cgi-bin/help.c:139 cgi-bin/help.c:149 cgi-bin/help.c:179 +msgid "Help" +msgstr "" + +#: cups/adminutil.c:233 +#, fuzzy, c-format +msgid "Missing value on line %d!\n" +msgstr "cupsaddsmb: %d 行に値がありません!\n" + +#: cups/adminutil.c:249 +#, fuzzy, c-format +msgid "Missing double quote on line %d!\n" +msgstr "cupsaddsmb: %d 行に二重引用符がありません!\n" + +#: cups/adminutil.c:266 +#, fuzzy, c-format +msgid "Bad option + choice on line %d!\n" +msgstr "cupsaddsmb: %d 行に不正なオプションと選択があります!\n" + +#: cups/adminutil.c:417 +#, fuzzy, c-format +msgid "Unable to copy Windows 2000 printer driver files (%d)!\n" +msgstr "Windows 2000 プリンタドライバファイルをコピーできません!" + +#: cups/adminutil.c:445 +#, fuzzy, c-format +msgid "Unable to copy CUPS printer driver files (%d)!\n" +msgstr "cupsaddsmb: CUPS プリンタドライバファイルをコピーできません (%d)!\n" + +#: cups/adminutil.c:480 +#, fuzzy, c-format +msgid "Unable to install Windows 2000 printer driver files (%d)!\n" +msgstr "Windows 2000 プリンタドライバファイルをインストールできません!" + +#: cups/adminutil.c:514 +#, fuzzy, c-format +msgid "Unable to copy Windows 9x printer driver files (%d)!\n" +msgstr "Windows 9x プリンタドライバファイルをコピーできません!" + +#: cups/adminutil.c:536 +#, fuzzy, c-format +msgid "Unable to install Windows 9x printer driver files (%d)!\n" +msgstr "Windows 9x プリンタドライバファイルをインストールできません!" + +#: cups/adminutil.c:547 +#, fuzzy +msgid "No Windows printer drivers are installed!\n" +msgstr "cupsaddsmb: Windows プリンタドライバがインストールされていません!\n" + +#: cups/adminutil.c:550 +#, fuzzy +msgid "Warning, no Windows 2000 printer drivers are installed!\n" +msgstr "" +"cupsaddsmb: 警告: Windows 2000 プリンタドライバがインストールされていませ" +"ん!\n" + +#: cups/adminutil.c:568 +#, fuzzy, c-format +msgid "Unable to set Windows printer driver (%d)!\n" +msgstr "Windows プリンタドライバを設定できません!" + +#: systemv/cupsaddsmb.c:278 +#, fuzzy +msgid "" +"Usage: cupsaddsmb [options] printer1 ... printerN\n" +" cupsaddsmb [options] -a\n" +"\n" +"Options:\n" +" -E Encrypt the connection to the server\n" +" -H samba-server Use the named SAMBA server\n" +" -U samba-user Authenticate using the named SAMBA user\n" +" -a Export all printers\n" +" -h cups-server Use the named CUPS server\n" +" -v Be verbose (show commands)\n" +msgstr "" +"Usage: cupsaddsmb [オプション] プリンタ1 ... プリンタN\n" +" cupsaddsmb [オプション] -a\n" +"\n" +"Options:\n" +" -H sambaサーバ 指定の SAMBA サーバを使う\n" +" -U sambaユーザ 指定の SAMBA ユーザ名で認証する\n" +" -a すべてのプリンタをエキスポートする\n" +" -h cupsサーバ 指定の CUPS サーバを使う\n" +" -v 冗長にする (コマンドを表示する)\n" diff --git a/man/Makefile b/man/Makefile index 62e551da8..7599458d8 100644 --- a/man/Makefile +++ b/man/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5182 2006-02-26 04:10:27Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Man page makefile for the Common UNIX Printing System (CUPS). # @@ -127,6 +127,31 @@ install: all $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) +# +# Uninstall files... +# + +uninstall: + for file in $(MAN1); do \ + $(RM) $(MANDIR)/man1/$$file; \ + done + -$(RMDIR) $(MANDIR)/man1 + for file in $(MAN5); do \ + $(RM) $(MANDIR)/man5/$$file; \ + done + -$(RMDIR) $(MANDIR)/man5 + for file in $(MAN7); do \ + $(RM) $(MANDIR)/man7/$$file; \ + done + -$(RMDIR) $(MANDIR)/man7 + for file in $(MAN8); do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file; \ + done + $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) + + # # Make html versions of man pages... # @@ -155,5 +180,5 @@ mantohtml: mantohtml.o # -# End of "$Id: Makefile 5182 2006-02-26 04:10:27Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/monitor/Makefile b/monitor/Makefile index a689220c9..e7ae20c7a 100644 --- a/monitor/Makefile +++ b/monitor/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5087 2006-02-07 03:43:29Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Port monitor makefile for the Common UNIX Printing System (CUPS). # @@ -65,6 +65,18 @@ install: all done +# +# Uninstall all targets... +# + +uninstall: + for file in $(TARGETS); do \ + $(RM) $(SERVERBIN)/monitor/$$file; \ + done + -$(RMDIR) $(SERVERBIN)/monitor + -$(RMDIR) $(SERVERBIN) + + # # bcp # @@ -91,5 +103,5 @@ include Dependencies # -# End of "$Id: Makefile 5087 2006-02-07 03:43:29Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/notifier/Makefile b/notifier/Makefile index 09fc0bc44..ecfd7a51f 100644 --- a/notifier/Makefile +++ b/notifier/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Notifier makefile for the Common UNIX Printing System (CUPS). # @@ -55,6 +55,18 @@ install: all done +# +# Uninstall all targets... +# + +uninstall: + for file in $(TARGETS); do \ + $(RM) $(SERVERBIN)/notifier/$$file; \ + done + -$(RMDIR) $(SERVERBIN)/notifier + -$(RMDIR) $(SERVERBIN) + + # # Update dependencies (without system header dependencies...) # @@ -87,5 +99,5 @@ include Dependencies # -# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/notifier/mailto.c b/notifier/mailto.c index e90a9eeca..afa1a30d0 100644 --- a/notifier/mailto.c +++ b/notifier/mailto.c @@ -1,5 +1,5 @@ /* - * "$Id: mailto.c 4961 2006-01-20 22:19:13Z mike $" + * "$Id: mailto.c 5235 2006-03-06 13:02:23Z mike $" * * "mailto" notifier for the Common UNIX Printing System (CUPS). * @@ -274,7 +274,8 @@ email_message(const char *to, /* I - Recipient of message */ fprintf(stderr, "DEBUG: Connected to \"%s\"...\n", mailtoSMTPServer); - cupsFilePrintf(fp, "HELO %s\r\n", httpGetHostname(hostbuf, sizeof(hostbuf))); + cupsFilePrintf(fp, "HELO %s\r\n", + httpGetHostname(NULL, hostbuf, sizeof(hostbuf))); fprintf(stderr, "DEBUG: >>> HELO %s\n", hostbuf); if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) @@ -413,7 +414,7 @@ load_configuration(void) strlcpy(mailtoFrom, server_admin, sizeof(mailtoFrom)); else snprintf(mailtoFrom, sizeof(mailtoFrom), "root@%s", - httpGetHostname(line, sizeof(line))); + httpGetHostname(NULL, line, sizeof(line))); strlcpy(mailtoSendmail, "/usr/sbin/sendmail", sizeof(mailtoSendmail)); @@ -794,5 +795,5 @@ print_attributes(ipp_t *ipp, /* I - IPP request */ /* - * End of "$Id: mailto.c 4961 2006-01-20 22:19:13Z mike $". + * End of "$Id: mailto.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/packaging/LICENSE.rtf b/packaging/LICENSE.rtf index c8d9fd248..5f38337e2 100644 --- a/packaging/LICENSE.rtf +++ b/packaging/LICENSE.rtf @@ -92,8 +92,8 @@ The GNU LGPL relaxes the "link-to" restriction, allowing you to develop applicat The Common UNIX Printing System provides a "pdftops" filter that is based on the Xpdf software. For binary distribution licensing of this software, please contact:\ \pard\pardeftab720\ql\qnatural \cf0 Derek B. Noonburg\ -Email: {\field{\*\fldinst{HYPERLINK "mailto:derekn@foolabs.com"}}{\fldrslt \cf2 \ul \ulc2 derekn@foolabs.com}}\ -WWW: {\field{\*\fldinst{HYPERLINK "http://www.foolabs.com/xpdf/"}}{\fldrslt \cf2 \ul \ulc2 http://www.foolabs.com/xpdf/}}\ +Email: {\field{\*\fldinst{HYPERLINK "mailto:derekn@glyphandcog.com"}}{\fldrslt \cf2 \ul \ulc2 derekn@foolabs.com}}\ +WWW: {\field{\*\fldinst{HYPERLINK "http://www.glyphandcog.com/"}}{\fldrslt \cf2 \ul \ulc2 http://www.glyphandcog.com/}}\ \pard\pardeftab720\sa280\ql\qnatural \f0\b\fs28 \cf0 Support\ diff --git a/packaging/installer.tif b/packaging/installer.tif index f88d7282daace8820f4ff4321cea3e28e0e55bf2..158840a157a9f53da8165d7ea81101f7aa3681db 100644 GIT binary patch literal 6076 zc-l>vc{o)4`^RURP!w6RGg`D~w8$2tv^*$#_ASCAWf{APA)+FqjfjzCeeAL?BTJJo zBioFcOl27i2D33^=KS>h`d-)bIoEwYuXDfO=e|GZk8^#_bxcf-fe^AFP-M>1cm2Tq zr(}|D-rgF~0>FZV$ZD-41UI`jitXNX9L zZ0=`UZPV?9;x{axxhlyg#Vh{+)u0X1AxudgqbsJ_I;edbhKQ@gc%c?B$fD`6#Zsi? zM|As-^F|gHHBemB=XR|ro+2v{8qWKFl=3IA+Kcl#T2tz9EKn&hp=eyFJ6-G{Es?UeB~)_NGJ9zFb^n zgv|E0;e}nKNfdegh(O+cwdIk>^WSDpc)(RT3Hb!Vl;8I(2>U0i4UMVZWr4*$(1P_( z4OmoRC1CBK5F_15pV&$1TA0M|3kA2e_WW6>S-Xa&$n@%2M%{Q=2~lJ=jvkr4G0&k{ zS4t0nDOU8QZELNN+CIxL7;JOagG0am{wTX7Nm_t|eg7qMH;NiEDJn9}ESB7_$ zJ*YQER;f;kJu(Z5j`RNP8{5+XzukTi`8US1L)<|dJ9=Bxpz}oE8Mr3}UZ~s|%Y8Rq z+}jjR%lq0agCqYBNYVR zdQ0L&@DlQbfPXRPAdq)tOs|lCCFV;xU&!kOC+ayhU&;4b`FdW;^FjxVvst}@sW*WY zD_-&<#cL<8-gGmNtnIiO*zu5xM%grdG;#5_?tgOCy05#Yhwr2=7)&B&sQ@AF+GCJw z6@`cx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z5J$g9N>mxQANaP*jPqq}AiSs2uS~l^Y%V8yl`z15Mun+gR;51IO&LK(dcb z(5InxlRwPh_di%)S1Cg@d6QC2L_-r=E|DGNdDRp^1xAX#!Us1h+wx3IO){|eOWUVU zw_HuZ<=9rHMhBEd-zy+SYFxHQZ}|Q(__f8SK*=)Ihci+QJw8?B!zUR{GFP zcejCtzu+_p@dZDrNYL@{Pi-4;91lrq*Bi>($-A#3@o*tDy!K)p=@H|+3zbTZ2BS5x z{uqn#p$|j(CKQyG0O->dC0B~w=8&l=t@Q3eZCvkG8{=i^hMz!4LV=2gAj9CrE&3=BcPp?oQw~Wk(4@@x!M7{Mfibg~qo)JleH3hn0 zBlxgQEV~;N3QNY=Ui#c8M3w|INc)e(rzNNo)aZMK$LLEUM1mHX*53kaW&?1pUSOKkW;k?gK0M?DB(;x>zx?WEe@(rCFnvF-#Gn ztYW%VJ4qj5M~>~9(yZU@m&5y5s(YlOUAZ$%{m(A!R6h_mhYK8SVMP*1llIX-md?vC zR=)9V3BW19K7bv-0{B;0*#7eLANmzSHLVt}Xnp9}y%0~-Jk&UJXVX8?f8L;iXM0C;iOcVPQ#V*JnWZ~K4t2O56> diff --git a/packaging/installer.xcf.gz b/packaging/installer.xcf.gz index 632fd19f11e3853c0ba0a9fb97688bb0c58b9f7e..25650c2ea33ae9dc0848025213332e5c402d1058 100644 GIT binary patch literal 7026 zc-jGS8;#^2iwFP!000001MOXFh#kpwuI|3?$J}{oo_bu3Mw-#Qq*3cJdaT!M5U0KJiz3au}z0Sh_m2;e}rI& z<2V=_dv`VWR?c_MslI*h+}YJSn{4duJJeL2bE>Pms!mm%sybEY#`e?CG@rW`HKXmD zTgDhq9sfoE02(7#dh8F3fur9zxg5DXxd{y;-U0IF$sfK!$*yicy?JA6^~Rm;>qh8a zY4Ps8=WlK`w{P9sx^s8y+P&@Dx9*;-EJio3-M)GIPIHmH)jKz?ZZ=P^o#x+wz`6!b z(xX=gJi6W=ac=;RK6m$-&1>7YZZy|j%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5j%#xRn3^6}`Ul diff --git a/pdftops/Makefile b/pdftops/Makefile index 9be45f5af..139190a85 100644 --- a/pdftops/Makefile +++ b/pdftops/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # pdftops filter Makefile for the Common UNIX Printing System (CUPS). # @@ -126,6 +126,16 @@ install: all $(INSTALL_BIN) pdftops $(SERVERBIN)/filter +# +# Uninstall the filter... +# + +uninstall: + $(RM) $(SERVERBIN)/filter/pdftops + -$(RMDIR) $(SERVERBIN)/filter + -$(RMDIR) $(SERVERBIN) + + # # pdftops # @@ -154,5 +164,5 @@ include Dependencies # -# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/ppd/Makefile b/ppd/Makefile index 4554e3843..0307dc54b 100644 --- a/ppd/Makefile +++ b/ppd/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # PPD file makefile for the Common UNIX Printing System (CUPS). # @@ -48,6 +48,13 @@ all: clean: +# +# Dummy depend... +# + +depend: + + # # Install files... # @@ -60,5 +67,17 @@ install: all # -# End of "$Id: Makefile 5065 2006-02-03 16:55:30Z mike $". +# Uninstall files... +# + +uninstall: + for file in $(FILES); do \ + $(RM) $(DATADIR)/model/$$file; \ + done + -$(RMDIR) $(DATADIR)/model + -$(RMDIR) $(DATADIR) + + +# +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/scheduler/Makefile b/scheduler/Makefile index de9cecfbb..403997bb9 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5157 2006-02-23 20:58:57Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Scheduler Makefile for the Common UNIX Printing System (CUPS). # @@ -148,6 +148,31 @@ install: all # -chgrp $(CUPS_GROUP) $(CACHEDIR)/ppd +# +# Uninstall the scheduler... +# + +uninstall: all + $(RM) $(SBINDIR)/cupsd + $(RM) $(SERVERBIN)/daemon/cups-deviced + $(RM) $(SERVERBIN)/daemon/cups-driverd + $(RM) $(SERVERBIN)/daemon/cups-lpd + $(RM) $(SERVERBIN)/daemon/cups-polld + -$(RMDIR) $(STATEDIR)/certs + -$(RMDIR) $(STATEDIR) + -$(RMDIR) $(SERVERROOT)/ppd + -$(RMDIR) $(SERVERROOT)/interfaces + -$(RMDIR) $(SERVERROOT) + -$(RMDIR) $(SERVERBIN)/driver + -$(RMDIR) $(SERVERBIN)/daemon + -$(RMDIR) $(SERVERBIN) + -$(RMDIR) $(SBINDIR) + -$(RMDIR) $(REQUESTS)/tmp + -$(RMDIR) $(REQUESTS) + -$(RMDIR) $(LOGDIR) + -$(RMDIR) $(CACHEDIR) + + # # Make the scheduler executable, "cupsd". # @@ -249,5 +274,5 @@ include Dependencies # -# End of "$Id: Makefile 5157 2006-02-23 20:58:57Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/scheduler/auth.c b/scheduler/auth.c index 7843fe15b..83aa9c113 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1,5 +1,5 @@ /* - * "$Id: auth.c 5222 2006-03-03 18:57:56Z mike $" + * "$Id: auth.c 5232 2006-03-05 17:59:19Z mike $" * * Authorization routines for the Common UNIX Printing System (CUPS). * @@ -1962,45 +1962,45 @@ cups_crypt(const char *pw, /* I - Password string */ pwlen = strlen(pw); - _cups_md5_init(&state); - _cups_md5_append(&state, (unsigned char *)pw, pwlen); - _cups_md5_append(&state, (unsigned char *)salt, salt_end - salt); + _cupsMD5Init(&state); + _cupsMD5Append(&state, (unsigned char *)pw, pwlen); + _cupsMD5Append(&state, (unsigned char *)salt, salt_end - salt); - _cups_md5_init(&state2); - _cups_md5_append(&state2, (unsigned char *)pw, pwlen); - _cups_md5_append(&state2, (unsigned char *)salt + 3, salt_end - salt - 3); - _cups_md5_append(&state2, (unsigned char *)pw, pwlen); - _cups_md5_finish(&state2, digest); + _cupsMD5Init(&state2); + _cupsMD5Append(&state2, (unsigned char *)pw, pwlen); + _cupsMD5Append(&state2, (unsigned char *)salt + 3, salt_end - salt - 3); + _cupsMD5Append(&state2, (unsigned char *)pw, pwlen); + _cupsMD5Finish(&state2, digest); for (i = pwlen; i > 0; i -= 16) - _cups_md5_append(&state, digest, i > 16 ? 16 : i); + _cupsMD5Append(&state, digest, i > 16 ? 16 : i); for (i = pwlen; i > 0; i >>= 1) - _cups_md5_append(&state, (unsigned char *)((i & 1) ? "" : pw), 1); + _cupsMD5Append(&state, (unsigned char *)((i & 1) ? "" : pw), 1); - _cups_md5_finish(&state, digest); + _cupsMD5Finish(&state, digest); for (i = 0; i < 1000; i ++) { - _cups_md5_init(&state); + _cupsMD5Init(&state); if (i & 1) - _cups_md5_append(&state, (unsigned char *)pw, pwlen); + _cupsMD5Append(&state, (unsigned char *)pw, pwlen); else - _cups_md5_append(&state, digest, 16); + _cupsMD5Append(&state, digest, 16); if (i % 3) - _cups_md5_append(&state, (unsigned char *)salt + 3, salt_end - salt - 3); + _cupsMD5Append(&state, (unsigned char *)salt + 3, salt_end - salt - 3); if (i % 7) - _cups_md5_append(&state, (unsigned char *)pw, pwlen); + _cupsMD5Append(&state, (unsigned char *)pw, pwlen); if (i & 1) - _cups_md5_append(&state, digest, 16); + _cupsMD5Append(&state, digest, 16); else - _cups_md5_append(&state, (unsigned char *)pw, pwlen); + _cupsMD5Append(&state, (unsigned char *)pw, pwlen); - _cups_md5_finish(&state, digest); + _cupsMD5Finish(&state, digest); } /* @@ -2156,5 +2156,5 @@ to64(char *s, /* O - Output string */ /* - * End of "$Id: auth.c 5222 2006-03-03 18:57:56Z mike $". + * End of "$Id: auth.c 5232 2006-03-05 17:59:19Z mike $". */ diff --git a/scheduler/conf.c b/scheduler/conf.c index ccb02579c..7965c70dc 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1,5 +1,5 @@ /* - * "$Id: conf.c 5222 2006-03-03 18:57:56Z mike $" + * "$Id: conf.c 5235 2006-03-06 13:02:23Z mike $" * * Configuration routines for the Common UNIX Printing System (CUPS). * @@ -271,7 +271,7 @@ cupsdReadConfiguration(void) * String options... */ - cupsdSetString(&ServerName, httpGetHostname(temp, sizeof(temp))); + cupsdSetString(&ServerName, httpGetHostname(NULL, temp, sizeof(temp))); cupsdSetStringf(&ServerAdmin, "root@%s", temp); cupsdSetString(&ServerBin, CUPS_SERVERBIN); cupsdSetString(&RequestRoot, CUPS_REQUESTS); @@ -930,7 +930,7 @@ cupsdReadConfiguration(void) if (NumMimeTypes) { for (i = 0; i < NumMimeTypes; i ++) - _cups_sp_free(MimeTypes[i]); + _cupsStrFree(MimeTypes[i]); free(MimeTypes); } @@ -972,11 +972,11 @@ cupsdReadConfiguration(void) { snprintf(mimetype, sizeof(mimetype), "%s/%s", type->super, type->type); - MimeTypes[i] = _cups_sp_alloc(mimetype); + MimeTypes[i] = _cupsStrAlloc(mimetype); } if (i < NumMimeTypes) - MimeTypes[i] = _cups_sp_alloc("application/octet-stream"); + MimeTypes[i] = _cupsStrAlloc("application/octet-stream"); if (LogLevel == CUPSD_LOG_DEBUG2) { @@ -3237,5 +3237,5 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ /* - * End of "$Id: conf.c 5222 2006-03-03 18:57:56Z mike $". + * End of "$Id: conf.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 3c50525df..db9e06529 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 5164 2006-02-24 20:40:00Z mike $" + * "$Id: ipp.c 5232 2006-03-05 17:59:19Z mike $" * * IPP routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -426,8 +426,8 @@ cupsdProcessIPPRequest( * Remote unauthenticated user masquerading as local root... */ - _cups_sp_free(username->values[0].string.text); - username->values[0].string.text = _cups_sp_alloc(RemoteRoot); + _cupsStrFree(username->values[0].string.text); + username->values[0].string.text = _cupsStrAlloc(RemoteRoot); } } @@ -1342,8 +1342,8 @@ add_job(cupsd_client_t *con, /* I - Client connection */ else { attr->group_tag = IPP_TAG_JOB; - _cups_sp_free(attr->name); - attr->name = _cups_sp_alloc("job-originating-user-name"); + _cupsStrFree(attr->name); + attr->name = _cupsStrAlloc("job-originating-user-name"); } if ((attr = ippFindAttribute(job->attrs, "job-originating-host-name", @@ -1381,11 +1381,11 @@ add_job(cupsd_client_t *con, /* I - Client connection */ for (i = 0; i < attr->num_values; i ++) { - _cups_sp_free(attr->values[i].string.text); + _cupsStrFree(attr->values[i].string.text); attr->values[i].string.text = NULL; if (attr->values[i].string.charset) { - _cups_sp_free(attr->values[i].string.charset); + _cupsStrFree(attr->values[i].string.charset); attr->values[i].string.charset = NULL; } } @@ -1400,7 +1400,7 @@ add_job(cupsd_client_t *con, /* I - Client connection */ attr->value_tag = IPP_TAG_NAME; attr->num_values = 1; - attr->values[0].string.text = _cups_sp_alloc(con->http.hostname); + attr->values[0].string.text = _cupsStrAlloc(con->http.hostname); } attr->group_tag = IPP_TAG_JOB; @@ -1496,8 +1496,8 @@ add_job(cupsd_client_t *con, /* I - Client connection */ attr = ippAddStrings(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-sheets", 2, NULL, NULL); - attr->values[0].string.text = _cups_sp_alloc(printer->job_sheets[0]); - attr->values[1].string.text = _cups_sp_alloc(printer->job_sheets[1]); + attr->values[0].string.text = _cupsStrAlloc(printer->job_sheets[0]); + attr->values[1].string.text = _cupsStrAlloc(printer->job_sheets[1]); } job->job_sheets = attr; @@ -1899,7 +1899,7 @@ add_job_subscriptions( * Free and remove this attribute... */ - _ipp_free_attr(attr); + _ippFreeAttr(attr); if (prev) prev->next = next; @@ -1948,9 +1948,9 @@ add_job_uuid(cupsd_client_t *con, /* I - Client connection */ snprintf(uuid, sizeof(uuid), "%s:%s:%d:%d", ServerName, con->servername, con->serverport, job->id); - _cups_md5_init(&md5state); - _cups_md5_append(&md5state, (unsigned char *)uuid, strlen(uuid)); - _cups_md5_finish(&md5state, md5sum); + _cupsMD5Init(&md5state); + _cupsMD5Append(&md5state, (unsigned char *)uuid, strlen(uuid)); + _cupsMD5Finish(&md5state, md5sum); /* * Format the UUID URI using the MD5 sum and job ID. @@ -3283,7 +3283,7 @@ copy_attribute( else { for (i = 0; i < attr->num_values; i ++) - toattr->values[i].string.text = _cups_sp_alloc(attr->values[i].string.text); + toattr->values[i].string.text = _cupsStrAlloc(attr->values[i].string.text); } break; @@ -3336,12 +3336,12 @@ copy_attribute( { if (!i) toattr->values[i].string.charset = - _cups_sp_alloc(attr->values[i].string.charset); + _cupsStrAlloc(attr->values[i].string.charset); else toattr->values[i].string.charset = toattr->values[0].string.charset; - toattr->values[i].string.text = _cups_sp_alloc(attr->values[i].string.text); + toattr->values[i].string.text = _cupsStrAlloc(attr->values[i].string.text); } } break; @@ -6251,18 +6251,18 @@ hold_job(cupsd_client_t *con, /* I - Client connection */ * Free the old hold value and copy the new one over... */ - _cups_sp_free(attr->values[0].string.text); + _cupsStrFree(attr->values[0].string.text); if (newattr) { attr->value_tag = newattr->value_tag; attr->values[0].string.text = - _cups_sp_alloc(newattr->values[0].string.text); + _cupsStrAlloc(newattr->values[0].string.text); } else { attr->value_tag = IPP_TAG_KEYWORD; - attr->values[0].string.text = _cups_sp_alloc("indefinite"); + attr->values[0].string.text = _cupsStrAlloc("indefinite"); } /* @@ -6779,9 +6779,9 @@ print_job(cupsd_client_t *con, /* I - Client connection */ if (format) { - _cups_sp_free(format->values[0].string.text); + _cupsStrFree(format->values[0].string.text); - format->values[0].string.text = _cups_sp_alloc(mimetype); + format->values[0].string.text = _cupsStrAlloc(mimetype); } else ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, @@ -7056,7 +7056,7 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ if (con->request->last == attr2) con->request->last = prev2; - _ipp_free_attr(attr2); + _ippFreeAttr(attr2); } /* @@ -7279,10 +7279,10 @@ release_job(cupsd_client_t *con, /* I - Client connection */ if (attr) { - _cups_sp_free(attr->values[0].string.text); + _cupsStrFree(attr->values[0].string.text); attr->value_tag = IPP_TAG_KEYWORD; - attr->values[0].string.text = _cups_sp_alloc("no-hold"); + attr->values[0].string.text = _cupsStrAlloc("no-hold"); } /* @@ -7803,8 +7803,8 @@ send_document(cupsd_client_t *con, /* I - Client connection */ if (format) { - _cups_sp_free(format->values[0].string.text); - format->values[0].string.text = _cups_sp_alloc(mimetype); + _cupsStrFree(format->values[0].string.text); + format->values[0].string.text = _cupsStrAlloc(mimetype); } else ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, @@ -8385,7 +8385,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ if (job->attrs->last == attr2) job->attrs->last = job->attrs->prev; - _ipp_free_attr(attr2); + _ippFreeAttr(attr2); /* * Then copy the attribute... @@ -8424,7 +8424,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ if (attr2 == job->attrs->last) job->attrs->last = job->attrs->prev; - _ipp_free_attr(attr2); + _ippFreeAttr(attr2); } } else @@ -9094,5 +9094,5 @@ validate_user(cupsd_job_t *job, /* I - Job */ /* - * End of "$Id: ipp.c 5164 2006-02-24 20:40:00Z mike $". + * End of "$Id: ipp.c 5232 2006-03-05 17:59:19Z mike $". */ diff --git a/scheduler/main.c b/scheduler/main.c index b0b581cde..b325a4139 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -1,5 +1,5 @@ /* - * "$Id: main.c 5216 2006-03-02 17:47:53Z mike $" + * "$Id: main.c 5231 2006-03-05 17:22:27Z mike $" * * Scheduler main loop for the Common UNIX Printing System (CUPS). * @@ -980,7 +980,7 @@ main(int argc, /* I - Number of command-line args */ mem.fsmblks + mem.fordblks); #endif /* HAVE_MALLINFO */ - string_count = _cups_sp_statistics(&alloc_bytes, &total_bytes); + string_count = _cupsStrStatistics(&alloc_bytes, &total_bytes); cupsdLogMessage(CUPSD_LOG_DEBUG2, "stringpool: " CUPS_LLFMT " strings, " CUPS_LLFMT " allocated, " CUPS_LLFMT " total bytes", @@ -2313,5 +2313,5 @@ usage(int status) /* O - Exit status */ /* - * End of "$Id: main.c 5216 2006-03-02 17:47:53Z mike $". + * End of "$Id: main.c 5231 2006-03-05 17:22:27Z mike $". */ diff --git a/scheduler/printers.c b/scheduler/printers.c index 96ccbcaa8..8efd1396a 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1,5 +1,5 @@ /* - * "$Id: printers.c 5178 2006-02-26 00:24:23Z mike $" + * "$Id: printers.c 5231 2006-03-05 17:22:27Z mike $" * * Printer routines for the Common UNIX Printing System (CUPS). * @@ -454,12 +454,12 @@ cupsdCreateCommonData(void) cupsd_banner_t *banner; /* Current banner */ - attr->values[0].string.text = _cups_sp_alloc("none"); + attr->values[0].string.text = _cupsStrAlloc("none"); for (i = 1, banner = (cupsd_banner_t *)cupsArrayFirst(Banners); banner; i ++, banner = (cupsd_banner_t *)cupsArrayNext(Banners)) - attr->values[i].string.text = _cups_sp_alloc(banner->name); + attr->values[i].string.text = _cupsStrAlloc(banner->name); } } else @@ -552,7 +552,7 @@ cupsdCreateCommonData(void) attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-op-policy-supported", NumPolicies, NULL, NULL); for (i = 0; i < NumPolicies; i ++) - attr->values[i].string.text = _cups_sp_alloc(Policies[i]->name); + attr->values[i].string.text = _cupsStrAlloc(Policies[i]->name); } @@ -1568,9 +1568,9 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ if (attr != NULL) { - attr->values[0].string.text = _cups_sp_alloc(Classification ? + attr->values[0].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[0]); - attr->values[1].string.text = _cups_sp_alloc(Classification ? + attr->values[1].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[1]); } } @@ -1638,7 +1638,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ for (i = 0; i < p->num_printers; i ++) { if (attr != NULL) - attr->values[i].string.text = _cups_sp_alloc(p->printers[i]->uri); + attr->values[i].string.text = _cupsStrAlloc(p->printers[i]->uri); p->type &= ~CUPS_PRINTER_OPTIONS | p->printers[i]->type; } @@ -1649,7 +1649,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ if (attr != NULL) { for (i = 0; i < p->num_printers; i ++) - attr->values[i].string.text = _cups_sp_alloc(p->printers[i]->name); + attr->values[i].string.text = _cupsStrAlloc(p->printers[i]->name); } } } @@ -1767,20 +1767,20 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ if (input_slot != NULL) for (i = 0; i < input_slot->num_choices; i ++, val ++) - val->string.text = _cups_sp_alloc(input_slot->choices[i].choice); + val->string.text = _cupsStrAlloc(input_slot->choices[i].choice); if (media_type != NULL) for (i = 0; i < media_type->num_choices; i ++, val ++) - val->string.text = _cups_sp_alloc(media_type->choices[i].choice); + val->string.text = _cupsStrAlloc(media_type->choices[i].choice); if (media_quality != NULL) for (i = 0; i < media_quality->num_choices; i ++, val ++) - val->string.text = _cups_sp_alloc(media_quality->choices[i].choice); + val->string.text = _cupsStrAlloc(media_quality->choices[i].choice); if (page_size != NULL) { for (i = 0; i < page_size->num_choices; i ++, val ++) - val->string.text = _cups_sp_alloc(page_size->choices[i].choice); + val->string.text = _cupsStrAlloc(page_size->choices[i].choice); ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-default", NULL, page_size->defchoice); @@ -1815,7 +1815,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ for (i = 0, val = attr->values; i < output_bin->num_choices; i ++, val ++) - val->string.text = _cups_sp_alloc(output_bin->choices[i].choice); + val->string.text = _cupsStrAlloc(output_bin->choices[i].choice); } } @@ -1920,19 +1920,19 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ attr = ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "port-monitor-supported", i, NULL, NULL); - attr->values[0].string.text = _cups_sp_alloc("none"); + attr->values[0].string.text = _cupsStrAlloc("none"); for (i = 1, ppdattr = ppdFindAttr(ppd, "cupsPortMonitor", NULL); ppdattr; i ++, ppdattr = ppdFindNextAttr(ppd, "cupsPortMonitor", NULL)) - attr->values[i].string.text = _cups_sp_alloc(ppdattr->value); + attr->values[i].string.text = _cupsStrAlloc(ppdattr->value); if (ppd->protocols) { if (strstr(ppd->protocols, "TBCP")) - attr->values[i].string.text = _cups_sp_alloc("tbcp"); + attr->values[i].string.text = _cupsStrAlloc("tbcp"); else if (strstr(ppd->protocols, "BCP")) - attr->values[i].string.text = _cups_sp_alloc("bcp"); + attr->values[i].string.text = _cupsStrAlloc("bcp"); } /* @@ -2949,7 +2949,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_printer_formats: %d types, %d filters", mimeNumTypes(MimeDatabase), mimeNumFilters(MimeDatabase)); - types[0] = _cups_sp_alloc("application/octet-stream"); + types[0] = _cupsStrAlloc("application/octet-stream"); for (num_types = 1, type = mimeFirstType(MimeDatabase); type; @@ -2968,7 +2968,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ p->name, mimetype, cupsArrayCount(filters)); cupsArrayDelete(filters); - types[num_types] = _cups_sp_alloc(mimetype); + types[num_types] = _cupsStrAlloc(mimetype); num_types ++; } else @@ -2993,7 +2993,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ */ for (i = 0; i < num_types; i ++) - _cups_sp_free(types[i]); + _cupsStrFree(types[i]); free(types); } @@ -3351,5 +3351,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */ /* - * End of "$Id: printers.c 5178 2006-02-26 00:24:23Z mike $". + * End of "$Id: printers.c 5231 2006-03-05 17:22:27Z mike $". */ diff --git a/scheduler/sysman.c b/scheduler/sysman.c index e32b13dcb..a0edfbd31 100644 --- a/scheduler/sysman.c +++ b/scheduler/sysman.c @@ -1,5 +1,5 @@ /* - * "$Id: sysman.c 5095 2006-02-09 16:22:48Z mike $" + * "$Id: sysman.c 5241 2006-03-07 22:07:44Z mike $" * * System management definitions for the Common UNIX Printing System (CUPS). * @@ -264,6 +264,7 @@ cupsdStopSystemMonitor(void) void cupsdUpdateSystemMonitor(void) { + int i; /* Looping var */ cupsd_sysevent_t sysevent; /* The system event */ cupsd_printer_t *p; /* Printer information */ @@ -278,14 +279,25 @@ cupsdUpdateSystemMonitor(void) if (sysevent.event & SYSEVENT_CANSLEEP) { /* - * If there are any active printers cancel the sleep request... + * If there are active printers that don't have the connecting-to-device + * printer-state-reason then cancel the sleep request (i.e. this reason + * indicates a job that is not yet connected to the printer)... */ for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); p; p = (cupsd_printer_t *)cupsArrayNext(Printers)) + { if (p->job) - break; + { + for (i = 0; i < p->num_reasons; i ++) + if (!strcmp(p->reasons[i], "connecting-to-device")) + break; + + if (!p->num_reasons || i >= p->num_reasons) + break; + } + } if (p) { @@ -747,5 +759,5 @@ sysEventTimerNotifier( /* - * End of "$Id: sysman.c 5095 2006-02-09 16:22:48Z mike $". + * End of "$Id: sysman.c 5241 2006-03-07 22:07:44Z mike $". */ diff --git a/scripting/php/Dependencies b/scripting/php/Dependencies index f674ca767..d17772edc 100644 --- a/scripting/php/Dependencies +++ b/scripting/php/Dependencies @@ -1,6 +1,6 @@ # DO NOT DELETE -phpcups.o: phpcups.h ../../cups/cups.h ../../cups/ipp.h ../../cups/http.h -phpcups.o: ../../cups/md5.h ../../cups/ppd.h ../../cups/array.h -phpcups.o: ../../cups/file.h ../../cups/language.h ../../cups/language.h -phpcups.o: ../../cups/string.h ../../config.h ../../cups/debug.h +phpcups.o: ../../cups/string.h ../../config.h phpcups.h ../../cups/cups.h +phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/md5.h +phpcups.o: ../../cups/ppd.h ../../cups/array.h ../../cups/file.h +phpcups.o: ../../cups/language.h ../../cups/language.h ../../cups/debug.h diff --git a/scripting/php/Makefile b/scripting/php/Makefile index 398c2714e..acf6f2d27 100644 --- a/scripting/php/Makefile +++ b/scripting/php/Makefile @@ -45,14 +45,14 @@ OBJS = phpcups.o # Targets in this directory... # -TARGETS = phpcups.so +PHPCUPS = phpcups.so # # Make all targets... # -all: $(TARGETS) +all: $(PHPCUPS) # @@ -60,7 +60,7 @@ all: $(TARGETS) # clean: - $(RM) $(OBJS) $(TARGETS) + $(RM) $(OBJS) $(PHPCUPS) # @@ -76,9 +76,18 @@ depend: # install: all - echo Installing $(TARGETS) in $(PHPDIR) + echo Installing $(PHPCUPS) in $(PHPDIR) $(INSTALL_DIR) $(PHPDIR) - cp $(TARGETS) $(PHPDIR) + $(INSTALL_BIN) $(PHPCUPS) $(PHPDIR) + + +# +# Uninstall object and target files... +# + +uninstall: + $(RM) $(PHPDIR)/$(PHPCUPS) + -$(RMDIR) $(PHPDIR) # diff --git a/standards/Makefile b/standards/Makefile index b9c4c76f1..c93db938b 100644 --- a/standards/Makefile +++ b/standards/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5143 2006-02-21 19:13:01Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Standards makefile for the Common UNIX Printing System (CUPS). # @@ -100,6 +100,13 @@ depend: install: all +# +# Uninstall files... +# + +uninstall: + + # # rfctohtml - make html versions of RFCs... # @@ -110,5 +117,5 @@ rfctohtml: rfctohtml.o ../cups/libcups.a # -# End of "$Id: Makefile 5143 2006-02-21 19:13:01Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/systemv/Dependencies b/systemv/Dependencies index d24772b5c..1879b63b3 100644 --- a/systemv/Dependencies +++ b/systemv/Dependencies @@ -6,10 +6,10 @@ accept.o: ../cups/file.h ../cups/language.h ../cups/i18n.h cancel.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h cancel.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h cancel.o: ../cups/file.h ../cups/language.h ../cups/i18n.h -cupsaddsmb.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h -cupsaddsmb.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h -cupsaddsmb.o: ../cups/file.h ../cups/language.h ../cups/i18n.h -cupsaddsmb.o: ../cups/debug.h +cupsaddsmb.o: ../cups/string.h ../config.h ../cups/adminutil.h ../cups/cups.h +cupsaddsmb.o: ../cups/ipp.h ../cups/http.h ../cups/md5.h ../cups/ppd.h +cupsaddsmb.o: ../cups/array.h ../cups/file.h ../cups/language.h +cupsaddsmb.o: ../cups/i18n.h ../cups/debug.h cupstestppd.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h cupstestppd.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h cupstestppd.o: ../cups/file.h ../cups/language.h ../cups/i18n.h diff --git a/systemv/Makefile b/systemv/Makefile index 9cc85ea21..268518c84 100644 --- a/systemv/Makefile +++ b/systemv/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5222 2006-03-03 18:57:56Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # System V commands makefile for the Common UNIX Printing System (CUPS). # @@ -80,6 +80,29 @@ install: all $(INSTALL_BIN) -m 4755 -o $(CUPS_USER) -g $(CUPS_GROUP) lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR) +# +# Uninstall all targets... +# + +uninstall: + $(RM) $(BINDIR)/cancel + $(RM) $(BINDIR)/cupstestppd + $(RM) $(BINDIR)/lp + $(RM) $(BINDIR)/lpoptions + $(RM) $(BINDIR)/lppasswd + $(RM) $(BINDIR)/lpstat + -$(RMDIR) $(BINDIR) + $(RM) $(SBINDIR)/accept + $(RM) $(SBINDIR)/cupsaddsmb + $(RM) $(SBINDIR)/cupsdisable + $(RM) $(SBINDIR)/cupsenable + $(RM) $(SBINDIR)/lpadmin + $(RM) $(SBINDIR)/lpinfo + $(RM) $(SBINDIR)/lpmove + $(RM) $(SBINDIR)/reject + -$(RMDIR) $(SBINDIR) + + # # accept # @@ -191,5 +214,5 @@ include Dependencies # -# End of "$Id: Makefile 5222 2006-03-03 18:57:56Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/systemv/cupsaddsmb.c b/systemv/cupsaddsmb.c index 4d0bdc15e..a69e113f1 100644 --- a/systemv/cupsaddsmb.c +++ b/systemv/cupsaddsmb.c @@ -1,5 +1,5 @@ /* - * "$Id: cupsaddsmb.c 5187 2006-02-26 20:36:03Z mike $" + * "$Id: cupsaddsmb.c 5233 2006-03-06 03:39:28Z mike $" * * "cupsaddsmb" command for the Common UNIX Printing System (CUPS). * @@ -23,14 +23,9 @@ * * Contents: * - * main() - Export printers on the command-line. - * convert_ppd() - Convert a PPD file to a form usable by any of the - * Windows PostScript printer drivers. - * do_samba_command() - Do a SAMBA command, asking for a password as needed. - * export_dest() - Export a destination to SAMBA. - * ppd_gets() - Get a CR and/or LF-terminated line. - * usage() - Show program usage and exit... - * write_option() - Write a CUPS option to a PPD file. + * main() - Export printers on the command-line. + * export_dest() - Export a destination to SAMBA. + * usage() - Show program usage and exit... */ /* @@ -40,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,16 +58,8 @@ const char *SAMBAUser, * Local functions... */ -int convert_ppd(const char *src, char *dst, int dstsize, ipp_t *info); -int do_samba_command(const char *command, const char *address, - const char *subcommand); -int export_dest(const char *dest); -char *ppd_gets(FILE *fp, char *buf, int buflen); +int export_dest(http_t *http, const char *dest); void usage(void); -int write_option(FILE *dstfp, int order, const char *name, - const char *text, const char *attrname, - ipp_attribute_t *suppattr, ipp_attribute_t *defattr, - int defval, int valcount); /* @@ -86,6 +73,7 @@ main(int argc, /* I - Number of command-line arguments */ int i, j; /* Looping vars */ int status; /* Status from export_dest() */ int export_all; /* Export all printers? */ + http_t *http; /* Connection to server */ int num_dests; /* Number of printers */ cups_dest_t *dests; /* Printers */ @@ -94,15 +82,31 @@ main(int argc, /* I - Number of command-line arguments */ * Parse command-line arguments... */ - export_all = 0; - + export_all = 0; + http = NULL; SAMBAUser = cupsUser(); SAMBAPassword = NULL; SAMBAServer = NULL; for (i = 1; i < argc; i ++) - if (!strcmp(argv[i], "-a")) - export_all = 1; + if (!strcmp(argv[i], "-E")) + { +#ifdef HAVE_SSL + cupsSetEncryption(HTTP_ENCRYPT_REQUIRED); +#else + _cupsLangPrintf(stderr, + _("%s: Sorry, no encryption support compiled in!\n"), + argv[0]); +#endif /* HAVE_SSL */ + } + else if (!strcmp(argv[i], "-H")) + { + i ++; + if (i >= argc) + usage(); + + SAMBAServer = argv[i]; + } else if (!strcmp(argv[i], "-U")) { char *sep; /* Separator for password */ @@ -126,14 +130,8 @@ main(int argc, /* I - Number of command-line arguments */ SAMBAPassword = sep; } } - else if (!strcmp(argv[i], "-H")) - { - i ++; - if (i >= argc) - usage(); - - SAMBAServer = argv[i]; - } + else if (!strcmp(argv[i], "-a")) + export_all = 1; else if (!strcmp(argv[i], "-h")) { i ++; @@ -146,15 +144,40 @@ main(int argc, /* I - Number of command-line arguments */ Verbosity = 1; else if (argv[i][0] != '-') { + if (!http) + { + /* + * Connect to the server... + */ + + if ((http = httpConnectEncrypt(cupsServer(), ippPort(), + cupsEncryption())) == NULL) + { + _cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), argv[0]); + exit(1); + } + } + if (SAMBAServer == NULL) SAMBAServer = cupsServer(); - if ((status = export_dest(argv[i])) != 0) + if ((status = export_dest(http, argv[i])) != 0) return (status); } else usage(); + /* + * Connect to the server... + */ + + if ((http = httpConnectEncrypt(cupsServer(), ippPort(), + cupsEncryption())) == NULL) + { + _cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), argv[0]); + exit(1); + } + /* * See if the user specified "-a"... */ @@ -168,12 +191,12 @@ main(int argc, /* I - Number of command-line arguments */ if (SAMBAServer == NULL) SAMBAServer = cupsServer(); - num_dests = cupsGetDests(&dests); + num_dests = cupsGetDests2(http, &dests); for (j = 0, status = 0; j < num_dests; j ++) if (!dests[j].instance) { - if ((status = export_dest(dests[j].name)) != 0) + if ((status = export_dest(http, dests[j].name)) != 0) break; } @@ -187,710 +210,60 @@ main(int argc, /* I - Number of command-line arguments */ } -/* - * 'convert_ppd()' - Convert a PPD file to a form usable by any of the - * Windows PostScript printer drivers. - */ - -int /* O - 0 on success, 1 on failure */ -convert_ppd(const char *src, /* I - Source (original) PPD */ - char *dst, /* O - Destination PPD */ - int dstsize, /* I - Size of destination buffer */ - ipp_t *info) /* I - Printer attributes */ -{ - FILE *srcfp, /* Source file */ - *dstfp; /* Destination file */ - int dstfd; /* Destination file descriptor */ - ipp_attribute_t *suppattr, /* IPP -supported attribute */ - *defattr; /* IPP -default attribute */ - char line[256], /* Line from PPD file */ - junk[256], /* Extra junk to throw away */ - *ptr, /* Pointer into line */ - option[41], /* Option */ - choice[41]; /* Choice */ - int jcloption, /* In a JCL option? */ - linenum; /* Current line number */ - time_t curtime; /* Current time */ - struct tm *curdate; /* Current date */ - - - /* - * Open the original PPD file... - */ - - if ((srcfp = fopen(src, "rb")) == NULL) - return (1); - - /* - * Create a temporary output file using the destination buffer... - */ - - if ((dstfd = cupsTempFd(dst, dstsize)) < 0) - { - fclose(srcfp); - - return (1); - } - - if ((dstfp = fdopen(dstfd, "w")) == NULL) - { - /* - * Unable to convert to FILE *... - */ - - close(dstfd); - - fclose(srcfp); - - return (1); - } - - /* - * Write a new header explaining that this isn't the original PPD... - */ - - fputs("*PPD-Adobe: \"4.3\"\n", dstfp); - - curtime = time(NULL); - curdate = gmtime(&curtime); - - fprintf(dstfp, "*%% Modified on %04d%02d%02d%02d%02d%02d+0000 by cupsaddsmb\n", - curdate->tm_year + 1900, curdate->tm_mon + 1, curdate->tm_mday, - curdate->tm_hour, curdate->tm_min, curdate->tm_sec); - - /* - * Read the existing PPD file, converting all PJL commands to CUPS - * job ticket comments... - */ - - jcloption = 0; - linenum = 0; - - while (ppd_gets(srcfp, line, sizeof(line)) != NULL) - { - linenum ++; - - if (!strncmp(line, "*PPD-Adobe:", 11)) - { - /* - * Already wrote the PPD header... - */ - - continue; - } - else if (!strncmp(line, "*JCLBegin:", 10) || - !strncmp(line, "*JCLToPSInterpreter:", 20) || - !strncmp(line, "*JCLEnd:", 8) || - !strncmp(line, "*Protocols:", 11)) - { - /* - * Don't use existing JCL keywords; we'll create our own, below... - */ - - fprintf(dstfp, "*%% Commented out by cupsaddsmb...\n*%%%s", line + 1); - continue; - } - else if (!strncmp(line, "*JCLOpenUI", 10)) - { - jcloption = 1; - fputs(line, dstfp); - } - else if (!strncmp(line, "*JCLCloseUI", 11)) - { - jcloption = 0; - fputs(line, dstfp); - } - else if (jcloption && - strncmp(line, "*End", 4) && - strncmp(line, "*Default", 8) && - strncmp(line, "*OrderDependency", 16)) - { - if ((ptr = strchr(line, ':')) == NULL) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Missing value on line %d!\n"), linenum); - fclose(srcfp); - fclose(dstfp); - close(dstfd); - unlink(dst); - return (1); - } - - if ((ptr = strchr(ptr, '\"')) == NULL) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Missing double quote on line %d!\n"), - linenum); - fclose(srcfp); - fclose(dstfp); - close(dstfd); - unlink(dst); - return (1); - } - - if (sscanf(line, "*%40s%*[ \t]%40[^/]", option, choice) != 2) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Bad option + choice on line %d!\n"), - linenum); - fclose(srcfp); - fclose(dstfp); - close(dstfd); - unlink(dst); - return (1); - } - - if (strchr(ptr + 1, '\"') == NULL) - { - /* - * Skip remaining... - */ - - while (ppd_gets(srcfp, junk, sizeof(junk)) != NULL) - { - linenum ++; - - if (!strncmp(junk, "*End", 4)) - break; - } - } - - snprintf(ptr + 1, sizeof(line) - (ptr - line + 1), - "%%cupsJobTicket: %s=%s\n\"\n*End\n", option, choice); - - fprintf(dstfp, "*%% Changed by cupsaddsmb...\n%s", line); - } - else - fputs(line, dstfp); - } - - fclose(srcfp); - - /* - * Now add the CUPS-specific attributes and options... - */ - - fputs("\n*% CUPS Job Ticket support and options...\n", dstfp); - fputs("*Protocols: PJL\n", dstfp); - fputs("*JCLBegin: \"%!PS-Adobe-3.0<0A>\"\n", dstfp); - fputs("*JCLToPSInterpreter: \"\"\n", dstfp); - fputs("*JCLEnd: \"\"\n", dstfp); - - fputs("\n*OpenGroup: CUPS/CUPS Options\n\n", dstfp); - - if ((defattr = ippFindAttribute(info, "job-hold-until-default", - IPP_TAG_ZERO)) != NULL && - (suppattr = ippFindAttribute(info, "job-hold-until-supported", - IPP_TAG_ZERO)) != NULL) - write_option(dstfp, 10, "cupsJobHoldUntil", "Hold Until", "job-hold-until", - suppattr, defattr, 0, 1); - - if ((defattr = ippFindAttribute(info, "job-priority-default", - IPP_TAG_INTEGER)) != NULL && - (suppattr = ippFindAttribute(info, "job-priority-supported", - IPP_TAG_RANGE)) != NULL) - write_option(dstfp, 11, "cupsJobPriority", "Priority", "job-priority", - suppattr, defattr, 0, 1); - - if ((defattr = ippFindAttribute(info, "job-sheets-default", - IPP_TAG_ZERO)) != NULL && - (suppattr = ippFindAttribute(info, "job-sheets-supported", - IPP_TAG_ZERO)) != NULL) - { - write_option(dstfp, 20, "cupsJobSheetsStart", "Start Banner", - "job-sheets", suppattr, defattr, 0, 2); - write_option(dstfp, 21, "cupsJobSheetsEnd", "End Banner", - "job-sheets", suppattr, defattr, 1, 2); - } - - fputs("*CloseGroup: CUPS\n", dstfp); - - fclose(dstfp); - close(dstfd); - - return (0); -} - - -/* - * 'do_samba_command()' - Do a SAMBA command, asking for - * a password as needed. - */ - -int /* O - Status of command */ -do_samba_command(const char *command, /* I - Command to run */ - const char *address, /* I - Address for command */ - const char *subcmd) /* I - Sub-command */ -{ - int status; /* Status of command */ - char temp[4096]; /* Command/prompt string */ - int pid; /* Process ID of child */ - - - DEBUG_printf(("do_samba_command(command=\"%s\", address=\"%s\", subcmd=\"%s\")\n", - command, address, subcmd)); - DEBUG_printf(("SAMBAUser=\"%s\", SAMBAPassword=\"%s\"\n", SAMBAUser, - SAMBAPassword)); - - for (status = 1; status; ) - { - if (!SAMBAPassword) - { - snprintf(temp, sizeof(temp), - _("Password for %s required to access %s via SAMBA: "), - SAMBAUser, SAMBAServer); - - if ((SAMBAPassword = cupsGetPassword(temp)) == NULL) - break; - } - - snprintf(temp, sizeof(temp), "%s%%%s", SAMBAUser, SAMBAPassword); - - if (Verbosity) - _cupsLangPrintf(stdout, - _("Running command: %s %s -N -U \'%s%%%s\' -c \'%s\'\n"), - command, address, SAMBAUser, SAMBAPassword, subcmd); - - if ((pid = fork()) == 0) - { - /* - * Child goes here, redirect stdin/out/err and execute the command... - */ - - close(0); - open("/dev/null", O_RDONLY); - - if (!Verbosity) - { - close(1); - open("/dev/null", O_WRONLY); - close(2); - dup(1); - } - - execlp(command, command, address, "-N", "-U", temp, "-c", subcmd, - (char *)0); - exit(errno); - } - else if (pid < 0) - { - status = -1; - - _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to run \"%s\": %s\n"), - command, strerror(errno)); - } - else - { - /* - * Wait for the process to complete... - */ - - while (wait(&status) != pid); - } - - DEBUG_printf(("status=%d\n", status)); - - if (Verbosity) - _cupsLangPuts(stdout, "\n"); - - if (status) - { - if (SAMBAPassword[0]) - SAMBAPassword = NULL; - else - break; - } - } - - return (status); -} - - /* * 'export_dest()' - Export a destination to SAMBA. */ int /* O - 0 on success, non-zero on error */ -export_dest(const char *dest) /* I - Destination to export */ +export_dest(http_t *http, /* I - Connection to server */ + const char *dest) /* I - Destination to export */ { - int status; /* Status of smbclient/rpcclient commands */ - int have_drivers; /* Have drivers? */ - const char *ppdfile; /* PPD file for printer drivers */ - char newppd[1024], /* New PPD file for printer drivers */ - file[1024], /* File to test for */ - address[1024], /* Address for command */ - uri[1024], /* Printer URI */ - subcmd[1024]; /* Sub-command */ - const char *datadir; /* CUPS_DATADIR */ - http_t *http; /* Connection to server */ - ipp_t *request, /* IPP request */ - *response; /* IPP response */ - static const char *pattrs[] = /* Printer attributes we want */ - { - "job-hold-until-supported", - "job-hold-until-default", - "job-sheets-supported", - "job-sheets-default", - "job-priority-supported", - "job-priority-default" - }; + int status; /* Status of export */ + char ppdfile[1024], /* PPD file for printer drivers */ + prompt[1024]; /* Password prompt */ /* - * Get the location of the printer driver files... + * Get the Windows PPD file for the printer... */ - if ((datadir = getenv("CUPS_DATADIR")) == NULL) - datadir = CUPS_DATADIR; - - /* - * Open a connection to the scheduler... - */ - - if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to connect to server \"%s\" for " - "%s - %s\n"), - cupsServer(), dest, strerror(errno)); - return (1); - } - - /* - * Get the PPD file... - */ - - if ((ppdfile = cupsGetPPD2(http, dest)) == NULL) + if (!cupsAdminCreateWindowsPPD(http, dest, ppdfile, sizeof(ppdfile))) { _cupsLangPrintf(stderr, _("cupsaddsmb: No PPD file for printer \"%s\" - " "%s\n"), dest, cupsLastErrorString()); - httpClose(http); - return (0); - } - - /* - * Append the supported banner pages to the PPD file... - */ - - request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", dest); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, - "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), - NULL, pattrs); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "cupsaddsmb: %s - %s\n", dest, - cupsLastErrorString()); - ippDelete(response); - httpClose(http); - unlink(ppdfile); - return (2); - } - } - else - { - _cupsLangPrintf(stderr, "cupsaddsmb: %s - %s\n", dest, - cupsLastErrorString()); - httpClose(http); - unlink(ppdfile); - return (2); + return (1); } /* - * Convert the PPD file to the Windows driver format... + * Try to export it... */ - if (convert_ppd(ppdfile, newppd, sizeof(newppd), response)) + for (status = 0; !status;) { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to convert PPD file for %s - %s\n"), - dest, strerror(errno)); - ippDelete(response); - httpClose(http); - unlink(ppdfile); - return (3); - } - - ippDelete(response); - httpClose(http); - - /* - * Remove the old PPD and point to the new one... - */ - - unlink(ppdfile); - - ppdfile = newppd; - - /* - * See which drivers are available; the new CUPS v6 and Adobe drivers - * depend on the Windows 2k PS driver, so copy that driver first: - * - * Files: - * - * ps5ui.dll - * pscript.hlp - * pscript.ntf - * pscript5.dll - */ - - have_drivers = 0; - - snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", datadir); - if (!access(file, 0)) - { - have_drivers |= 1; - - /* - * Windows 2k driver is installed; do the smbclient commands needed - * to copy the Win2k drivers over... - */ - - snprintf(address, sizeof(address), "//%s/print$", SAMBAServer); - - snprintf(subcmd, sizeof(subcmd), - "mkdir W32X86;" - "put %s W32X86/%s.ppd;" - "put %s/drivers/ps5ui.dll W32X86/ps5ui.dll;" - "put %s/drivers/pscript.hlp W32X86/pscript.hlp;" - "put %s/drivers/pscript.ntf W32X86/pscript.ntf;" - "put %s/drivers/pscript5.dll W32X86/pscript5.dll", - ppdfile, dest, datadir, datadir, datadir, datadir); - - if ((status = do_samba_command("smbclient", address, subcmd)) != 0) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to copy Windows 2000 printer " - "driver files (%d)!\n"), - status); - unlink(ppdfile); - return (4); - } - /* - * See if we also have the CUPS driver files; if so, use them! + * Get the password, as needed... */ - snprintf(file, sizeof(file), "%s/drivers/cupsps6.dll", datadir); - if (!access(file, 0)) - { - /* - * Copy the CUPS driver files over... - */ - - snprintf(subcmd, sizeof(subcmd), - "put %s/drivers/cups6.ini W32X86/cups6.ini;" - "put %s/drivers/cupsps6.dll W32X86/cupsps6.dll;" - "put %s/drivers/cupsui6.dll W32X86/cupsui6.dll", - datadir, datadir, datadir); - - if ((status = do_samba_command("smbclient", address, subcmd)) != 0) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to copy CUPS printer driver " - "files (%d)!\n"), - status); - unlink(ppdfile); - return (4); - } - - /* - * Do the rpcclient command needed for the CUPS drivers... - */ - - snprintf(subcmd, sizeof(subcmd), - "adddriver \"Windows NT x86\" \"%s:" - "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:" - "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf," - "cups6.ini,cupsps6.dll,cupsui6.dll\"", - dest, dest, dest); - } - else - { - /* - * Don't have the CUPS drivers, so just use the standard Windows - * drivers... - */ - - snprintf(subcmd, sizeof(subcmd), - "adddriver \"Windows NT x86\" \"%s:" - "pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:" - "pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"", - dest, dest, dest); - } - - if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) + if (!SAMBAPassword) { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to install Windows 2000 printer " - "driver files (%d)!\n"), - status); - unlink(ppdfile); - return (5); - } - } - - snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", datadir); - if (!access(file, 0)) - { - have_drivers |= 2; - - /* - * Do the smbclient commands needed for the Adobe Win9x drivers... - */ - - snprintf(address, sizeof(address), "//%s/print$", SAMBAServer); - - snprintf(subcmd, sizeof(subcmd), - "mkdir WIN40;" - "put %s WIN40/%s.PPD;" - "put %s/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;" - "put %s/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;" - "put %s/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;" - "put %s/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;" - "put %s/drivers/PSMON.DLL WIN40/PSMON.DLL;", - ppdfile, dest, datadir, datadir, datadir, datadir, datadir); + snprintf(prompt, sizeof(prompt), + _("Password for %s required to access %s via SAMBA: "), + SAMBAUser, SAMBAServer); - if ((status = do_samba_command("smbclient", address, subcmd)) != 0) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to copy Windows 9x printer " - "driver files (%d)!\n"), - status); - unlink(ppdfile); - return (6); + if ((SAMBAPassword = cupsGetPassword(prompt)) == NULL) + break; } - /* - * Do the rpcclient commands needed for the Adobe Win9x drivers... - */ - - snprintf(subcmd, sizeof(subcmd), - "adddriver \"Windows 4.0\" \"%s:ADOBEPS4.DRV:%s.PPD:NULL:" - "ADOBEPS4.HLP:PSMON.DLL:RAW:" - "ADOBEPS4.DRV,%s.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM," - "ICONLIB.DLL\"", - dest, dest, dest); - - if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to install Windows 9x printer " - "driver files (%d)!\n"), - status); - unlink(ppdfile); - return (7); - } + status = cupsAdminExportSamba(dest, ppdfile, SAMBAServer, + SAMBAUser, SAMBAPassword, + Verbosity ? stderr : NULL); } unlink(ppdfile); - if (have_drivers == 0) - { - _cupsLangPuts(stderr, - _("cupsaddsmb: No Windows printer drivers are installed!\n")); - return (9); - } - else if (have_drivers == 2) - _cupsLangPuts(stderr, - _("cupsaddsmb: Warning, no Windows 2000 printer drivers " - "are installed!\n")); - - /* - * Finally, associate the drivers we just added with the queue... - */ - - snprintf(subcmd, sizeof(subcmd), "setdriver %s %s", dest, dest); - - if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) - { - _cupsLangPrintf(stderr, - _("cupsaddsmb: Unable to set Windows printer driver (%d)!\n"), - status); - return (8); - } - - return (0); -} - - -/* - * 'ppd_gets()' - Get a CR and/or LF-terminated line. - */ - -char * /* O - Line read or NULL on eof/error */ -ppd_gets(FILE *fp, /* I - File to read from*/ - char *buf, /* O - String buffer */ - int buflen) /* I - Size of string buffer */ -{ - int ch; /* Character from file */ - char *ptr, /* Current position in line buffer */ - *end; /* End of line buffer */ - - - /* - * Range check input... - */ - - if (!fp || !buf || buflen < 2 || feof(fp)) - return (NULL); - - /* - * Now loop until we have a valid line... - */ - - for (ptr = buf, end = buf + buflen - 1; ptr < end ;) - { - if ((ch = getc(fp)) == EOF) - { - if (ptr == buf) - return (NULL); - else - break; - } - - *ptr++ = ch; - - if (ch == '\r') - { - /* - * Check for CR LF... - */ - - if ((ch = getc(fp)) != '\n') - ungetc(ch, fp); - else if (ptr < end) - *ptr++ = ch; - - break; - } - else if (ch == '\n') - { - /* - * Line feed ends a line... - */ - - break; - } - } - - *ptr = '\0'; - - return (buf); + return (!status); } @@ -906,6 +279,7 @@ usage(void) " cupsaddsmb [options] -a\n" "\n" "Options:\n" + " -E Encrypt the connection to the server\n" " -H samba-server Use the named SAMBA server\n" " -U samba-user Authenticate using the named SAMBA user\n" " -a Export all printers\n" @@ -916,115 +290,5 @@ usage(void) /* - * 'write_option()' - Write a CUPS option to a PPD file. - */ - -int /* O - 0 on success, 1 on failure */ -write_option(FILE *dstfp, /* I - PPD file */ - int order, /* I - Order dependency */ - const char *name, /* I - Option name */ - const char *text, /* I - Option text */ - const char *attrname, /* I - Attribute name */ - ipp_attribute_t *suppattr, /* I - IPP -supported attribute */ - ipp_attribute_t *defattr, /* I - IPP -default attribute */ - int defval, /* I - Default value number */ - int valcount) /* I - Number of values */ -{ - int i; /* Looping var */ - - - if (!dstfp || !name || !text || !suppattr || !defattr) - return (1); - - fprintf(dstfp, "*JCLOpenUI *%s/%s: PickOne\n" - "*OrderDependency: %d JCLSetup *%s\n", - name, text, order, name); - - if (defattr->value_tag == IPP_TAG_INTEGER) - { - /* - * Do numeric options with a range or list... - */ - - fprintf(dstfp, "*Default%s: %d\n", name, defattr->values[defval].integer); - - if (suppattr->value_tag == IPP_TAG_RANGE) - { - /* - * List each number in the range... - */ - - for (i = suppattr->values[0].range.lower; - i <= suppattr->values[0].range.upper; - i ++) - { - fprintf(dstfp, "*%s %d: \"", name, i); - - if (valcount == 1) - fprintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", attrname, i); - else if (defval == 0) - fprintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, i); - else if (defval < (valcount - 1)) - fprintf(dstfp, ",%d\"\n", i); - else - fprintf(dstfp, ",%d\n\"\n*End\n", i); - } - } - else - { - /* - * List explicit numbers... - */ - - for (i = 0; i < suppattr->num_values; i ++) - { - fprintf(dstfp, "*%s %d: \"", name, suppattr->values[i].integer); - - if (valcount == 1) - fprintf(dstfp, "%%cupsJobTicket: %s=%d\n\"\n*End\n", attrname, - suppattr->values[i].integer); - else if (defval == 0) - fprintf(dstfp, "%%cupsJobTicket: %s=%d\"\n", attrname, - suppattr->values[i].integer); - else if (defval < (valcount - 1)) - fprintf(dstfp, ",%d\"\n", suppattr->values[i].integer); - else - fprintf(dstfp, ",%d\n\"\n*End\n", suppattr->values[i].integer); - } - } - } - else - { - /* - * Do text options with a list... - */ - - fprintf(dstfp, "*Default%s: %s\n", name, - defattr->values[defval].string.text); - - for (i = 0; i < suppattr->num_values; i ++) - { - fprintf(dstfp, "*%s %s: \"", name, suppattr->values[i].string.text); - - if (valcount == 1) - fprintf(dstfp, "%%cupsJobTicket: %s=%s\n\"\n*End\n", attrname, - suppattr->values[i].string.text); - else if (defval == 0) - fprintf(dstfp, "%%cupsJobTicket: %s=%s\"\n", attrname, - suppattr->values[i].string.text); - else if (defval < (valcount - 1)) - fprintf(dstfp, ",%s\"\n", suppattr->values[i].string.text); - else - fprintf(dstfp, ",%s\n\"\n*End\n", suppattr->values[i].string.text); - } - } - - fprintf(dstfp, "*JCLCloseUI: *%s\n\n", name); - - return (0); -} - - -/* - * End of "$Id: cupsaddsmb.c 5187 2006-02-26 20:36:03Z mike $". + * End of "$Id: cupsaddsmb.c 5233 2006-03-06 03:39:28Z mike $". */ diff --git a/systemv/lp.c b/systemv/lp.c index 6946280ae..ee2ac802b 100644 --- a/systemv/lp.c +++ b/systemv/lp.c @@ -1,5 +1,5 @@ /* - * "$Id: lp.c 4974 2006-01-25 07:04:33Z mike $" + * "$Id: lp.c 5235 2006-03-06 13:02:23Z mike $" * * "lp" command for the Common UNIX Printing System (CUPS). * @@ -287,7 +287,7 @@ main(int argc, /* I - Number of command-line arguments */ snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(), - httpGetHostname(buffer, sizeof(buffer))); + httpGetHostname(NULL, buffer, sizeof(buffer))); num_options = cupsAddOption("notify-recipient", email, num_options, &options); } @@ -838,5 +838,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lp.c 4974 2006-01-25 07:04:33Z mike $". + * End of "$Id: lp.c 5235 2006-03-06 13:02:23Z mike $". */ diff --git a/templates/Makefile b/templates/Makefile index 8eded7d39..b374ddda3 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 5222 2006-03-03 18:57:56Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # Template makefile for the Common UNIX Printing System (CUPS). # @@ -108,6 +108,13 @@ all: clean: +# +# Dummy depend... +# + +depend: + + # # Install files... # @@ -128,5 +135,22 @@ install: all # -# End of "$Id: Makefile 5222 2006-03-03 18:57:56Z mike $". +# Uninstall files... +# + +uninstall: + for file in $(FILES); do \ + $(RM) $(DATADIR)/templates/$$file; \ + done + for lang in $(LANGUAGES); do \ + for file in $(FILES); do \ + $(RM) $(DATADIR)/templates/$$lang/$$file; \ + done \ + $(RMDIR) $(DATADIR)/templates/$$lang; \ + done + -$(RMDIR) $(DATADIR)/templates + + +# +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/templates/admin.tmpl b/templates/admin.tmpl index 0c34c4939..6a23d703a 100644 --- a/templates/admin.tmpl +++ b/templates/admin.tmpl @@ -1,4 +1,4 @@ - +

Printers

diff --git a/templates/edit-config.tmpl.in b/templates/edit-config.tmpl.in index 775938cf6..d6019d3bd 100644 --- a/templates/edit-config.tmpl.in +++ b/templates/edit-config.tmpl.in @@ -81,10 +81,10 @@ function reset_config() -

Use Default Configuration File

diff --git a/test/Makefile b/test/Makefile index 86d3ad2dd..de2fd5713 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,9 @@ # -# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" +# "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $" # # IPP test makefile for the Common UNIX Printing System (CUPS). # -# Copyright 1997-2005 by Easy Software Products, all rights reserved. +# Copyright 1997-2006 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 @@ -55,6 +55,13 @@ depend: install: all +# +# Unnstall all targets... +# + +uninstall: + + # # ipptest # @@ -73,5 +80,5 @@ include Dependencies # -# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". +# End of "$Id: Makefile 5229 2006-03-05 16:48:12Z mike $". # diff --git a/tools/testosx b/tools/testosx index 98891cb25..9193b8a3d 100755 --- a/tools/testosx +++ b/tools/testosx @@ -3,7 +3,7 @@ if test ! -f tools/testosx; then echo "Run this script from the top-level CUPS source directory, e.g.:" echo "" - echo " tools/testosx" + echo " tools/testosx [version]" echo "" exit 1 fi @@ -11,6 +11,12 @@ fi # Get the current working copy version... rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'` +if test $# = 0; then + version="1.2svn-r$rev" +else + version=$1 +fi + # Setup an install directory... user=`whoami` topdir=`pwd` @@ -57,10 +63,10 @@ fi chmod 755 $pkgdir/Resources/postflight # Tag the current revision in the plist and web interface files... -sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \ +sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \ -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \ packaging/cups-desc.plist -sed -e '1,$s/@CUPS_VERSION@/1.2svn-r'$rev'/g' \ +sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \ -e '1,$s/@CUPS_RELEASE@/1.2.'$rev'/g' \ packaging/cups-info.plist @@ -91,7 +97,7 @@ $PackageMaker -build -v -p cups.pkg \ # Create a disk image... echo Creating MacOS X disk image... -hdiutil create -ov -srcfolder cups.pkg cups-1.2svn-r$rev.dmg +hdiutil create -ov -srcfolder cups.pkg cups-$version.dmg # Cleanup temp files... echo Removing temporary files... -- 2.39.2