CHANGES IN CUPS V1.6.2
- Documentation fixes
- - OpenBSD build fix (STR #4195, STR #4196)
- - The scheduler could crash when using Avahi (STR #4183, STR #4192)
+ - The SNMP backend now tries to work around broken printers that use a
+ newline to separate key/value pairs.
+ - The IPP backend did not send a cancel request to printers when a job
+ was canceled and the printer did not support Create-Job.
+ - Fixed EPM packaging files (STR #4199)
+ - OpenBSD build fix (STR #4195, STR #4196, STR #4197)
+ - The scheduler could crash when using Avahi (STR #4183, STR #4192,
+ STR #4200)
- The IPP backend could get stuck in an endless loop on certain network
errors (STR #4194)
- 32-bit builds failed on Debian (STR #4133)
-CHANGES.txt - 1.7b1 - 2012-08-30
+CHANGES.txt - 1.7b1 - 2012-09-30
--------------------------------
CHANGES IN CUPS V1.7b1
- CUPS now supports higher-level PIN printing, external accounting
systems, and "print here" printing environments (STR #4169)
+ - IRIX is no longer a supported operating system (STR #4092)
+ - The PPD compiler now supports JCL options properly (STR #4115)
+ - The web interface now checks whether the web browser has cookies
+ enabled and displays a suitable error message (STR #4141)
case `uname` in \
*BSD*) $(MAKE) $(MFLAGS) bsd;; \
Darwin*) $(MAKE) $(MFLAGS) osx;; \
- IRIX*) $(MAKE) $(MFLAGS) tardist;; \
Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
SunOS*) $(MAKE) $(MFLAGS) pkg;; \
esac
#endif /* HAVE_GSSAPI && HAVE_XPC */
static const char * const jattrs[] = /* Job attributes we want */
{
+ "job-id",
"job-impressions-completed",
"job-media-sheets-completed",
"job-name",
* Description is the IEEE-1284 device ID...
*/
+ char *ptr; /* Pointer into device ID */
+
+ for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
+ if (*ptr == '\n')
+ *ptr = ';'; /* A lot of bad printers put a newline */
if (!device->id)
device->id = strdup((char *)packet.object_value.string.bytes);
*/
char make_model[256]; /* Make and model */
+ char *ptr; /* Pointer into device ID */
-
+ for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
+ if (*ptr == '\n')
+ *ptr = ';'; /* A lot of bad printers put a newline */
if (device->id)
free(device->id);
close(fd);
}
-#elif defined(__sgi)
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
int i; /* Looping var */
int fd; /* File descriptor */
OPTIM="+z $OPTIM"
fi
;;
- IRIX)
- if test -z "$OPTIM"; then
- if test "x$with_optim" = x; then
- OPTIM="-O2"
- else
- OPTIM="$with_optim $OPTIM"
- fi
- fi
-
- if test "x$with_optim" = x; then
- OPTIM="-fullwarn -woff 1183,1209,1349,1506,3201 $OPTIM"
- fi
- ;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1
if test -z "$OPTIM"; then
dnl Fix "libdir" variable...
if test "$libdir" = "\${exec_prefix}/lib"; then
case "$uname" in
- IRIX*)
- libdir="$exec_prefix/lib32"
- ;;
Linux*)
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
libdir="$exec_prefix/lib64"
RCSTOP="620"
;;
- IRIX*)
- # IRIX
- INITDIR="/etc"
- RCSTART="60"
- RCSTOP="25"
- ;;
-
Linux | GNU | GNU/k*BSD*)
# Linux/HURD seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
AMANDIR="/usr/share/man"
PMANDIR="/usr/share/man"
;;
- IRIX)
- # SGI IRIX
- mandir="/usr/share/catman/u_man"
- AMANDIR="/usr/share/catman/a_man"
- PMANDIR="/usr/share/catman/p_man"
- ;;
*)
# All others
mandir="/usr/man"
dnl Setup manpage extensions...
case "$uname" in
- IRIX*)
- # SGI IRIX
- MAN1EXT=1
- MAN5EXT=5
- MAN7EXT=7
- MAN8EXT=1m
- MAN8DIR=1
- ;;
SunOS* | HP-UX*)
# Solaris and HP-UX
MAN1EXT=1
dnl
dnl Operating system stuff for CUPS.
dnl
-dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
GNU* | GNU/*)
uname="GNU"
;;
- IRIX*)
- uname="IRIX"
- ;;
Linux*)
uname="Linux"
;;
EXPORT_LDFLAGS="-Wl,-R$libdir"
fi
;;
- IRIX | Linux | GNU)
- # IRIX, Linux, and HURD...
+ Linux | GNU)
+ # Linux, and HURD...
if test $exec_prefix != /usr; then
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
}
-#ifdef __sgi
-# define ADDR_CAST (struct sockaddr *)
-#else
-# define ADDR_CAST (char *)
-#endif /* __sgi */
-
-
/*
* 'httpAddrLookup()' - Lookup the hostname associated with the address.
*
# ifdef AF_INET6
if (addr->addr.sa_family == AF_INET6)
- host = gethostbyaddr(ADDR_CAST &(addr->ipv6.sin6_addr),
+ host = gethostbyaddr((char *)&(addr->ipv6.sin6_addr),
sizeof(struct in_addr), AF_INET6);
else
# endif /* AF_INET6 */
- host = gethostbyaddr(ADDR_CAST &(addr->ipv4.sin_addr),
+ host = gethostbyaddr((char *)&(addr->ipv4.sin_addr),
sizeof(struct in_addr), AF_INET);
if (host == NULL)
# include <Security/Authorization.h>
# endif /* HAVE_AUTHORIZATION_H */
-# if defined(__sgi) || (defined(__APPLE__) && !defined(_SOCKLEN_T))
+# if defined(__APPLE__) && !defined(_SOCKLEN_T)
/*
- * IRIX and MacOS X 10.2.x do not define socklen_t, and in fact use an int instead of
+ * MacOS X 10.2.x does not define socklen_t, and in fact uses an int instead of
* unsigned type for length values...
*/
typedef int socklen_t;
-# endif /* __sgi || (__APPLE__ && !_SOCKLEN_T) */
+# endif /* __APPLE__ && !_SOCKLEN_T */
# include <cups/http.h>
# include "md5-private.h"
# include <winsock2.h>
# include <ws2tcpip.h>
# else
-# ifdef __sgi
-# define INET6 /* IRIX IPv6 support... */
-# endif /* __sgi */
# include <unistd.h>
# include <sys/time.h>
# include <sys/socket.h>
<H3><A NAME="BOOTP">Configuring the IP Address Using BOOTP</A></H3>
-<P>The BOOTP protocol is used when you need to provide additional information such as the location of a configuration file to the network interface. Using the standard <TT>bootpd(8)</TT> program supplied with UNIX you simply need to add a line to the <VAR>/etc/bootptab</VAR> file; for IRIX:</P>
-
-<PRE CLASS="command">
-myprinter 08:00:69:00:12:34 192.0.2.2 <VAR>myprinter.boot</VAR>
-</PRE>
-
-<P>Newer versions of <TT>bootpd</TT> use a different format:</P>
+<P>The BOOTP protocol is used when you need to provide additional information such as the location of a configuration file to the network interface. Using the standard <TT>bootpd(8)</TT> program supplied with UNIX you simply need to add a line to the <VAR>/etc/bootptab</VAR> file:</P>
<PRE CLASS="command">
myprinter:ha=080069001234:ip=192.0.2.2:<VAR>t144=myprinter.boot</VAR>
<UL>
- <LI>AIX, IRIX, Linux, Solaris:
+ <LI>AIX, Linux, Solaris:
<PRE CLASS="command">
/etc/init.d/cups restart
</PRE></LI>
Solaris format on Solaris, and the BSD format on other operating systems.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.13</SPAN><A NAME="PrintcapGUI">PrintcapGUI</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-PrintGUI /usr/bin/glpoptions
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>PrintcapGUI</CODE> directive sets the program to
-associate with the IRIX printer GUI interface script which is
-used by IRIX applications to display printer-specific options.
-There is no default program.</P>
-
-
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ReloadTimeout">ReloadTimeout</A></H2>
<H3>Examples</H3>
<TD>epm</TD>
<TD>Portable tarball with install script</TD>
</TR>
-<TR>
- <TD>inst</TD>
- <TD>IRIX inst/tardist</TD>
-</TR>
<TR>
<TD>pkg</TD>
<TD>Solaris pkgadd</TD>
<TD>swinstall</TD>
<TD>HP-UX swinstall</TD>
</TR>
-<TR>
- <TD>tardist</TD>
- <TD>IRIX inst/tardist</TD>
-</TR>
</TABLE></DIV>
<P>Finally, the <VAR>tools/testrpm</VAR> and <VAR>tools/testosx</VAR> scripts can be used to create binary packages from the current working copy for testing on Linux and OS X, respectively:</P>
putchar(0x16);
fwrite(Buffer, header->cupsBytesPerLine, 1, stdout);
fflush(stdout);
-
-#ifdef __sgi
- /*
- * This hack works around a bug in the IRIX serial port driver when
- * run at high baud rates (e.g. 115200 baud)... This results in
- * slightly slower label printing, but at least the labels come
- * out properly.
- */
-
- sginap(1);
-#endif /* __sgi */
}
else
Feed ++;
d 0755 root sys $SERVERBIN/daemon -
f 0555 root sys $SERVERBIN/daemon/cups-deviced scheduler/cups-deviced
f 0555 root sys $SERVERBIN/daemon/cups-driverd scheduler/cups-driverd
-f 0555 root sys $SERVERBIN/daemon/cups-polld scheduler/cups-polld
d 0755 root sys $SERVERBIN/driver -
d 0755 root sys $SERVERBIN/filter -
f 0555 root sys $SERVERBIN/filter/commandtops filter/commandtops
l 0755 root sys $LIBDIR/libcups.sl libcups.sl.2
f 0555 root sys $LIBDIR/libcupscgi.sl.1 cgi-bin/libcupscgi.sl.1 nostrip()
l 0755 root sys $LIBDIR/libcupscgi.sl libcupscgi.sl.1
-f 0555 root sys $LIBDIR/libcupsdriver.sl.1 driver/libcupsdriver.sl.1 nostrip()
-l 0755 root sys $LIBDIR/libcupsdriver.sl libcupsdriver.sl.1
f 0555 root sys $LIBDIR/libcupsimage.sl.2 filter/libcupsimage.sl.2 nostrip()
l 0755 root sys $LIBDIR/libcupsimage.sl libcupsimage.sl.2
f 0555 root sys $LIBDIR/libcupsmime.sl.1 scheduler/libcupsmime.sl.1 nostrip()
%system aix
f 0555 root sys $LIBDIR/libcups_s.a cups/libcups_s.a nostrip()
f 0555 root sys $LIBDIR/libcupscgi_s.a cgi-bin/libcupscgi_s.a nostrip()
-f 0555 root sys $LIBDIR/libcupsdriver_s.a driver/libcupsdriver_s.a nostrip()
f 0555 root sys $LIBDIR/libcupsimage_s.a filter/libcupsimage_s.a nostrip()
f 0555 root sys $LIBDIR/libcupsmime_s.a scheduler/libcupsmime_s.a nostrip()
f 0555 root sys $LIBDIR/libcupsppdc_s.a ppdc/libcupsppdc_s.a nostrip()
l 0755 root sys $LIBDIR/libcups.dylib libcups.2.dylib
f 0555 root sys $LIBDIR/libcupscgi.1.dylib cgi-bin/libcupscgi.1.dylib nostrip()
l 0755 root sys $LIBDIR/libcupscgi.dylib libcupscgi.1.dylib
-f 0555 root sys $LIBDIR/libcupsdriver.1.dylib driver/libcupsdriver.1.dylib nostrip()
-l 0755 root sys $LIBDIR/libcupsdriver.dylib libcupsdriver.1.dylib
f 0555 root sys $LIBDIR/libcupsimage.2.dylib filter/libcupsimage.2.dylib nostrip()
l 0755 root sys $LIBDIR/libcupsimage.dylib libcupsimage.2.dylib
f 0555 root sys $LIBDIR/libcupsmime.1.dylib scheduler/libcupsmime.1.dylib nostrip()
l 0755 root sys $LIBDIR/libcups.so libcups.so.2
f 0555 root sys $LIBDIR/libcupscgi.so.1 cgi-bin/libcupscgi.so.1 nostrip()
l 0755 root sys $LIBDIR/libcupscgi.so libcupscgi.so.1
-f 0555 root sys $LIBDIR/libcupsdriver.so.1 driver/libcupsdriver.so.1 nostrip()
-l 0755 root sys $LIBDIR/libcupsdriver.so libcupsdriver.so.1
f 0555 root sys $LIBDIR/libcupsimage.so.2 filter/libcupsimage.so.2 nostrip()
l 0755 root sys $LIBDIR/libcupsimage.so libcupsimage.so.2
f 0555 root sys $LIBDIR/libcupsmime.so.1 scheduler/libcupsmime.so.1 nostrip()
d 0775 root $CUPS_GROUP $CACHEDIR -
d 0775 root $CUPS_GROUP $CACHEDIR/rss -
#d 0755 root $CUPS_GROUP $CACHEDIR/ppd -
+%system !darwin
d 0755 root $CUPS_GROUP $STATEDIR -
+%system all
d 0511 root $CUPS_PRIMARY_SYSTEM_GROUP $STATEDIR/certs -
# Data files
#f 0444 root sys $DATADIR/templates/zh_TW templates/zh_TW/*.tmpl
# Config files
-d 0755 root sys $SERVERROOT -
+d 0755 root $CUPS_GROUP $SERVERROOT -
d 0755 root $CUPS_GROUP $SERVERROOT/interfaces -
d 0755 root $CUPS_GROUP $SERVERROOT/ppd -
d 0700 root $CUPS_GROUP $SERVERROOT/ssl -
if (!o->choices->count)
continue;
- if (!o->text->value)
+ if (o->section == PPDC_SECTION_JCL)
+ {
+ if (!o->text->value)
+ cupsFilePrintf(fp, "*JCLOpenUI *%s/%s: ", o->name->value,
+ catalog->find_message(o->name->value));
+ else
+ cupsFilePrintf(fp, "*JCLOpenUI *%s/%s: ", o->name->value,
+ catalog->find_message(o->text->value));
+ }
+ else if (!o->text->value)
cupsFilePrintf(fp, "*OpenUI *%s/%s: ", o->name->value,
catalog->find_message(o->name->value));
else
{ "PreserveJobFiles", &JobFiles, CUPSD_VARTYPE_TIME },
{ "PreserveJobHistory", &JobHistory, CUPSD_VARTYPE_TIME },
{ "Printcap", &Printcap, CUPSD_VARTYPE_STRING },
- { "PrintcapGUI", &PrintcapGUI, CUPSD_VARTYPE_STRING },
{ "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_TIME },
{ "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING },
{ "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING },
"%p %u %j %T %P %C %{job-billing} "
"%{job-originating-host-name} %{job-name} %{media} %{sides}");
cupsdSetString(&Printcap, CUPS_DEFAULT_PRINTCAP);
- cupsdSetString(&PrintcapGUI, "/usr/bin/glpoptions");
cupsdSetString(&FontPath, CUPS_FONTPATH);
cupsdSetString(&RemoteRoot, "remroot");
cupsdSetStringf(&ServerHeader, "CUPS/%d.%d", CUPS_VERSION_MAJOR,
/* Temporary directory */
*Printcap VALUE(NULL),
/* Printcap file */
- *PrintcapGUI VALUE(NULL),
- /* GUI program to use for IRIX */
*FontPath VALUE(NULL),
/* Font search path */
*RemoteRoot VALUE(NULL),
#
# Startup/shutdown script for CUPS.
#
-# Copyright 2007-2011 by Apple Inc.
+# Copyright 2007-2012 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
#### OS-Dependent Configuration
case "`uname`" in
- IRIX*)
- IS_ON=/sbin/chkconfig
-
- if $IS_ON verbose; then
- ECHO=echo
- else
- ECHO=:
- fi
- ECHO_OK=:
- ECHO_ERROR=:
- ;;
-
*BSD*)
IS_ON=:
ECHO=echo
HP-UX* | AIX* | SINIX*)
pid=`ps -e | awk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
;;
- IRIX* | SunOS*)
+ SunOS*)
pid=`ps -e | nawk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
;;
UnixWare*)
else
# endif /* __APPLE__ */
# ifdef HAVE_AVAHI
+ if (DNSSDClient)
{
const char *host_name = avahi_client_get_host_name(DNSSDClient);
const char *host_fqdn = avahi_client_get_host_name_fqdn(DNSSDClient);
else
cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName);
}
-# else /* HAVE_DNSSD */
+ else
+# endif /* HAVE_AVAHI */
{
cupsdSetString(&DNSSDComputerName, ServerName);
else
cupsdSetStringf(&DNSSDHostName, "%s.local", ServerName);
}
-# endif /* HAVE_AVAHI */
/*
* Then (re)register the web interface if enabled...
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
+
#ifdef HAVE_NOTIFY_H
# include <notify.h>
#endif /* HAVE_NOTIFY_H */
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif /* HAVE_SYS_PARAM_H */
+
/*
* Local functions...
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-#ifdef __sgi
- cups_file_t *fp; /* Fake lpsched lock file */
- struct stat statbuf; /* Needed for checking lpsched FIFO */
-#endif /* __sgi */
int run_as_child = 0;
/* Needed for background fork/exec */
#ifdef __APPLE__
}
}
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) && OpenBSD < 201211
/*
* Call _thread_sys_closefrom() so the child process doesn't reset the
* parent's file descriptors to be blocking. This is a workaround for a
- * limitation of userland libpthread on OpenBSD.
+ * limitation of userland libpthread on older versions of OpenBSD.
*/
_thread_sys_closefrom(0);
-#endif /* __OpenBSD__ */
+#endif /* __OpenBSD__ && OpenBSD < 201211 */
/*
* Since CoreFoundation and DBUS both create fork-unsafe data on execution of
signal(SIGTERM, sigterm_handler);
#endif /* HAVE_SIGSET */
-#ifdef __sgi
- /*
- * Try to create a fake lpsched lock file if one is not already there.
- * Some Adobe applications need it under IRIX in order to enable
- * printing...
- */
-
- if ((fp = cupsFileOpen("/var/spool/lp/SCHEDLOCK", "w")) == NULL)
- {
- syslog(LOG_LPR, "Unable to create fake lpsched lock file "
- "\"/var/spool/lp/SCHEDLOCK\"\' - %s!",
- strerror(errno));
- }
- else
- {
- fchmod(cupsFileNumber(fp), 0644);
- fchown(cupsFileNumber(fp), User, Group);
-
- cupsFileClose(fp);
- }
-#endif /* __sgi */
-
/*
* Initialize authentication certificates...
*/
krb5_free_context(KerberosContext);
#endif /* HAVE_GSSAPI */
-#ifdef __sgi
- /*
- * Remove the fake IRIX lpsched lock file, but only if the existing
- * file is not a FIFO which indicates that the real IRIX lpsched is
- * running...
- */
-
- if (!stat("/var/spool/lp/FIFO", &statbuf))
- if (!S_ISFIFO(statbuf.st_mode))
- unlink("/var/spool/lp/SCHEDLOCK");
-#endif /* __sgi */
-
cupsdStopSelect();
return (!stop_scheduler);
* load_ppd() - Load a cached PPD file, updating the cache as
* needed.
* new_media_col() - Create a media-col collection value.
- * write_irix_config() - Update the config files used by the IRIX
- * desktop tools.
- * write_irix_state() - Update the status files used by IRIX printing
- * desktop tools.
* write_xml_string() - Write a string with XML escaping.
*/
static void log_ipp_conformance(cupsd_printer_t *p, const char *reason);
static ipp_t *new_media_col(_pwg_size_t *size, const char *source,
const char *type);
-#ifdef __sgi
-static void write_irix_config(cupsd_printer_t *p);
-static void write_irix_state(cupsd_printer_t *p);
-#endif /* __sgi */
static void write_xml_string(cups_file_t *fp, const char *s);
{
int i, /* Looping var */
changed = 0; /* Class changed? */
-#ifdef __sgi
- char filename[1024]; /* Interface script filename */
-#endif /* __sgi */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDeletePrinter(p=%p(%s), update=%d)",
"cupsdDeletePrinter: Removing %s from Printers", p->name);
cupsArrayRemove(Printers, p);
- /*
- * Remove the dummy interface/icon/option files under IRIX...
- */
-
-#ifdef __sgi
- snprintf(filename, sizeof(filename), "/var/spool/lp/interface/%s", p->name);
- unlink(filename);
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/gui_interface/ELF/%s.gui",
- p->name);
- unlink(filename);
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);
- unlink(filename);
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);
- unlink(filename);
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);
- unlink(filename);
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/member/%s", p->name);
- unlink(filename);
-#endif /* __sgi */
-
/*
* If p is the default printer, assign a different one...
*/
(long)printer->marker_time);
cupsFilePuts(fp, "</Printer>\n");
-
-#ifdef __sgi
- /*
- * Make IRIX desktop & printer status happy
- */
-
- write_irix_state(printer);
-#endif /* __sgi */
}
cupsdCloseCreatedConfFile(fp, filename);
add_printer_defaults(p);
-#ifdef __sgi
- /*
- * Write the IRIX printer config and status files...
- */
-
- write_irix_config(p);
- write_irix_state(p);
-#endif /* __sgi */
-
/*
* Let the browse protocols reflect the change
*/
*/
p->state_time = time(NULL);
-
-#ifdef __sgi
- write_irix_state(p);
-#endif /* __sgi */
}
/*
cupsd_printer_t *p; /* Current printer */
-#ifdef __sgi
- /*
- * Update the IRIX printer state for the default printer; if
- * no printers remain, then the default printer file will be
- * removed...
- */
-
- write_irix_state(DefaultPrinter);
-#endif /* __sgi */
-
/*
* See if we have a printcap file; if not, don't bother writing it.
*/
}
-#ifdef __sgi
-/*
- * 'write_irix_config()' - Update the config files used by the IRIX
- * desktop tools.
- */
-
-static void
-write_irix_config(cupsd_printer_t *p) /* I - Printer to update */
-{
- char filename[1024]; /* Interface script filename */
- cups_file_t *fp; /* Interface script file */
- ipp_attribute_t *attr; /* Attribute data */
-
-
- /*
- * Add dummy interface and GUI scripts to fool SGI's "challenged" printing
- * tools. First the interface script that tells the tools what kind of
- * printer we have...
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/interface/%s", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePuts(fp, "#!/bin/sh\n");
-
- if ((attr = ippFindAttribute(p->attrs, "printer-make-and-model",
- IPP_TAG_TEXT)) != NULL)
- cupsFilePrintf(fp, "NAME=\"%s\"\n", attr->values[0].string.text);
- else if (p->type & CUPS_PRINTER_CLASS)
- cupsFilePuts(fp, "NAME=\"Printer Class\"\n");
- else
- cupsFilePuts(fp, "NAME=\"Remote Destination\"\n");
-
- if (p->type & CUPS_PRINTER_COLOR)
- cupsFilePuts(fp, "TYPE=ColorPostScript\n");
- else
- cupsFilePuts(fp, "TYPE=MonoPostScript\n");
-
- cupsFilePrintf(fp, "HOSTNAME=%s\n", ServerName);
- cupsFilePrintf(fp, "HOSTPRINTER=%s\n", p->name);
-
- cupsFileClose(fp);
-
- chmod(filename, 0755);
- chown(filename, User, Group);
- }
-
- /*
- * Then the member file that tells which device file the queue is connected
- * to... Networked printers use "/dev/null" in this file, so that's what
- * we use (the actual device URI can confuse some apps...)
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/member/%s", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePuts(fp, "/dev/null\n");
-
- cupsFileClose(fp);
-
- chmod(filename, 0644);
- chown(filename, User, Group);
- }
-
- /*
- * The gui_interface file is a script or program that launches a GUI
- * option panel for the printer, using options specified on the
- * command-line in the third argument. The option panel must send
- * any printing options to stdout on a single line when the user
- * accepts them, or nothing if the user cancels the dialog.
- *
- * The default options panel program is /usr/bin/glpoptions, from
- * the ESP Print Pro software. You can select another using the
- * PrintcapGUI option.
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/gui_interface/ELF/%s.gui", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePuts(fp, "#!/bin/sh\n");
- cupsFilePrintf(fp, "%s -d %s -o \"$3\"\n", PrintcapGUI, p->name);
-
- cupsFileClose(fp);
-
- chmod(filename, 0755);
- chown(filename, User, Group);
- }
-
- /*
- * The POD config file is needed by the printstatus command to show
- * the printer location and device.
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePrintf(fp, "Printer Class | %s\n",
- (p->type & CUPS_PRINTER_COLOR) ? "ColorPostScript" : "MonoPostScript");
- cupsFilePrintf(fp, "Printer Model | %s\n", p->make_model ? p->make_model : "");
- cupsFilePrintf(fp, "Location Code | %s\n", p->location ? p->location : "");
- cupsFilePrintf(fp, "Physical Location | %s\n", p->info ? p->info : "");
- cupsFilePrintf(fp, "Port Path | %s\n", p->device_uri);
- cupsFilePrintf(fp, "Config Path | /var/spool/lp/pod/%s.config\n", p->name);
- cupsFilePrintf(fp, "Active Status Path | /var/spool/lp/pod/%s.status\n", p->name);
- cupsFilePuts(fp, "Status Update Wait | 10 seconds\n");
-
- cupsFileClose(fp);
-
- chmod(filename, 0664);
- chown(filename, User, Group);
- }
-}
-
-
-/*
- * 'write_irix_state()' - Update the status files used by IRIX printing
- * desktop tools.
- */
-
-static void
-write_irix_state(cupsd_printer_t *p) /* I - Printer to update */
-{
- char filename[1024]; /* Interface script filename */
- cups_file_t *fp; /* Interface script file */
- int tag; /* Status tag value */
-
-
- if (p)
- {
- /*
- * The POD status file is needed for the printstatus window to
- * provide the current status of the printer.
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePrintf(fp, "Operational Status | %s\n",
- (p->state == IPP_PRINTER_IDLE) ? "Idle" :
- (p->state == IPP_PRINTER_PROCESSING) ? "Busy" :
- "Faulted");
- cupsFilePrintf(fp, "Information | 01 00 00 | %s\n", CUPS_SVERSION);
- cupsFilePrintf(fp, "Information | 02 00 00 | Device URI: %s\n",
- p->device_uri);
- cupsFilePrintf(fp, "Information | 03 00 00 | %s jobs\n",
- p->accepting ? "Accepting" : "Not accepting");
- cupsFilePrintf(fp, "Information | 04 00 00 | %s\n", p->state_message);
-
- cupsFileClose(fp);
-
- chmod(filename, 0664);
- chown(filename, User, Group);
- }
-
- /*
- * The activeicons file is needed to provide desktop icons for printers:
- *
- * [ quoted from /usr/lib/print/tagit ]
- *
- * --- Type of printer tags (base values)
- *
- * Dumb=66048 # 0x10200
- * DumbColor=66080 # 0x10220
- * Raster=66112 # 0x10240
- * ColorRaster=66144 # 0x10260
- * Plotter=66176 # 0x10280
- * PostScript=66208 # 0x102A0
- * ColorPostScript=66240 # 0x102C0
- * MonoPostScript=66272 # 0x102E0
- *
- * --- Printer state modifiers for local printers
- *
- * Idle=0 # 0x0
- * Busy=1 # 0x1
- * Faulted=2 # 0x2
- * Unknown=3 # 0x3 (Faulted due to unknown reason)
- *
- * --- Printer state modifiers for network printers
- *
- * NetIdle=8 # 0x8
- * NetBusy=9 # 0x9
- * NetFaulted=10 # 0xA
- * NetUnknown=11 # 0xB (Faulted due to unknown reason)
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);
-
- if (p->type & CUPS_PRINTER_CLASS)
- unlink(filename);
- else if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- if (p->type & CUPS_PRINTER_COLOR)
- tag = 66240;
- else
- tag = 66272;
-
- if (p->type & CUPS_PRINTER_REMOTE)
- tag |= 8;
-
- if (p->state == IPP_PRINTER_PROCESSING)
- tag |= 1;
-
- else if (p->state == IPP_PRINTER_STOPPED)
- tag |= 2;
-
- cupsFilePuts(fp, "#!/bin/sh\n");
- cupsFilePrintf(fp, "#Tag %d\n", tag);
-
- cupsFileClose(fp);
-
- chmod(filename, 0755);
- chown(filename, User, Group);
- }
- }
-
- /*
- * The default file is needed by the printers window to show
- * the default printer.
- */
-
- snprintf(filename, sizeof(filename), "/var/spool/lp/default");
-
- if (DefaultPrinter != NULL)
- {
- if ((fp = cupsFileOpen(filename, "w")) != NULL)
- {
- cupsFilePrintf(fp, "%s\n", DefaultPrinter->name);
-
- cupsFileClose(fp);
-
- chmod(filename, 0644);
- chown(filename, User, Group);
- }
- }
- else
- unlink(filename);
-}
-#endif /* __sgi */
-
-
/*
* 'write_xml_string()' - Write a string with XML escaping.
*/
*
* Select abstraction functions for the CUPS scheduler.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
/*
* Design Notes for Poll/Select API in CUPSD
* -----------------------------------------
- *
+ *
* SUPPORTED APIS
- *
+ *
* OS select poll epoll kqueue /dev/poll
* -------------- ------ ------ ------ ------ ---------
* AIX YES YES NO NO NO
* FreeBSD YES YES NO YES NO
* HP-UX YES YES NO NO NO
- * IRIX YES YES NO NO NO
* Linux YES YES YES NO NO
* MacOS X YES YES NO YES NO
* NetBSD YES YES NO YES NO
* Solaris YES YES NO NO YES
* Tru64 YES YES NO NO NO
* Windows YES NO NO NO NO
- *
- *
+ *
+ *
* HIGH-LEVEL API
- *
+ *
* typedef void (*cupsd_selfunc_t)(void *data);
- *
+ *
* void cupsdStartSelect(void);
* void cupsdStopSelect(void);
* void cupsdAddSelect(int fd, cupsd_selfunc_t read_cb,
* cupsd_selfunc_t write_cb, void *data);
* void cupsdRemoveSelect(int fd);
* int cupsdDoSelect(int timeout);
- *
- *
+ *
+ *
* IMPLEMENTATION STRATEGY
- *
+ *
* 0. Common Stuff
* a. CUPS array of file descriptor to callback functions
* and data + temporary array of removed fd's.
* working sets.
* d. cupsdStopSelect() frees all of the memory used by the
* CUPS array and fd_set's.
- *
+ *
* 2. poll() - O(n log n)
* a. Regular array of pollfd, sorted the same as the CUPS
* array.
* e. cupsdRemoveSelect() flags the pollfd array as invalid.
* f. cupsdStopSelect() frees all of the memory used by the
* CUPS array and pollfd array.
- *
+ *
* 3. epoll() - O(n)
* a. cupsdStartSelect() creates epoll file descriptor using
* epoll_create() with the maximum fd count, and
* the callback record.
* d. cupsdStopSelect() closes the epoll file descriptor and
* frees all of the memory used by the event buffer.
- *
+ *
* 4. kqueue() - O(n)
* b. cupsdStartSelect() creates kqueue file descriptor
* using kqueue() function and allocates a global event
* find the callback record.
* e. cupsdStopSelect() closes the kqueue() file descriptor
* and frees all of the memory used by the event buffer.
- *
+ *
* 5. /dev/poll - O(n log n) - NOT YET IMPLEMENTED
* a. cupsdStartSelect() opens /dev/poll and allocates an
* array of pollfd structs; on failure to open /dev/poll,
}
break;
-#ifdef __sgi
- case 'b' : /* Show both the local and remote status */
- op = 'b';
-
- if (argv[i][2])
- {
- /*
- * The local and remote status are separated by a blank line;
- * since all CUPS jobs are networked, we only output the
- * second list for now... In the future, we might further
- * emulate this by listing the remote server's queue, but
- * for now this is enough to make the SGI printstatus program
- * happy...
- */
-
- check_dest(argv[0], argv[i] + 2, &num_dests, &dests);
-
- puts("");
- status |= show_jobs(argv[i] + 2, NULL, 3, ranking, which);
- }
- else
- {
- _cupsLangPrintf(stderr,
- _("%s: Error - expected destination after "
- "\"-b\" option."),
- argv[0]);
-
- return (1);
- }
- break;
-#endif /* __sgi */
-
case 'c' : /* Show classes and members */
op = 'c';
break;
case 'l' : /* Long status or long job status */
-#ifdef __sgi
- op = 'l';
-
- if (argv[i][2])
- {
- check_dest(argv[0], argv[i] + 2, &num_dests, &dests);
-
- status |= show_jobs(argv[i] + 2, NULL, 3, ranking, which);
- }
- else
-#endif /* __sgi */
- long_status = 2;
+ long_status = 2;
break;
case 'o' : /* Show jobs by destination */
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
{refresh_page?<META HTTP-EQUIV="Refresh" CONTENT="{refresh_page}">:}
+ <SCRIPT TYPE="text/javascript"><!--
+ /* Show an error if cookies are disabled */
+ function check_cookies() {
+ if (!navigator.cookieEnabled) {
+ document.getElementById('body').innerHTML = 'This page uses cookies to prevent common cross-site attacks. Please enable cookies in your browser.';
+ }
+ }
+ --></SCRIPT>
</HEAD>
-<BODY>
+<BODY ONLOAD="check_cookies();">
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
</TR>
<TR><TD COLSPAN="9"> </TD></TR>
</TABLE>
+<DIV ID="body">
-</TD></TR>
+</DIV></TD></TR>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">CUPS i el logotip de CUPS són marques registrades per
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2012 Apple
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
{refresh_page?<META HTTP-EQUIV="Refresh" CONTENT="{refresh_page}">:}
+ <SCRIPT TYPE="text/javascript"><!--
+ /* Show an error if cookies are disabled */
+ function check_cookies() {
+ if (!navigator.cookieEnabled) {
+ document.getElementById('body').innerHTML = 'This page uses cookies to prevent common cross-site attacks. Please enable cookies in your browser.';
+ }
+ }
+ --></SCRIPT>
</HEAD>
-<BODY>
+<BODY ONLOAD="check_cookies();">
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
</TR>
<TR><TD COLSPAN="9"> </TD></TR>
</TABLE>
+<DIV ID="body">
-</TD></TR>
+</DIV></TD></TR>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">CUPS y el logo de CUPS son marcas registradas de
<A HREF="http://www.apple.com">Apple, Inc.</A> Los derechos de copia de CUPS
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
{refresh_page?<META HTTP-EQUIV="Refresh" CONTENT="{refresh_page}">:}
+ <SCRIPT TYPE="text/javascript"><!--
+ /* Show an error if cookies are disabled */
+ function check_cookies() {
+ if (!navigator.cookieEnabled) {
+ document.getElementById('body').innerHTML = 'This page uses cookies to prevent common cross-site attacks. Please enable cookies in your browser.';
+ }
+ }
+ --></SCRIPT>
</HEAD>
-<BODY>
+<BODY ONLOAD="check_cookies();">
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
</TR>
<TR><TD COLSPAN="9"> </TD></TR>
</TABLE>
+<DIV ID="body">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
{refresh_page?<META HTTP-EQUIV="Refresh" CONTENT="{refresh_page}">:}
+ <SCRIPT TYPE="text/javascript"><!--
+ /* Show an error if cookies are disabled */
+ function check_cookies() {
+ if (!navigator.cookieEnabled) {
+ document.getElementById('body').innerHTML = 'This page uses cookies to prevent common cross-site attacks. Please enable cookies in your browser.';
+ }
+ }
+ --></SCRIPT>
</HEAD>
-<BODY>
+<BODY ONLOAD="check_cookies();">
<TABLE CLASS="page" SUMMARY="{title}">
<TR><TD CLASS="body">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
</TR>
<TR><TD COLSPAN="9"> </TD></TR>
</TABLE>
+<DIV ID="body">
-</TD></TR>
+</DIV></TD></TR>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
-</TD></TR>
+</DIV></TD></TR>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple