Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| d35c99205a |
+1
-70
@@ -1,75 +1,6 @@
|
||||
CHANGES.txt - 2010-03-30
|
||||
CHANGES.txt - 2009-11-09
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.4.3
|
||||
|
||||
- SECURITY: The scheduler could try responding on a closed client
|
||||
connection, leading to a crash (STR #3200)
|
||||
- SECURITY: The lppasswd program allowed the localization files to be
|
||||
overridden when running in setuid mode (STR #3482)
|
||||
- Localization updates (STR #3352, STR #3409, STR #3422, STR #3452,
|
||||
STR #3473, STR #3502)
|
||||
- Documentation updates (STR #3451, STR #3504)
|
||||
- The IPP backend now sets the printer-state-message to "Ready to
|
||||
print." at the end of a successful job (STR #3460)
|
||||
- The PPD compiler did not correctly add the manufacturer to the output
|
||||
filename when using the "-m" option (STR #3469)
|
||||
- The IPP backend did not handle authentication properly for the Get-
|
||||
Printer-Attributes operation (STR 3458)
|
||||
- Getting SNMP values larger than 127 bytes did not work.
|
||||
- IPP conformance: Get-Jobs has a default value for requested-attributes
|
||||
(STR #3383)
|
||||
- cupsPrintFiles() did not report all errors (STR #3449)
|
||||
- cupsAddDest() could read freed memory (STR #3448)
|
||||
- The DBUS notifier did not build (STR #3447)
|
||||
- The scheduler would crash when an active printer was deleted.
|
||||
- The snmp backend did not work with some printers (STR #3413)
|
||||
- The web interface did not show the conflicting values when setting
|
||||
options (STR #3440)
|
||||
- Setting options in the web interface did not always work (STR #3439)
|
||||
- The scheduler did not use the Get-Job-Attributes policy for a printer
|
||||
(STR #3431)
|
||||
- The scheduler added two job-name attributes to each job object
|
||||
(STR #3428)
|
||||
- CSS files would not print (STR #3442)
|
||||
- The scheduler did not clean out completed jobs when PreserveJobHistory
|
||||
was turned off (STR #3425)
|
||||
- The web interface did not show completed jobs for a printer
|
||||
(STR #3436)
|
||||
- Authenticated printing did not always work when printing directly to
|
||||
a remote server (STR #3435)
|
||||
- The USB backend did not work on Solaris (STR #3423)
|
||||
- cupstestppd didn't catch problems with JobPatchFile definitions
|
||||
(STR #3421)
|
||||
- The socket backend could crash if a SNMP string had a negative length.
|
||||
- Fixed some termination issues with the USB backend on Mac OS X.
|
||||
- The side-channel APIs did not handle interrupts properly.
|
||||
- The network backends incorrectly cleared the media-empty-warning
|
||||
state.
|
||||
- The web interface did not allow users to successfully add serial
|
||||
printers (STR #3391)
|
||||
- cupsTempFd() did not work in some situations (STR #3382)
|
||||
- Some C API headers were missing C++ wrapper logic.
|
||||
- The PPD compiler did not localize single-language PPD options properly
|
||||
(STR #3386)
|
||||
- Modifying a printer from the web interface sometimes caused the wrong
|
||||
driver to be selected (STR #3418)
|
||||
- The scheduler did not handle out-of-memory conditions properly when
|
||||
loading a job (STR #3407)
|
||||
- When adding printers from the web interface, the dynamic updates of
|
||||
the device list made it hard to pick a device (STR #3406)
|
||||
- Fixed a typo in the web interface admin page template (STR 3403)
|
||||
- The web interface did not preserve the "printer is shared" state when
|
||||
modifying a printer (STR #3390)
|
||||
- The PPD compiler incorrectly inserted translations of empty strings
|
||||
(STR #3411)
|
||||
- The scheduler did not reset the SIGPIPE handler of child processes
|
||||
(STR #3399)
|
||||
- cupsGetNamedDest() incorrectly returned the default printer if the
|
||||
named printer did not exist (STR #3397)
|
||||
- Fixed a GNU TLS error handling bug (STR #3381)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.2
|
||||
|
||||
- SECURITY: The CUPS web interface was vulnerable to several XSS and
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2010-03-13
|
||||
CREDITS.txt - 2009-07-07
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -40,7 +40,7 @@ like to thank the following individuals for their contributions:
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
Teppo Turliainen - Finnish localization.
|
||||
Teppo Turlianen - Finnish localization.
|
||||
Tim Waugh - Lots of patches, testing, and Linux
|
||||
integration.
|
||||
Yugami - LDAP browsing support.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.4.3 - 2009-12-15
|
||||
INSTALL - CUPS v1.4.0 - 2009-06-26
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
+4
-6
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Top-level Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 2007-2010 by Apple Inc.
|
||||
# Copyright 2007-2009 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -139,15 +139,13 @@ depend:
|
||||
|
||||
#
|
||||
# Run the clang.llvm.org static code analysis tool on the C sources.
|
||||
# (at least checker-231 is required for scan-build to work this way)
|
||||
#
|
||||
|
||||
.PHONY: clang clang-changes
|
||||
.PHONY: clang
|
||||
clang:
|
||||
$(RM) -r clang
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
|
||||
clang-changes:
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) \
|
||||
CC=ccc-analyzer CXX=ccc-analyzer clean all
|
||||
|
||||
|
||||
#
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.4.3 - 2009-12-15
|
||||
README - CUPS v1.4.0 - 2009-06-26
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
|
||||
@@ -34,26 +34,6 @@
|
||||
# include <cups/string.h>
|
||||
# include <signal.h>
|
||||
|
||||
# ifdef __linux
|
||||
# include <sys/ioctl.h>
|
||||
# include <linux/lp.h>
|
||||
# define IOCNR_GET_DEVICE_ID 1
|
||||
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
|
||||
# include <linux/parport.h>
|
||||
# include <linux/ppdev.h>
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# endif /* __linux */
|
||||
|
||||
# ifdef __sun
|
||||
# ifdef __sparc
|
||||
# include <sys/ecppio.h>
|
||||
# else
|
||||
# include <sys/ioccom.h>
|
||||
# include <sys/ecppsys.h>
|
||||
# endif /* __sparc */
|
||||
# endif /* __sun */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
@@ -300,8 +280,7 @@ extern int backendNetworkSideCB(int print_fd, int device_fd,
|
||||
int snmp_fd, http_addr_t *addr,
|
||||
int use_bc);
|
||||
extern ssize_t backendRunLoop(int print_fd, int device_fd, int snmp_fd,
|
||||
http_addr_t *addr, int use_bc,
|
||||
int update_state,
|
||||
http_addr_t *addr, int use_bc,
|
||||
int (*side_cb)(int print_fd,
|
||||
int device_fd,
|
||||
int snmp_fd,
|
||||
|
||||
+21
-1
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -27,6 +27,26 @@
|
||||
|
||||
#include "backend-private.h"
|
||||
|
||||
#ifdef __linux
|
||||
# include <sys/ioctl.h>
|
||||
# include <linux/lp.h>
|
||||
# define IOCNR_GET_DEVICE_ID 1
|
||||
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
|
||||
# include <linux/parport.h>
|
||||
# include <linux/ppdev.h>
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* __linux */
|
||||
|
||||
#ifdef __sun
|
||||
# ifdef __sparc
|
||||
# include <sys/ecppio.h>
|
||||
# else
|
||||
# include <sys/ioccom.h>
|
||||
# include <sys/ecppsys.h>
|
||||
# endif /* __sparc */
|
||||
#endif /* __sun */
|
||||
|
||||
|
||||
/*
|
||||
* 'backendGetDeviceID()' - Get the IEEE-1284 device ID string and
|
||||
|
||||
+4
-19
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IPP backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -434,7 +434,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
|
||||
|
||||
tbytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
tbytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0,
|
||||
backendNetworkSideCB);
|
||||
|
||||
if (snmp_fd >= 0)
|
||||
@@ -738,15 +738,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
|
||||
{
|
||||
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
|
||||
"Negotiate", 9))
|
||||
auth_info_required = "negotiate";
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
@@ -1362,10 +1353,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (ipp_status > IPP_OK_CONFLICT)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1843,11 +1831,8 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
* Change to an unpriviledged user...
|
||||
*/
|
||||
|
||||
if (setgid(fileinfo.st_gid))
|
||||
return (errno);
|
||||
|
||||
if (setuid(fileinfo.st_uid))
|
||||
return (errno);
|
||||
setgid(fileinfo.st_gid);
|
||||
setuid(fileinfo.st_uid);
|
||||
}
|
||||
|
||||
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
|
||||
|
||||
+2
-2
@@ -447,8 +447,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
|
||||
|
||||
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
backendNetworkSideCB);
|
||||
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, backendNetworkSideCB);
|
||||
|
||||
if (snmp_fd >= 0)
|
||||
_cupsSNMPClose(snmp_fd);
|
||||
@@ -798,6 +797,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
error = errno;
|
||||
close(fd);
|
||||
fd = -1;
|
||||
|
||||
if (addr->next)
|
||||
continue;
|
||||
|
||||
+2
-6
@@ -170,13 +170,9 @@ backendNetworkSideCB(
|
||||
|
||||
case CUPS_ASN1_BIT_STRING :
|
||||
case CUPS_ASN1_OCTET_STRING :
|
||||
if (packet.object_value.string.num_bytes < 0)
|
||||
i = 0;
|
||||
else if (packet.object_value.string.num_bytes <
|
||||
(sizeof(data) - (dataptr - data)))
|
||||
i = (int)(sizeof(data) - (dataptr - data));
|
||||
if (packet.object_value.string.num_bytes < i)
|
||||
i = packet.object_value.string.num_bytes;
|
||||
else
|
||||
i = (int)(sizeof(data) - (dataptr - data));
|
||||
|
||||
memcpy(dataptr, packet.object_value.string.bytes, i);
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
|
||||
+5
-6
@@ -147,7 +147,6 @@ backendRunLoop(
|
||||
int snmp_fd, /* I - SNMP socket or -1 if none */
|
||||
http_addr_t *addr, /* I - Address of device */
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
int update_state, /* I - Update printer-state-reasons? */
|
||||
int (*side_cb)(int, int, int, http_addr_t *, int))
|
||||
/* I - Side-channel callback */
|
||||
{
|
||||
@@ -246,7 +245,7 @@ backendRunLoop(
|
||||
* Pause printing to clear any pending errors...
|
||||
*/
|
||||
|
||||
if (errno == ENXIO && offline != 1 && update_state)
|
||||
if (errno == ENXIO && offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently offline.\n"));
|
||||
@@ -352,7 +351,7 @@ backendRunLoop(
|
||||
|
||||
if (errno == ENOSPC)
|
||||
{
|
||||
if (paperout != 1 && update_state)
|
||||
if (paperout != 1)
|
||||
{
|
||||
fputs("STATE: +media-empty-warning\n", stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
@@ -361,7 +360,7 @@ backendRunLoop(
|
||||
}
|
||||
else if (errno == ENXIO)
|
||||
{
|
||||
if (offline != 1 && update_state)
|
||||
if (offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
@@ -377,13 +376,13 @@ backendRunLoop(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paperout && update_state)
|
||||
if (paperout)
|
||||
{
|
||||
fputs("STATE: -media-empty-warning\n", stderr);
|
||||
paperout = 0;
|
||||
}
|
||||
|
||||
if (offline && update_state)
|
||||
if (offline)
|
||||
{
|
||||
fputs("STATE: -offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now online.\n"));
|
||||
|
||||
@@ -232,8 +232,6 @@ backendSNMPSupplies(
|
||||
if (packet.object_value.string.num_bytes == 2)
|
||||
new_state = (packet.object_value.string.bytes[0] << 8) |
|
||||
packet.object_value.string.bytes[1];
|
||||
else if (packet.object_value.string.num_bytes == 1)
|
||||
new_state = (packet.object_value.string.bytes[0] << 8);
|
||||
else
|
||||
new_state = 0;
|
||||
|
||||
|
||||
+3
-5
@@ -999,7 +999,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
DEVICE_PRODUCT, LexmarkProductOID2);
|
||||
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
DEVICE_ID, LexmarkDeviceIdOID);
|
||||
DEVICE_URI, LexmarkDeviceIdOID);
|
||||
_cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
|
||||
packet.community, CUPS_ASN1_GET_REQUEST,
|
||||
DEVICE_PRODUCT, XeroxProductOID);
|
||||
@@ -1054,9 +1054,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
break;
|
||||
|
||||
case DEVICE_ID :
|
||||
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
|
||||
(!device->id ||
|
||||
strlen(device->id) < packet.object_value.string.num_bytes))
|
||||
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING)
|
||||
{
|
||||
/*
|
||||
* Update an existing cache entry...
|
||||
@@ -1109,7 +1107,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
|
||||
case DEVICE_URI :
|
||||
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
|
||||
!device->uri && packet.object_value.string.num_bytes > 0)
|
||||
!device->uri)
|
||||
{
|
||||
/*
|
||||
* Update an existing cache entry...
|
||||
|
||||
+1
-1
@@ -393,7 +393,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1, 0,
|
||||
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1,
|
||||
backendNetworkSideCB);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
|
||||
+27
-39
@@ -373,12 +373,12 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (!g.make || !g.model)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
|
||||
|
||||
if (!g.make)
|
||||
fputs("DEBUG: USB make string is NULL\n", stderr);
|
||||
fputs("DEBUG: USB make string is NULL!\n", stderr);
|
||||
if (!g.model)
|
||||
fputs("DEBUG: USB model string is NULL\n", stderr);
|
||||
fputs("DEBUG: USB model string is NULL!\n", stderr);
|
||||
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
strlcpy(print_buffer, "USB class driver", sizeof(print_buffer));
|
||||
|
||||
fputs("STATE: +apple-missing-usbclassdriver-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
|
||||
fprintf(stderr, "DEBUG: Could not load %s\n", print_buffer);
|
||||
|
||||
if (driverBundlePath)
|
||||
@@ -496,9 +496,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
fputs("DEBUG: Couldn't create side-channel thread\n", stderr);
|
||||
registry_close();
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
|
||||
fputs("DEBUG: Couldn't create side-channel thread!\n", stderr);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
@@ -515,9 +514,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
fputs("DEBUG: Couldn't create read thread\n", stderr);
|
||||
registry_close();
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error!\n"));
|
||||
fputs("DEBUG: Couldn't create read thread!\n", stderr);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -595,16 +593,14 @@ print_device(const char *uri, /* I - Device URI */
|
||||
if (errno == EINTR && total_bytes == 0)
|
||||
{
|
||||
fputs("DEBUG: Received an interrupt before any bytes were "
|
||||
"written, aborting\n", stderr);
|
||||
registry_close();
|
||||
"written, aborting!\n", stderr);
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
else if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data!\n"));
|
||||
perror("DEBUG: select");
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,9 +640,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data!\n"));
|
||||
perror("DEBUG: read");
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -679,7 +674,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (iostatus == kIOUSBTransactionTimeout)
|
||||
{
|
||||
fputs("DEBUG: Got USB transaction timeout during write\n", stderr);
|
||||
fputs("DEBUG: Got USB transaction timeout during write!\n", stderr);
|
||||
iostatus = 0;
|
||||
}
|
||||
|
||||
@@ -689,7 +684,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
else if (iostatus == kIOUSBPipeStalled)
|
||||
{
|
||||
fputs("DEBUG: Got USB pipe stalled during write\n", stderr);
|
||||
fputs("DEBUG: Got USB pipe stalled during write!\n", stderr);
|
||||
|
||||
bytes = g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
@@ -702,7 +697,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
else if (iostatus == kIOReturnAborted)
|
||||
{
|
||||
fputs("DEBUG: Got USB return aborted during write\n", stderr);
|
||||
fputs("DEBUG: Got USB return aborted during write!\n", stderr);
|
||||
|
||||
IOReturn err = (*g.classdriver)->Abort(g.classdriver);
|
||||
fprintf(stderr, "DEBUG: USB class driver Abort returned %x\n", err);
|
||||
@@ -721,7 +716,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Write error - bail if we don't see an error we can retry...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to send print data\n"));
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to send print data!\n"));
|
||||
fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n",
|
||||
iostatus);
|
||||
|
||||
@@ -902,11 +897,11 @@ static void *read_thread(void *reference)
|
||||
#endif
|
||||
}
|
||||
else if (readstatus == kIOUSBTransactionTimeout)
|
||||
fputs("DEBUG: Got USB transaction timeout during read\n", stderr);
|
||||
fputs("DEBUG: Got USB transaction timeout during read!\n", stderr);
|
||||
else if (readstatus == kIOUSBPipeStalled)
|
||||
fputs("DEBUG: Got USB pipe stalled during read\n", stderr);
|
||||
fputs("DEBUG: Got USB pipe stalled during read!\n", stderr);
|
||||
else if (readstatus == kIOReturnAborted)
|
||||
fputs("DEBUG: Got USB return aborted during read\n", stderr);
|
||||
fputs("DEBUG: Got USB return aborted during read!\n", stderr);
|
||||
|
||||
/*
|
||||
* Make sure this loop executes no more than once every 250 miliseconds...
|
||||
@@ -948,12 +943,7 @@ sidechannel_thread(void *reference)
|
||||
datalen = sizeof(data);
|
||||
|
||||
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))
|
||||
{
|
||||
if (status == CUPS_SC_STATUS_TIMEOUT)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
switch (command)
|
||||
{
|
||||
@@ -1911,7 +1901,6 @@ static void run_legacy_backend(int argc,
|
||||
* Setup a SIGTERM handler then block it before forking...
|
||||
*/
|
||||
|
||||
int err; /* posix_spawn result */
|
||||
struct sigaction action; /* POSIX signal action */
|
||||
sigset_t newmask, /* New signal mask */
|
||||
oldmask; /* Old signal mask */
|
||||
@@ -1960,7 +1949,7 @@ static void run_legacy_backend(int argc,
|
||||
# else
|
||||
perror("DEBUG: Unable to set binary preference to ppc");
|
||||
# endif /* __x86_64__ */
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
@@ -1978,12 +1967,11 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
my_argv[i] = NULL;
|
||||
|
||||
if ((err = posix_spawn(&child_pid, usbpath, NULL, &attrs, my_argv,
|
||||
environ)) != 0)
|
||||
if (posix_spawn(&child_pid, usbpath, NULL, &attrs, my_argv, environ))
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to exec %s: %s\n", usbpath,
|
||||
strerror(err));
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
|
||||
strerror(errno));
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -2009,14 +1997,14 @@ static void run_legacy_backend(int argc,
|
||||
if (WIFSIGNALED(childstatus))
|
||||
{
|
||||
exitstatus = CUPS_BACKEND_STOP;
|
||||
fprintf(stderr, "DEBUG: usb(legacy) backend %d crashed on signal %d\n",
|
||||
fprintf(stderr, "DEBUG: usb(legacy) backend %d crashed on signal %d!\n",
|
||||
child_pid, WTERMSIG(childstatus));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((exitstatus = WEXITSTATUS(childstatus)) != 0)
|
||||
fprintf(stderr,
|
||||
"DEBUG: usb(legacy) backend %d stopped with status %d\n",
|
||||
"DEBUG: usb(legacy) backend %d stopped with status %d!\n",
|
||||
child_pid, exitstatus);
|
||||
else
|
||||
fprintf(stderr, "DEBUG: usb(legacy) backend %d exited with no errors\n",
|
||||
@@ -2058,7 +2046,7 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
exit(0);
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Child crashed on signal %d\n", status);
|
||||
fprintf(stderr, "DEBUG: Child crashed on signal %d!\n", status);
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -187,10 +187,10 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* select() or poll(), so we can't support the sidechannel either...
|
||||
*/
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, NULL);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, NULL);
|
||||
|
||||
#else
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb);
|
||||
#endif /* __sun */
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
|
||||
+1
-17
@@ -340,18 +340,7 @@ show_jobs(const char *command, /* I - Command name */
|
||||
char resource[1024]; /* Resource string */
|
||||
char rankstr[255]; /* Rank string */
|
||||
char namestr[1024]; /* Job name string */
|
||||
static const char * const jobattrs[] =/* Job attributes we want to see */
|
||||
{
|
||||
"copies",
|
||||
"job-id",
|
||||
"job-k-octets",
|
||||
"job-name",
|
||||
"job-originating-user-name",
|
||||
"job-printer-uri",
|
||||
"job-priority",
|
||||
"job-state"
|
||||
};
|
||||
static const char * const ranks[10] = /* Ranking strings */
|
||||
static const char *ranks[10] = /* Ranking strings */
|
||||
{
|
||||
"th",
|
||||
"st",
|
||||
@@ -379,7 +368,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
* attributes-charset
|
||||
* attributes-natural-language
|
||||
* job-uri or printer-uri
|
||||
* requested-attributes
|
||||
*/
|
||||
|
||||
request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS);
|
||||
@@ -409,10 +397,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
|
||||
}
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
(int)(sizeof(jobattrs) / sizeof(jobattrs[0])), NULL, jobattrs);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
+55
-63
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Administration CGI for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -52,7 +52,8 @@
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static int current_device = 0; /* Current device shown */
|
||||
static int current_device; /* Current device for add/modify */
|
||||
static time_t last_device_time; /* Last update time for device list */
|
||||
|
||||
|
||||
/*
|
||||
@@ -291,21 +292,6 @@ choose_device_cb(
|
||||
const char *device_location, /* I - Location */
|
||||
const char *title) /* I - Page title */
|
||||
{
|
||||
/*
|
||||
* For modern browsers, start a multi-part page so we can show that something
|
||||
* is happening. Non-modern browsers just get everything at the end...
|
||||
*/
|
||||
|
||||
if (current_device == 0 && cgiSupportsMultipart())
|
||||
{
|
||||
cgiStartMultipart();
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-device.tmpl");
|
||||
cgiEndHTML();
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add the device to the array...
|
||||
*/
|
||||
@@ -318,6 +304,23 @@ choose_device_cb(
|
||||
cgiSetArray("device_location", current_device, device_location);
|
||||
|
||||
current_device ++;
|
||||
|
||||
if (time(NULL) > last_device_time && cgiSupportsMultipart())
|
||||
{
|
||||
/*
|
||||
* Update the page...
|
||||
*/
|
||||
|
||||
if (!last_device_time)
|
||||
cgiStartMultipart();
|
||||
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-device.tmpl");
|
||||
cgiEndHTML();
|
||||
fflush(stdout);
|
||||
|
||||
time(&last_device_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -969,8 +972,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
if (isalnum(*uriptr & 255) || *uriptr == '_' || *uriptr == '-' ||
|
||||
*uriptr == '.')
|
||||
*tptr++ = *uriptr;
|
||||
else if ((*uriptr == ' ' || *uriptr == '/') && tptr > template &&
|
||||
tptr[-1] != '_')
|
||||
else if ((*uriptr == ' ' || *uriptr == '/') && tptr[-1] != '_')
|
||||
*tptr++ = '_';
|
||||
else if (*uriptr == '?' || *uriptr == '(')
|
||||
break;
|
||||
@@ -999,28 +1001,31 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan for devices for up to 30 seconds...
|
||||
* Scan for devices for up to 30 seconds, updating the page as we find
|
||||
* them...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Getting list of devices...\n", stderr);
|
||||
|
||||
current_device = 0;
|
||||
last_device_time = 0;
|
||||
current_device = 0;
|
||||
if (cupsGetDevices(http, 30, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
|
||||
(cups_device_cb_t)choose_device_cb,
|
||||
(void *)title) == IPP_OK)
|
||||
{
|
||||
fputs("DEBUG: Got device list!\n", stderr);
|
||||
|
||||
if (cgiSupportsMultipart())
|
||||
cgiStartMultipart();
|
||||
if (!cgiSupportsMultipart())
|
||||
{
|
||||
/*
|
||||
* Non-modern browsers that don't support multi-part documents get
|
||||
* everything at the end...
|
||||
*/
|
||||
|
||||
cgiSetVariable("CUPS_GET_DEVICES_DONE", "1");
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-device.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
if (cgiSupportsMultipart())
|
||||
cgiEndMultipart();
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-device.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1041,6 +1046,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the final selection page...
|
||||
*/
|
||||
|
||||
cgiSetVariable("CUPS_GET_DEVICES_DONE", "1");
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("choose-device.tmpl");
|
||||
cgiEndHTML();
|
||||
cgiEndMultipart();
|
||||
}
|
||||
else if (strchr(var, '/') == NULL)
|
||||
{
|
||||
@@ -1106,11 +1121,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
if ((attr = ippFindAttribute(oldinfo, "printer-location",
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
cgiSetVariable("PRINTER_LOCATION", attr->values[0].string.text);
|
||||
|
||||
if ((attr = ippFindAttribute(oldinfo, "printer-is-shared",
|
||||
IPP_TAG_BOOLEAN)) != NULL)
|
||||
cgiSetVariable("PRINTER_IS_SHARED",
|
||||
attr->values[0].boolean ? "1" : "0");
|
||||
}
|
||||
|
||||
cgiCopyTemplateLang("modify-printer.tmpl");
|
||||
@@ -1246,7 +1256,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
* Got the list of PPDs, see if the user has selected a make...
|
||||
*/
|
||||
|
||||
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0 && !modify)
|
||||
if (cgiSetIPPVars(response, NULL, NULL, NULL, 0) == 0)
|
||||
{
|
||||
/*
|
||||
* No PPD files with this make, try again with all makes...
|
||||
@@ -1282,11 +1292,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
cgiStartHTML(title);
|
||||
if (!cgiGetVariable("PPD_MAKE"))
|
||||
cgiSetVariable("PPD_MAKE", cgiGetVariable("CURRENT_MAKE"));
|
||||
if (!modify)
|
||||
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
|
||||
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
|
||||
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
|
||||
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
|
||||
cgiCopyTemplateLang("choose-model.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
@@ -1578,7 +1585,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
#ifdef HAVE_GSSAPI
|
||||
char default_auth_type[255];
|
||||
/* DefaultAuthType value */
|
||||
const char *val; /* Setting value */
|
||||
const char *val; /* Setting value */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
|
||||
@@ -1650,7 +1657,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
strcat(local_protocols, "slp");
|
||||
}
|
||||
#endif /* HAVE_SLP */
|
||||
|
||||
|
||||
if (cgiGetVariable("BROWSE_REMOTE_CUPS"))
|
||||
strcpy(remote_protocols, "cups");
|
||||
else
|
||||
@@ -1903,7 +1910,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
cgiSetVariable("ERROR", strerror(errno));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
|
||||
perror(tempfile);
|
||||
return;
|
||||
}
|
||||
@@ -1915,7 +1922,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
cgiSetVariable("ERROR", strerror(errno));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
|
||||
perror(tempfile);
|
||||
close(tempfd);
|
||||
unlink(tempfile);
|
||||
@@ -3305,16 +3312,11 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
for (option = ppdFirstOption(ppd);
|
||||
option;
|
||||
option = ppdNextOption(ppd))
|
||||
{
|
||||
if ((var = cgiGetVariable(option->keyword)) != NULL)
|
||||
{
|
||||
have_options = 1;
|
||||
ppdMarkOption(ppd, option->keyword, var);
|
||||
fprintf(stderr, "DEBUG: Set %s to %s...\n", option->keyword, var);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "DEBUG: Didn't find %s...\n", option->keyword);
|
||||
}
|
||||
}
|
||||
|
||||
if (!have_options || ppdConflicts(ppd))
|
||||
@@ -3335,7 +3337,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
((ppdattr = ppdFindAttr(ppd, "cupsCommands", NULL)) != NULL &&
|
||||
ppdattr->value && strstr(ppdattr->value, "AutoConfigure")))
|
||||
cgiSetVariable("HAVE_AUTOCONFIGURE", "YES");
|
||||
else
|
||||
else
|
||||
{
|
||||
for (i = 0; i < ppd->num_filters; i ++)
|
||||
if (!strncmp(ppd->filters[i], "application/vnd.cups-postscript", 31))
|
||||
@@ -3421,16 +3423,6 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
cgiSetArray("ckeyword", k, option->keyword);
|
||||
cgiSetArray("ckeytext", k, option->text);
|
||||
|
||||
for (m = 0; m < option->num_choices; m ++)
|
||||
{
|
||||
if (option->choices[m].marked)
|
||||
{
|
||||
cgiSetArray("cchoice", k, option->choices[m].text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
k ++;
|
||||
}
|
||||
|
||||
@@ -3449,7 +3441,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
cgiSetVariable("GROUP", group->text);
|
||||
|
||||
cgiCopyTemplateLang("option-header.tmpl");
|
||||
|
||||
|
||||
for (j = group->num_options, option = group->options;
|
||||
j > 0;
|
||||
j --, option ++)
|
||||
@@ -4093,7 +4085,7 @@ get_option_value(
|
||||
|
||||
snprintf(buffer, bufsize, "Custom.%gx%g%s", width, length, uval);
|
||||
}
|
||||
else if (cupsArrayCount(coption->params) == 1)
|
||||
else if (cupsArrayCount(coption->params) == 1)
|
||||
{
|
||||
cparam = ppdFirstCustomParam(coption);
|
||||
snprintf(keyword, sizeof(keyword), "%s.%s", coption->keyword, cparam->name);
|
||||
|
||||
@@ -33,14 +33,6 @@
|
||||
# include "help-index.h"
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Types...
|
||||
*/
|
||||
@@ -107,10 +99,6 @@ extern void cgiStartMultipart(void);
|
||||
extern int cgiSupportsMultipart(void);
|
||||
extern const char *cgiText(const char *message);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_CGI_H_ */
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,14 +23,6 @@
|
||||
# include <cups/array.h>
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Data structures...
|
||||
*/
|
||||
@@ -76,10 +68,6 @@ extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
|
||||
const char *filename);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_HELP_INDEX_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+2
-6
@@ -333,7 +333,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
|
||||
NULL, job_uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "job-printer-uri");
|
||||
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "job-printer-uri",
|
||||
@@ -926,7 +926,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
|
||||
ishttps ? "https" : "http",
|
||||
userpass, hostname, port, resource);
|
||||
else
|
||||
snprintf(url, urlsize, "%s://%s:%d%s",
|
||||
snprintf(url, urlsize, "%s://%s:%d%s",
|
||||
ishttps ? "https" : "http",
|
||||
hostname, port, resource);
|
||||
}
|
||||
@@ -1518,11 +1518,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
if (dest)
|
||||
{
|
||||
snprintf(val, sizeof(val), "/%s/%s", section, dest);
|
||||
cgiSetVariable("PRINTER_NAME", dest);
|
||||
cgiSetVariable("PRINTER_URI_SUPPORTED", val);
|
||||
}
|
||||
else
|
||||
strlcpy(val, "/jobs/", sizeof(val));
|
||||
|
||||
|
||||
+3
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -119,7 +119,7 @@ cgiCopyTemplateLang(const char *tmpl) /* I - Base filename */
|
||||
*locptr = '\0'; /* Strip charset */
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG2: lang=\"%s\", locale=\"%s\"...\n",
|
||||
fprintf(stderr, "DEBUG: lang=\"%s\", locale=\"%s\"...\n",
|
||||
lang ? lang : "(null)", locale);
|
||||
|
||||
/*
|
||||
@@ -437,14 +437,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Test for existance...
|
||||
*/
|
||||
|
||||
if (name[0] == '?')
|
||||
result = cgiGetArray(name + 1, element) != NULL;
|
||||
else if (name[0] == '#')
|
||||
result = cgiGetVariable(name + 1) != NULL;
|
||||
else
|
||||
result = cgiGetArray(name, element) != NULL;
|
||||
|
||||
result = result && outptr[0];
|
||||
result = cgiGetArray(name, element) != NULL && outptr[0];
|
||||
compare[0] = '\0';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -46,7 +46,6 @@ application/x-csource application/postscript 33 texttops
|
||||
application/x-perl application/postscript 33 texttops
|
||||
application/x-shell application/postscript 33 texttops
|
||||
text/plain application/postscript 33 texttops
|
||||
text/css application/postscript 33 texttops
|
||||
text/html application/postscript 33 texttops
|
||||
image/gif application/vnd.cups-postscript 66 imagetops
|
||||
image/png application/vnd.cups-postscript 66 imagetops
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 8938 2009-12-18 23:52:01Z mike $"
|
||||
dnl "$Id: cups-common.m4 8841 2009-10-07 16:24:25Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.4.3"
|
||||
CUPS_VERSION="1.4.2"
|
||||
CUPS_REVISION=""
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
@@ -142,7 +142,7 @@ else
|
||||
fi
|
||||
|
||||
dnl Check for random number functions...
|
||||
AC_CHECK_FUNCS(random lrand48 arc4random)
|
||||
AC_CHECK_FUNCS(random mrand48 lrand48)
|
||||
|
||||
dnl Check for geteuid function.
|
||||
AC_CHECK_FUNCS(geteuid)
|
||||
@@ -262,8 +262,6 @@ if test "x$enable_dbus" != xno; then
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
|
||||
DBUS_NOTIFIER="dbus"
|
||||
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
AC_CHECK_LIB(dbus-1,
|
||||
dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
|
||||
@@ -351,5 +349,5 @@ AC_SUBST(FONTS)
|
||||
AC_SUBST(LEGACY_BACKENDS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 8938 2009-12-18 23:52:01Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 8841 2009-10-07 16:24:25Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 8841 2009-10-07 16:24:25Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
@@ -208,10 +208,6 @@ AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
AC_MSG_RESULT(no password file, using "$CUPS_USER")
|
||||
fi)
|
||||
|
||||
if test "x$CUPS_USER" = "xroot" -o "x$CUPS_USER" = "x0"; then
|
||||
AC_MSG_ERROR([The default user for CUPS cannot be root!])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
@@ -242,10 +238,6 @@ AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
|
||||
fi)
|
||||
|
||||
if test "x$CUPS_GROUP" = "xroot" -o "x$CUPS_GROUP" = "xwheel" -o "x$CUPS_GROUP" = "x0"; then
|
||||
AC_MSG_ERROR([The default group for CUPS cannot be root!])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
|
||||
CUPS_SYSTEM_GROUPS="$withval",
|
||||
if test x$uname = xDarwin; then
|
||||
@@ -277,13 +269,8 @@ AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups
|
||||
fi
|
||||
fi)
|
||||
|
||||
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
|
||||
|
||||
for group in $CUPS_SYSTEM_GROUPS; do
|
||||
if test "x$CUPS_GROUP" = "x$group"; then
|
||||
AC_MSG_ERROR([The default system groups cannot contain the default CUPS group!])
|
||||
fi
|
||||
done
|
||||
CUPS_PRIMARY_SYSTEM_GROUP="`echo $CUPS_SYSTEM_GROUPS | awk '{print $1}'`"
|
||||
|
||||
AC_SUBST(CUPS_USER)
|
||||
AC_SUBST(CUPS_GROUP)
|
||||
@@ -448,5 +435,5 @@ AC_SUBST(BANNERTOPS)
|
||||
AC_SUBST(TEXTTOPS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 8841 2009-10-07 16:24:25Z mike $".
|
||||
dnl
|
||||
|
||||
+1
-15
@@ -586,24 +586,10 @@
|
||||
* Which random number generator function to use...
|
||||
*/
|
||||
|
||||
#undef HAVE_ARC4RANDOM
|
||||
#undef HAVE_RANDOM
|
||||
#undef HAVE_MRAND48
|
||||
#undef HAVE_LRAND48
|
||||
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
# define CUPS_RAND() arc4random()
|
||||
# define CUPS_SRAND(v) arc4random_stir()
|
||||
#elif defined(HAVE_RANDOM)
|
||||
# define CUPS_RAND() random()
|
||||
# define CUPS_SRAND(v) srandom(v)
|
||||
#elif defined(HAVE_LRAND48)
|
||||
# define CUPS_RAND() lrand48()
|
||||
# define CUPS_SRAND(v) srand48(v)
|
||||
#else
|
||||
# define CUPS_RAND() rand()
|
||||
# define CUPS_SRAND(v) srand(v)
|
||||
#endif /* HAVE_ARC4RANDOM */
|
||||
|
||||
|
||||
/*
|
||||
* Do we have vproc_transaction_begin/end?
|
||||
|
||||
@@ -26,14 +26,6 @@
|
||||
# include "versioning.h"
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
@@ -65,10 +57,6 @@ extern void cupsBackendReport(const char *device_scheme,
|
||||
_CUPS_API_1_4;
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_BACKEND_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+1
-5
@@ -583,13 +583,9 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
|
||||
* Clear all conflicts...
|
||||
*/
|
||||
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
for (o = ppdFirstOption(ppd); o; o = ppdNextOption(ppd))
|
||||
o->conflicted = 0;
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
|
||||
/*
|
||||
* Test for conflicts...
|
||||
*/
|
||||
@@ -645,7 +641,7 @@ ppdInstallableConflict(
|
||||
DEBUG_printf(("2ppdInstallableConflict(ppd=%p, option=\"%s\", choice=\"%s\")",
|
||||
ppd, option, choice));
|
||||
|
||||
/*
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
|
||||
+2
-2
@@ -59,10 +59,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0403
|
||||
# define CUPS_VERSION 1.0402
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 4
|
||||
# define CUPS_VERSION_PATCH 3
|
||||
# define CUPS_VERSION_PATCH 2
|
||||
|
||||
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
|
||||
# define CUPS_DATE_ANY (time_t)-1
|
||||
|
||||
+4
-11
@@ -33,6 +33,7 @@
|
||||
* server.
|
||||
* appleCopyLocations() - Copy the location history array.
|
||||
* appleCopyNetwork() - Get the network ID for the current location.
|
||||
* appleGetDefault() - Get the default printer for this location.
|
||||
* appleGetPaperSize() - Get the default paper size.
|
||||
* appleGetPrinter() - Get a printer from the history array.
|
||||
* appleSetDefault() - Set the default printer for this location.
|
||||
@@ -138,17 +139,12 @@ cupsAddDest(const char *name, /* I - Destination name */
|
||||
|
||||
if (!cupsGetDest(name, instance, num_dests, *dests))
|
||||
{
|
||||
if (instance && !cupsGetDest(name, NULL, num_dests, *dests))
|
||||
if (instance &&
|
||||
(parent = cupsGetDest(name, NULL, num_dests, *dests)) == NULL)
|
||||
return (num_dests);
|
||||
|
||||
dest = cups_add_dest(name, instance, &num_dests, dests);
|
||||
|
||||
/*
|
||||
* Find the base dest again now the array has been realloc'd.
|
||||
*/
|
||||
|
||||
parent = cupsGetDest(name, NULL, num_dests, *dests);
|
||||
|
||||
if (instance && parent && parent->num_options > 0)
|
||||
{
|
||||
/*
|
||||
@@ -553,7 +549,7 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
|
||||
if (!cups_get_sdests(http, op, name, 0, &dest))
|
||||
{
|
||||
if (op == CUPS_GET_DEFAULT || name)
|
||||
if (op == CUPS_GET_DEFAULT)
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
@@ -1292,9 +1288,6 @@ appleUseLastPrinter(void)
|
||||
CFPropertyListRef uselast; /* Use last printer preference value */
|
||||
|
||||
|
||||
if (getenv("CUPS_DISABLE_APPLE_DEFAULT"))
|
||||
return (0);
|
||||
|
||||
if ((uselast = CFPreferencesCopyAppValue(kUseLastPrinterAsCurrentPrinterKey,
|
||||
kPMPrintingPreferences)) != NULL)
|
||||
{
|
||||
|
||||
@@ -772,7 +772,6 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
if (section == PPD_ORDER_JCL)
|
||||
{
|
||||
if (!strcasecmp(choices[i]->choice, "Custom") &&
|
||||
choices[i]->code &&
|
||||
(coption = ppdFindCustomOption(ppd, choices[i]->option->keyword))
|
||||
!= NULL)
|
||||
{
|
||||
|
||||
+10
-34
@@ -38,44 +38,20 @@
|
||||
static void
|
||||
cups_env_init(_cups_globals_t *g) /* I - Global data */
|
||||
{
|
||||
#ifdef HAVE_GETEUID
|
||||
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
|
||||
#else
|
||||
if (!getuid())
|
||||
#endif /* HAVE_GETEUID */
|
||||
{
|
||||
/*
|
||||
* When running setuid/setgid, don't allow environment variables to override
|
||||
* the directories...
|
||||
*/
|
||||
if ((g->cups_datadir = getenv("CUPS_DATADIR")) == NULL)
|
||||
g->cups_datadir = CUPS_DATADIR;
|
||||
|
||||
g->cups_datadir = CUPS_DATADIR;
|
||||
g->cups_serverbin = CUPS_SERVERBIN;
|
||||
if ((g->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
|
||||
g->cups_serverbin = CUPS_SERVERBIN;
|
||||
|
||||
if ((g->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL)
|
||||
g->cups_serverroot = CUPS_SERVERROOT;
|
||||
g->cups_statedir = CUPS_STATEDIR;
|
||||
g->localedir = CUPS_LOCALEDIR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Allow directories to be overridden by environment variables.
|
||||
*/
|
||||
|
||||
if ((g->cups_datadir = getenv("CUPS_DATADIR")) == NULL)
|
||||
g->cups_datadir = CUPS_DATADIR;
|
||||
if ((g->cups_statedir = getenv("CUPS_STATEDIR")) == NULL)
|
||||
g->cups_statedir = CUPS_STATEDIR;
|
||||
|
||||
if ((g->cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
|
||||
g->cups_serverbin = CUPS_SERVERBIN;
|
||||
|
||||
if ((g->cups_serverroot = getenv("CUPS_SERVERROOT")) == NULL)
|
||||
g->cups_serverroot = CUPS_SERVERROOT;
|
||||
|
||||
if ((g->cups_statedir = getenv("CUPS_STATEDIR")) == NULL)
|
||||
g->cups_statedir = CUPS_STATEDIR;
|
||||
|
||||
if ((g->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
g->localedir = CUPS_LOCALEDIR;
|
||||
}
|
||||
if ((g->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
g->localedir = CUPS_LOCALEDIR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+16
-73
@@ -26,6 +26,7 @@
|
||||
* httpClearCookie() - Clear the cookie value(s).
|
||||
* httpClearFields() - Clear HTTP request fields.
|
||||
* httpClose() - Close an HTTP connection...
|
||||
* httpConnect() - Connect to a HTTP server.
|
||||
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
|
||||
* _httpCreate() - Create an unconnected HTTP connection.
|
||||
* httpDelete() - Send a DELETE request to the server.
|
||||
@@ -720,7 +721,7 @@ httpGetField(http_t *http, /* I - Connection to server */
|
||||
{
|
||||
if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
|
||||
return (NULL);
|
||||
else if (field == HTTP_FIELD_AUTHORIZATION &&
|
||||
else if (field == HTTP_FIELD_AUTHORIZATION &&
|
||||
http->field_authorization)
|
||||
{
|
||||
/*
|
||||
@@ -1136,7 +1137,7 @@ httpGets(char *line, /* I - Line to read into */
|
||||
http->activity = time(NULL);
|
||||
|
||||
*lineptr = '\0';
|
||||
|
||||
|
||||
DEBUG_printf(("3httpGets: Returning \"%s\"", line));
|
||||
|
||||
return (line);
|
||||
@@ -2282,7 +2283,7 @@ httpWait(http_t *http, /* I - Connection to server */
|
||||
*
|
||||
* @deprecated@
|
||||
*/
|
||||
|
||||
|
||||
int /* O - Number of bytes written */
|
||||
httpWrite(http_t *http, /* I - Connection to server */
|
||||
const char *buffer, /* I - Buffer for data */
|
||||
@@ -2297,7 +2298,7 @@ httpWrite(http_t *http, /* I - Connection to server */
|
||||
*
|
||||
* @since CUPS 1.2/Mac OS X 10.5@
|
||||
*/
|
||||
|
||||
|
||||
ssize_t /* O - Number of bytes written */
|
||||
httpWrite2(http_t *http, /* I - Connection to server */
|
||||
const char *buffer, /* I - Buffer for data */
|
||||
@@ -2455,7 +2456,7 @@ _httpWriteCDSA(
|
||||
else
|
||||
{
|
||||
*dataLength = 0;
|
||||
|
||||
|
||||
if (errno == EAGAIN)
|
||||
result = errSSLWouldBlock;
|
||||
else
|
||||
@@ -2516,7 +2517,7 @@ http_bio_ctrl(BIO *h, /* I - BIO data */
|
||||
}
|
||||
else
|
||||
return (0);
|
||||
|
||||
|
||||
case BIO_CTRL_DUP :
|
||||
case BIO_CTRL_FLUSH :
|
||||
return (1);
|
||||
@@ -2718,36 +2719,7 @@ http_read_ssl(http_t *http, /* I - Connection to server */
|
||||
return (SSL_read((SSL *)(http->tls), buf, len));
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
ssize_t result; /* Return value */
|
||||
|
||||
|
||||
result = gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len);
|
||||
|
||||
if (result < 0 && !errno)
|
||||
{
|
||||
/*
|
||||
* Convert GNU TLS error to errno value...
|
||||
*/
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case GNUTLS_E_INTERRUPTED :
|
||||
errno = EINTR;
|
||||
break;
|
||||
|
||||
case GNUTLS_E_AGAIN :
|
||||
errno = EAGAIN;
|
||||
break;
|
||||
|
||||
default :
|
||||
errno = EPIPE;
|
||||
break;
|
||||
}
|
||||
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return ((int)result);
|
||||
return (gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len));
|
||||
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
int result; /* Return value */
|
||||
@@ -2885,7 +2857,7 @@ http_send(http_t *http, /* I - Connection to server */
|
||||
DEBUG_printf(("9http_send: %s: %s", http_fields[i],
|
||||
httpGetField(http, i)));
|
||||
|
||||
if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
|
||||
if (httpPrintf(http, "%s: %s\r\n", http_fields[i],
|
||||
httpGetField(http, i)) < 1)
|
||||
{
|
||||
http->status = HTTP_ERROR;
|
||||
@@ -2924,15 +2896,15 @@ http_send(http_t *http, /* I - Connection to server */
|
||||
* The Kerberos and AuthRef authentication strings can only be used once...
|
||||
*/
|
||||
|
||||
if (http->field_authorization && http->authstring &&
|
||||
(!strncmp(http->authstring, "Negotiate", 9) ||
|
||||
if (http->field_authorization && http->authstring &&
|
||||
(!strncmp(http->authstring, "Negotiate", 9) ||
|
||||
!strncmp(http->authstring, "AuthRef", 7)))
|
||||
{
|
||||
http->_authstring[0] = '\0';
|
||||
|
||||
if (http->authstring != http->_authstring)
|
||||
free(http->authstring);
|
||||
|
||||
|
||||
http->authstring = http->_authstring;
|
||||
}
|
||||
|
||||
@@ -3248,7 +3220,7 @@ http_upgrade(http_t *http) /* I - Connection to server */
|
||||
/*
|
||||
* 'http_write()' - Write a buffer to a HTTP connection.
|
||||
*/
|
||||
|
||||
|
||||
static int /* O - Number of bytes written */
|
||||
http_write(http_t *http, /* I - Connection to server */
|
||||
const char *buffer, /* I - Buffer for data */
|
||||
@@ -3363,36 +3335,7 @@ http_write_ssl(http_t *http, /* I - Connection to server */
|
||||
return (SSL_write((SSL *)(http->tls), buf, len));
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
ssize_t result; /* Return value */
|
||||
|
||||
result = gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len);
|
||||
|
||||
if (result < 0 && !errno)
|
||||
{
|
||||
/*
|
||||
* Convert GNU TLS error to errno value...
|
||||
*/
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case GNUTLS_E_INTERRUPTED :
|
||||
errno = EINTR;
|
||||
break;
|
||||
|
||||
case GNUTLS_E_AGAIN :
|
||||
errno = EAGAIN;
|
||||
break;
|
||||
|
||||
default :
|
||||
errno = EPIPE;
|
||||
break;
|
||||
}
|
||||
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return ((int)result);
|
||||
|
||||
return (gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len));
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
int result; /* Return value */
|
||||
OSStatus error; /* Error info */
|
||||
@@ -3415,11 +3358,11 @@ http_write_ssl(http_t *http, /* I - Connection to server */
|
||||
else
|
||||
{
|
||||
result = -1;
|
||||
errno = EINTR;
|
||||
errno = EINTR;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
errno = EPIPE;
|
||||
errno = EPIPE;
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
+7
-29
@@ -842,8 +842,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
if (!strcasecmp(option, "AP_D_InputSlot"))
|
||||
{
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
|
||||
{
|
||||
key.option = o;
|
||||
@@ -853,21 +851,13 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
cupsArrayRemove(ppd->marked, oldc);
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for custom options...
|
||||
*/
|
||||
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
o = ppdFindOption(ppd, option);
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
|
||||
if (!o)
|
||||
if ((o = ppdFindOption(ppd, option)) == NULL)
|
||||
return;
|
||||
|
||||
loc = localeconv();
|
||||
@@ -922,15 +912,15 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
if (units)
|
||||
{
|
||||
if (!strcasecmp(units, "cm"))
|
||||
cparam->current.custom_points *= 72.0f / 2.54f;
|
||||
cparam->current.custom_points *= 72.0f / 2.54f;
|
||||
else if (!strcasecmp(units, "mm"))
|
||||
cparam->current.custom_points *= 72.0f / 25.4f;
|
||||
cparam->current.custom_points *= 72.0f / 25.4f;
|
||||
else if (!strcasecmp(units, "m"))
|
||||
cparam->current.custom_points *= 72.0f / 0.0254f;
|
||||
cparam->current.custom_points *= 72.0f / 0.0254f;
|
||||
else if (!strcasecmp(units, "in"))
|
||||
cparam->current.custom_points *= 72.0f;
|
||||
cparam->current.custom_points *= 72.0f;
|
||||
else if (!strcasecmp(units, "ft"))
|
||||
cparam->current.custom_points *= 12.0f * 72.0f;
|
||||
cparam->current.custom_points *= 12.0f * 72.0f;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1070,8 +1060,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
* appropriate...
|
||||
*/
|
||||
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
if (!strcasecmp(option, "PageSize"))
|
||||
{
|
||||
if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
|
||||
@@ -1096,8 +1084,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
}
|
||||
else if (!strcasecmp(option, "InputSlot"))
|
||||
{
|
||||
@@ -1105,8 +1091,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
* Unmark ManualFeed option...
|
||||
*/
|
||||
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
if ((o = ppdFindOption(ppd, "ManualFeed")) != NULL)
|
||||
{
|
||||
key.option = o;
|
||||
@@ -1116,8 +1100,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
cupsArrayRemove(ppd->marked, oldc);
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
}
|
||||
else if (!strcasecmp(option, "ManualFeed") &&
|
||||
!strcasecmp(choice, "True"))
|
||||
@@ -1126,8 +1108,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
* Unmark InputSlot option...
|
||||
*/
|
||||
|
||||
cupsArraySave(ppd->options);
|
||||
|
||||
if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
|
||||
{
|
||||
key.option = o;
|
||||
@@ -1137,8 +1117,6 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
cupsArrayRemove(ppd->marked, oldc);
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayRestore(ppd->options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1219,7 +1197,7 @@ ppd_mark_size(ppd_file_t *ppd, /* I - PPD file */
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
return;
|
||||
|
||||
/*
|
||||
* Search the PPD file for a matching size...
|
||||
|
||||
+13
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Page size functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -250,9 +250,6 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Figure out the current minimum width and length...
|
||||
*/
|
||||
|
||||
width = ppd->custom_min[0];
|
||||
length = ppd->custom_min[1];
|
||||
|
||||
if (qualifier2)
|
||||
{
|
||||
/*
|
||||
@@ -280,13 +277,18 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
|
||||
attr = ppdFindAttr(ppd, "cupsMinSize", spec);
|
||||
}
|
||||
|
||||
if ((attr && attr->value &&
|
||||
sscanf(attr->value, "%f%f", &width, &length) != 2) || !attr)
|
||||
if (!attr ||
|
||||
(attr->value && sscanf(attr->value, "%f%f", &width, &length) != 2))
|
||||
{
|
||||
width = ppd->custom_min[0];
|
||||
length = ppd->custom_min[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
width = ppd->custom_min[0];
|
||||
length = ppd->custom_min[1];
|
||||
}
|
||||
|
||||
minimum->width = width;
|
||||
minimum->length = length;
|
||||
@@ -299,9 +301,6 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Figure out the current maximum width and length...
|
||||
*/
|
||||
|
||||
width = ppd->custom_max[0];
|
||||
length = ppd->custom_max[1];
|
||||
|
||||
if (qualifier2)
|
||||
{
|
||||
/*
|
||||
@@ -336,6 +335,11 @@ ppdPageSizeLimits(ppd_file_t *ppd, /* I - PPD file record */
|
||||
length = ppd->custom_max[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
width = ppd->custom_max[0];
|
||||
length = ppd->custom_max[1];
|
||||
}
|
||||
|
||||
maximum->width = width;
|
||||
maximum->length = length;
|
||||
|
||||
+2
-35
@@ -352,13 +352,11 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */
|
||||
_("Illegal option keyword string"),
|
||||
_("Illegal translation string"),
|
||||
_("Illegal whitespace character"),
|
||||
_("Bad custom parameter"),
|
||||
_("Missing option keyword"),
|
||||
_("Bad value string")
|
||||
_("Bad custom parameter")
|
||||
};
|
||||
|
||||
|
||||
if (status < PPD_OK || status >= PPD_MAX_STATUS)
|
||||
if (status < PPD_OK || status > PPD_ILLEGAL_WHITESPACE)
|
||||
return (_cupsLangString(cupsLangDefault(), _("Unknown")));
|
||||
else
|
||||
return (_cupsLangString(cupsLangDefault(), messages[status]));
|
||||
@@ -1179,37 +1177,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
}
|
||||
else if (!strcmp(keyword, "JobPatchFile"))
|
||||
{
|
||||
/*
|
||||
* CUPS STR #3421: Check for "*JobPatchFile: int: string"
|
||||
*/
|
||||
|
||||
if (isdigit(*string & 255))
|
||||
{
|
||||
for (sptr = string + 1; isdigit(*sptr & 255); sptr ++);
|
||||
|
||||
if (*sptr == ':')
|
||||
{
|
||||
/*
|
||||
* Found "*JobPatchFile: int: string"...
|
||||
*/
|
||||
|
||||
cg->ppd_status = PPD_BAD_VALUE;
|
||||
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!name[0])
|
||||
{
|
||||
/*
|
||||
* Found "*JobPatchFile: string"...
|
||||
*/
|
||||
|
||||
cg->ppd_status = PPD_MISSING_OPTION_KEYWORD;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (ppd->patches == NULL)
|
||||
ppd->patches = strdup(string);
|
||||
else
|
||||
|
||||
+1
-4
@@ -115,10 +115,7 @@ typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19/Mac OS X 10.3@
|
||||
PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string */
|
||||
PPD_ILLEGAL_TRANSLATION, /* Illegal translation string */
|
||||
PPD_ILLEGAL_WHITESPACE, /* Illegal whitespace character */
|
||||
PPD_BAD_CUSTOM_PARAM, /* Bad custom parameter */
|
||||
PPD_MISSING_OPTION_KEYWORD, /* Missing option keyword */
|
||||
PPD_BAD_VALUE, /* Bad value string */
|
||||
PPD_MAX_STATUS /* @private@ */
|
||||
PPD_BAD_CUSTOM_PARAM /* Bad custom parameter */
|
||||
} ppd_status_t;
|
||||
|
||||
enum ppd_conform_e /**** Conformance Levels @since CUPS 1.1.19/Mac OS X 10.3@ ****/
|
||||
|
||||
+25
-18
@@ -116,7 +116,6 @@ cupsSideChannelRead(
|
||||
char buffer[16388]; /* Message buffer */
|
||||
int bytes; /* Bytes read */
|
||||
int templen; /* Data length from message */
|
||||
int nfds; /* Number of file descriptors */
|
||||
#ifdef HAVE_POLL
|
||||
struct pollfd pfd; /* Poll structure for poll() */
|
||||
#else /* select() */
|
||||
@@ -144,30 +143,38 @@ cupsSideChannelRead(
|
||||
pfd.fd = CUPS_SC_FD;
|
||||
pfd.events = POLLIN;
|
||||
|
||||
while ((nfds = poll(&pfd, 1,
|
||||
timeout < 0.0 ? -1 : (long)(timeout * 1000))) < 0 &&
|
||||
(errno == EINTR || errno == EAGAIN))
|
||||
;
|
||||
if (timeout < 0.0)
|
||||
{
|
||||
if (poll(&pfd, 1, -1) < 1)
|
||||
return (-1);
|
||||
}
|
||||
else if (poll(&pfd, 1, (long)(timeout * 1000)) < 1)
|
||||
return (-1);
|
||||
|
||||
#else /* select() */
|
||||
FD_ZERO(&input_set);
|
||||
FD_SET(CUPS_SC_FD, &input_set);
|
||||
|
||||
stimeout.tv_sec = (int)timeout;
|
||||
stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
|
||||
|
||||
while ((nfds = select(CUPS_SC_FD + 1, &input_set, NULL, NULL,
|
||||
timeout < 0.0 ? NULL : &stimeout)) < 0 &&
|
||||
(errno == EINTR || errno == EAGAIN))
|
||||
;
|
||||
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
if (nfds < 1)
|
||||
if (timeout < 0.0)
|
||||
{
|
||||
*status = nfds==0 ? CUPS_SC_STATUS_TIMEOUT : CUPS_SC_STATUS_IO_ERROR;
|
||||
return (-1);
|
||||
if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, NULL) < 1)
|
||||
{
|
||||
DEBUG_printf(("1cupsSideChannelRead: Select error: %s", strerror(errno)));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stimeout.tv_sec = (int)timeout;
|
||||
stimeout.tv_usec = (int)(timeout * 1000000) % 1000000;
|
||||
|
||||
if (select(CUPS_SC_FD + 1, &input_set, NULL, NULL, &stimeout) < 1)
|
||||
{
|
||||
DEBUG_puts("1cupsSideChannelRead: Select timeout");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
/*
|
||||
* Read a side-channel message for the format:
|
||||
|
||||
+7
-27
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SNMP functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -89,14 +89,14 @@ static char *asn1_get_string(unsigned char **buffer,
|
||||
unsigned char *bufend,
|
||||
int length, char *string,
|
||||
int strsize);
|
||||
static unsigned asn1_get_length(unsigned char **buffer,
|
||||
static int asn1_get_length(unsigned char **buffer,
|
||||
unsigned char *bufend);
|
||||
static int asn1_get_type(unsigned char **buffer,
|
||||
unsigned char *bufend);
|
||||
static void asn1_set_integer(unsigned char **buffer,
|
||||
int integer);
|
||||
static void asn1_set_length(unsigned char **buffer,
|
||||
unsigned length);
|
||||
int length);
|
||||
static void asn1_set_oid(unsigned char **buffer,
|
||||
const int *oid);
|
||||
static void asn1_set_packed(unsigned char **buffer,
|
||||
@@ -1286,12 +1286,6 @@ asn1_get_integer(
|
||||
int value; /* Integer value */
|
||||
|
||||
|
||||
if (length > sizeof(int))
|
||||
{
|
||||
(*buffer) += length;
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (value = (**buffer & 0x80) ? -1 : 0;
|
||||
length > 0 && *buffer < bufend;
|
||||
length --, (*buffer) ++)
|
||||
@@ -1305,32 +1299,18 @@ asn1_get_integer(
|
||||
* 'asn1_get_length()' - Get a value length.
|
||||
*/
|
||||
|
||||
static unsigned /* O - Length */
|
||||
static int /* O - Length */
|
||||
asn1_get_length(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
unsigned char *bufend) /* I - End of buffer */
|
||||
{
|
||||
unsigned length; /* Length */
|
||||
int length; /* Length */
|
||||
|
||||
|
||||
length = **buffer;
|
||||
(*buffer) ++;
|
||||
|
||||
if (length & 128)
|
||||
{
|
||||
int count; /* Number of bytes for length */
|
||||
|
||||
|
||||
if ((count = length & 127) > sizeof(unsigned))
|
||||
{
|
||||
(*buffer) += count;
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (length = 0;
|
||||
count > 0 && *buffer < bufend;
|
||||
count --, (*buffer) ++)
|
||||
length = (length << 8) | **buffer;
|
||||
}
|
||||
length = asn1_get_integer(buffer, bufend, length & 127);
|
||||
|
||||
return (length);
|
||||
}
|
||||
@@ -1549,7 +1529,7 @@ asn1_set_integer(unsigned char **buffer,/* IO - Pointer in buffer */
|
||||
|
||||
static void
|
||||
asn1_set_length(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
unsigned length) /* I - Length value */
|
||||
int length) /* I - Length value */
|
||||
{
|
||||
if (length > 255)
|
||||
{
|
||||
|
||||
+2
-2
@@ -118,8 +118,8 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */
|
||||
* Format a string using the hex time values...
|
||||
*/
|
||||
|
||||
snprintf(filename, len - 1, "%s/%05x%08x", tmpdir, (unsigned)getpid(),
|
||||
(unsigned)(curtime.tv_sec + curtime.tv_usec + tries));
|
||||
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
|
||||
(unsigned long)curtime.tv_sec, (unsigned long)curtime.tv_usec);
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
*Throughput: "1"
|
||||
*LandscapeOrientation: Plus90
|
||||
*TTRasterizer: Type42
|
||||
*cupsFilter: "application/vnd.cups-raster 0 -"
|
||||
*cupsFilter: "application/vnd.cups-raster - 0"
|
||||
*RequiresPageRegion All: True
|
||||
|
||||
*% These constraints are used to test ppdConflicts() and cupsResolveConflicts()
|
||||
|
||||
+8
-4
@@ -375,9 +375,9 @@ random_tests(void)
|
||||
fputs("cupsFileSeek(), cupsFileRead(): ", stdout);
|
||||
|
||||
for (num_records = (pass + 1) * 256, count = (pass + 1) * 256,
|
||||
record = CUPS_RAND() % num_records;
|
||||
record = rand() % num_records;
|
||||
count > 0;
|
||||
count --, record = (record + (CUPS_RAND() & 31) - 16 + num_records) %
|
||||
count --, record = (record + (rand() & 31) - 16 + num_records) %
|
||||
num_records)
|
||||
{
|
||||
/*
|
||||
@@ -471,10 +471,14 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
* Initialize the write buffer with random data...
|
||||
*/
|
||||
|
||||
CUPS_SRAND(time(NULL));
|
||||
#ifdef WIN32
|
||||
srand((unsigned)time(NULL));
|
||||
#else
|
||||
srand(time(NULL));
|
||||
#endif /* WIN32 */
|
||||
|
||||
for (i = 0; i < (int)sizeof(writebuf); i ++)
|
||||
writebuf[i] = CUPS_RAND();
|
||||
writebuf[i] = rand();
|
||||
|
||||
/*
|
||||
* cupsFileOpen(write)
|
||||
|
||||
+15
-60
@@ -570,17 +570,17 @@ cupsGetJobs2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_D
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
static const char * const attrs[] = /* Requested attributes */
|
||||
{
|
||||
"document-format",
|
||||
"job-id",
|
||||
"job-k-octets",
|
||||
"job-name",
|
||||
"job-originating-user-name",
|
||||
"job-printer-uri",
|
||||
"job-priority",
|
||||
"job-k-octets",
|
||||
"job-state",
|
||||
"time-at-completed",
|
||||
"time-at-creation",
|
||||
"time-at-processing"
|
||||
"time-at-processing",
|
||||
"job-printer-uri",
|
||||
"document-format",
|
||||
"job-name",
|
||||
"job-originating-user-name"
|
||||
};
|
||||
|
||||
|
||||
@@ -1456,9 +1456,6 @@ cupsPrintFiles2(
|
||||
char buffer[8192]; /* Copy buffer */
|
||||
ssize_t bytes; /* Bytes in buffer */
|
||||
http_status_t status; /* Status of write */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
ipp_status_t cancel_status; /* Status code to preserve */
|
||||
char *cancel_message; /* Error message to preserve */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsPrintFiles2(http=%p, name=\"%s\", num_files=%d, "
|
||||
@@ -1510,40 +1507,16 @@ cupsPrintFiles2(
|
||||
* Unable to open print file, cancel the job and return...
|
||||
*/
|
||||
|
||||
_cupsSetError(IPP_DOCUMENT_ACCESS_ERROR, NULL, 0);
|
||||
goto cancel_job;
|
||||
cupsCancelJob2(http, name, job_id, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
cupsFileRewind(fp);
|
||||
status = cupsStartDocument(http, name, job_id, docname, format,
|
||||
i == (num_files - 1));
|
||||
|
||||
status = cupsStartDocument(http, name, job_id, docname, format,
|
||||
i == (num_files - 1));
|
||||
|
||||
while (status == HTTP_CONTINUE &&
|
||||
(bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
|
||||
status = cupsWriteRequestData(http, buffer, bytes);
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
char resource[1024]; /* Printer resource */
|
||||
|
||||
snprintf(resource, sizeof(resource), "/printers/%s", name);
|
||||
|
||||
if (!cupsDoAuthentication(http, "POST", resource))
|
||||
{
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
else
|
||||
status = HTTP_AUTHORIZATION_CANCELED;
|
||||
}
|
||||
}
|
||||
while (status == HTTP_UNAUTHORIZED);
|
||||
while (status == HTTP_CONTINUE &&
|
||||
(bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
|
||||
status = cupsWriteRequestData(http, buffer, bytes);
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
@@ -1553,30 +1526,12 @@ cupsPrintFiles2(
|
||||
* Unable to queue, cancel the job and return...
|
||||
*/
|
||||
|
||||
goto cancel_job;
|
||||
cupsCancelJob2(http, name, job_id, 0);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
return (job_id);
|
||||
|
||||
/*
|
||||
* If we get here, something happened while sending the print job so we need
|
||||
* to cancel the job without setting the last error (since we need to preserve
|
||||
* the current error...
|
||||
*/
|
||||
|
||||
cancel_job:
|
||||
|
||||
cancel_status = cg->last_error;
|
||||
cancel_message = cg->last_status_message ?
|
||||
_cupsStrRetain(cg->last_status_message) : NULL;
|
||||
|
||||
cupsCancelJob2(http, name, job_id, 0);
|
||||
|
||||
cg->last_error = cancel_status;
|
||||
cg->last_status_message = cancel_message;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-5
@@ -27,7 +27,7 @@ P.example {
|
||||
font-style: italic;
|
||||
margin-left: 36pt;
|
||||
}
|
||||
|
||||
|
||||
PRE.example {
|
||||
background: white;
|
||||
border: dotted thin #999999;
|
||||
@@ -238,10 +238,6 @@ H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
|
||||
color: white;
|
||||
}
|
||||
|
||||
TH.conflict {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
H1.title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
|
||||
<TD CLASS="sel"><A HREF="/"> Startseite </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/admin"> Verwaltung </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Klassen </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> Online Hilfe </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> On-Line Hilfe </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Aufträge </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/printers/"> Drucker </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
@@ -31,7 +31,7 @@ AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
|
||||
<H1>Common UNIX Printing System @CUPS_VERSION@</H1>
|
||||
|
||||
<P>CUPS ist das auf Standards basierte, Open-Source Drucker System, welches von
|
||||
<P>CUPS ist das auf Standards basierte, Open-Source Drucker System, welches von
|
||||
<A HREF="http://www.apple.com/">Apple Inc.</A> für Mac OS<SUP>®</SUP> X und
|
||||
andere UNIX<SUP>®</SUP>-ähnliche Betriebssysteme entwickelt wird.</P>
|
||||
|
||||
|
||||
@@ -123,8 +123,7 @@ to the access log file. The following levels are defined:</P>
|
||||
Allow from nnn.nnn.nnn.nnn
|
||||
Allow from nnn.nnn.nnn.nnn/mm
|
||||
Allow from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
|
||||
Allow from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
|
||||
Allow from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]/mmm
|
||||
Allow from xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
|
||||
Allow from @LOCAL
|
||||
Allow from @IF(name)
|
||||
</Location>
|
||||
@@ -1072,8 +1071,7 @@ printers are shared (published) by default. The default is
|
||||
Deny from nnn.nnn.nnn.nnn
|
||||
Deny from nnn.nnn.nnn.nnn/mm
|
||||
Deny from nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
|
||||
Deny from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]
|
||||
Deny from [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]/mmm
|
||||
Deny from xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
|
||||
Deny from @LOCAL
|
||||
Deny from @IF(name)
|
||||
</Location>
|
||||
|
||||
@@ -45,10 +45,10 @@ the page started printing. The format of this field is identical
|
||||
to the <I>data-time</I> field in the <VAR>access_log</VAR>
|
||||
file.</P>
|
||||
|
||||
<P>The <I>page-number</I> and <I>num-copies</I> fields contain the
|
||||
<P>The <I>page-number</I> and <I>num-pages</I> fields contain the
|
||||
page number and number of copies being printed of that page. For
|
||||
printers that cannot produce copies on their own, the
|
||||
<I>num-copies</I> field will always be 1.</P>
|
||||
<I>num-pages</I> field will always be 1.</P>
|
||||
|
||||
<P>The <I>job-billing</I> field contains a copy of the
|
||||
<CODE>job-billing</CODE> attribute provided with the IPP
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 8933 2009-12-16 00:08:31Z mike $"
|
||||
"$Id: spec-ppd.html 8673 2009-05-22 17:34:15Z mike $"
|
||||
|
||||
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
|
||||
|
||||
@@ -161,8 +161,9 @@ based on well-known colorspaces such as sRGB and Adobe RGB.</p>
|
||||
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>At this time, none of the CUPS raster filters support ICC profiles. This
|
||||
will be addressed as time and resources permit.</p>
|
||||
<p>At this time, none of the CUPS raster
|
||||
filters support ICC profiles. This will be addressed as time
|
||||
and resources permit.</p>
|
||||
|
||||
</blockquote>
|
||||
|
||||
@@ -173,7 +174,7 @@ gamma m00 m01 m02 m10 m11 m12 m20 m21 m22"</p>
|
||||
|
||||
<p>This string attribute specifies an sRGB-based color profile
|
||||
consisting of gamma and density controls and a 3x3 CMY color
|
||||
transform matrix. <em>This attribute is not supported on Mac OS X.</em></p>
|
||||
transform matrix.</p>
|
||||
|
||||
<p>The <i>Resolution</i> and <i>MediaType</i> values may be "-"
|
||||
to act as a wildcard. Otherwise they must match one of the
|
||||
@@ -276,15 +277,6 @@ data as requested by the driver. The <tt>APCustomColorMatchingProfile</tt>
|
||||
and <tt>APDefaultColorMatchingProfile</tt> attributes specify alternate
|
||||
color profiles (sRGB or AdobeRGB) to use for 3-color (RGB) raster data.</p>
|
||||
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>Prior to Mac OS X 10.6, the default RGB color space was Apple's "GenericRGB".
|
||||
The new default in Mac OS X 10.6 and later is "sRGB". For more information, see
|
||||
<a href="http://support.apple.com/kb/HT3712">"Mac OS X v10.6: About gamma
|
||||
2.2"</a> on Apple's support site.</p>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4><span class='info'>Mac OS X 10.5</span><a name='APCustomColorMatchingName'>APCustomColorMatchingName</a></h4>
|
||||
|
||||
<p class='summary'>*APCustomColorMatchingName name/text: ""</p>
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Beranda - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE CLASS="page" SUMMARY="{title}">
|
||||
<TR><TD CLASS="body">
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
||||
<TR HEIGHT="36">
|
||||
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
|
||||
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
|
||||
<TD CLASS="sel"><A HREF="/"> Beranda </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/admin"> Administrasi </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Kelas </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> Bantuan Langsung </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Tugas </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/printers/"> Pencetak </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
|
||||
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD STYLE="padding-right: 20px;">
|
||||
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P>CUPS adalah sistem pencetakan berstandar dan berkode sumber terbuka, dikembangkan oleh
|
||||
<A HREF="http://www.apple.com/">Apple Inc.</A> untuk Mac OS<SUP>®</SUP> X dan sistem
|
||||
operasi serupa UNIX<SUP>®</SUP> lainnya.</P>
|
||||
|
||||
</TD>
|
||||
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
|
||||
HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS bagi Pengguna</H2>
|
||||
|
||||
<P><A HREF="help/overview.html">Ikhtisar CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/options.html">Opsi dan Pencetakan dari Baris Perintah</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.4</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum Pengguna</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS bagi Administrator</H2>
|
||||
|
||||
<P><A HREF="admin">Menambah Pencetak dan Kelas</A></P>
|
||||
|
||||
<P><A HREF="help/policies.html">Mengatur Kebijakan Operasi</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Dasar Akunting Pencetak</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Keamanan Server</A></P>
|
||||
|
||||
<P><A HREF="help/kerberos.html">Menggunakan Otentikasi Kerberos</A></P>
|
||||
|
||||
<P><A HREF="help/network.html">Menggunakan Pencetak di Jaringan</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">Referensi cupsd.conf</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/ppd.php">Mencari Penggerak Pencetak</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
|
||||
|
||||
<H2>CUPS bagi Pengembang</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">Pengenalan untuk Pemrograman CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-cups.html">API di CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-filter.html">Penyaring dan Pemrograman Balik (<I>Backend Programming</I>)</A></P>
|
||||
|
||||
<P><A HREF="help/api-httpipp.html">API di HTTP dan IPP</A></P>
|
||||
|
||||
<P><A HREF="help/api-ppd.html">API di PPD</A></P>
|
||||
|
||||
<P><A HREF="help/api-raster.html">API di Raster</A></P>
|
||||
|
||||
<P><A HREF="help/ref-ppdcfile.html">Referensi Kompiler Berkas Penggerak PPD</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Forum Pengembang</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS dan logo CUPS logo adalah merek dagang dari
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2009 Apple
|
||||
Inc. Semua hak terpelihara.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,107 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Home - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE CLASS="page" SUMMARY="{title}">
|
||||
<TR><TD CLASS="body">
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
||||
<TR HEIGHT="36">
|
||||
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
|
||||
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
|
||||
<TD CLASS="sel"><A HREF="/"> Home </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/admin"> Amministrazione </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Classi </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> Guida </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Stampe </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/printers/"> Stampanti </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Aiuto alla ricerca"
|
||||
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD STYLE="padding-right: 20px;">
|
||||
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P>CUPS è un sistema di stampa basato su standard, open source sviluppato da
|
||||
<A HREF="http://www.apple.com/">Apple Inc.</A> per Mac OS<SUP>®</SUP> X e
|
||||
altri sistemi UNIX<SUP>®</SUP> e derivati.</P>
|
||||
|
||||
</TD>
|
||||
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
|
||||
HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS per utenti</H2>
|
||||
|
||||
<P><A HREF="help/overview.html">Panoramica di CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/options.html">Stampa e opzioni da riga di comando</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Cosa c'è di nuovo in CUPS 1.4</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum degli utenti</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS per amministratori</H2>
|
||||
|
||||
<P><A HREF="admin">Aggiungere stampanti e classi</A></P>
|
||||
|
||||
<P><A HREF="help/policies.html">Gestire i criteri di funzionamento</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Basi di controllo di accesso alle stampanti</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Sicurezza del server</A></P>
|
||||
|
||||
<P><A HREF="help/kerberos.html">Utilizzare l'autenticazione Kerberos</A></P>
|
||||
|
||||
<P><A HREF="help/network.html">Utilizzare stampanti di rete</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">Riferimenti al cupsd.conf</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/ppd.php">Trovare driver per le stampanti</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
|
||||
|
||||
<H2>CUPS per sviluppatori</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">Introduzione alla programmazione di CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-cups.html">API di CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-filter.html">Programmazione di filtri e motori</A></P>
|
||||
|
||||
<P><A HREF="help/api-httpipp.html">API HTTP e IPP</A></P>
|
||||
|
||||
<P><A HREF="help/api-ppd.html">API PPD</A></P>
|
||||
|
||||
<P><A HREF="help/api-raster.html">API Raster</A></P>
|
||||
|
||||
<P><A HREF="help/ref-ppdcfile.html">Riferimenti al file del compilatore di driver PPD</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Forum degli sviluppatori</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS e il logo CUPS sono marchi di
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2009 di Apple
|
||||
Inc. Tutti i diritti sono riservati.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+19
-5
@@ -24,7 +24,21 @@
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include <config.h>
|
||||
|
||||
|
||||
/*
|
||||
* Random number function to use, in order of preference...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_RANDOM
|
||||
# define RANDOM_FUNCTION random
|
||||
#elif defined(HAVE_MRAND48)
|
||||
# define RANDOM_FUNCTION mrand48
|
||||
#elif defined(HAVE_LRAND48)
|
||||
# define RANDOM_FUNCTION lrand48
|
||||
#else
|
||||
# define RANDOM_FUNCTION rand
|
||||
#endif /* HAVE_RANDOM */
|
||||
|
||||
|
||||
/*
|
||||
@@ -155,8 +169,8 @@ cupsDitherLine(cups_dither_t *d, /* I - Dither data */
|
||||
|
||||
if (errrange > 1)
|
||||
{
|
||||
errbase0 = errbase + (CUPS_RAND() % errrange);
|
||||
errbase1 = errbase + (CUPS_RAND() % errrange);
|
||||
errbase0 = errbase + (RANDOM_FUNCTION() % errrange);
|
||||
errbase1 = errbase + (RANDOM_FUNCTION() % errrange);
|
||||
}
|
||||
else
|
||||
errbase0 = errbase1 = errbase;
|
||||
@@ -249,8 +263,8 @@ cupsDitherLine(cups_dither_t *d, /* I - Dither data */
|
||||
|
||||
if (errrange > 1)
|
||||
{
|
||||
errbase0 = errbase + (CUPS_RAND() % errrange);
|
||||
errbase1 = errbase + (CUPS_RAND() % errrange);
|
||||
errbase0 = errbase + (RANDOM_FUNCTION() % errrange);
|
||||
errbase1 = errbase + (RANDOM_FUNCTION() % errrange);
|
||||
}
|
||||
else
|
||||
errbase0 = errbase1 = errbase;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMP image routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 1993-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -170,8 +170,6 @@ _cupsImageReadBMP(
|
||||
|
||||
if (colors_used > 0)
|
||||
fread(colormap, colors_used, 4, fp);
|
||||
else
|
||||
memset(colormap, 0, sizeof(colormap));
|
||||
|
||||
/*
|
||||
* Setup image and buffers...
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <cups/raster.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
@@ -276,26 +275,26 @@ write_test(int fd, /* I - File descriptor to write to */
|
||||
* text with some whitespace.
|
||||
*/
|
||||
|
||||
CUPS_SRAND(time(NULL));
|
||||
srand(time(NULL));
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
|
||||
for (y = 0; y < 28; y ++)
|
||||
{
|
||||
for (x = CUPS_RAND() & 127, count = (CUPS_RAND() & 15) + 1;
|
||||
for (x = rand() & 127, count = (rand() & 15) + 1;
|
||||
x < sizeof(data[0]);
|
||||
x ++, count --)
|
||||
{
|
||||
if (count <= 0)
|
||||
{
|
||||
x += (CUPS_RAND() & 15) + 1;
|
||||
count = (CUPS_RAND() & 15) + 1;
|
||||
x += (rand() & 15) + 1;
|
||||
count = (rand() & 15) + 1;
|
||||
|
||||
if (x >= sizeof(data[0]))
|
||||
break;
|
||||
}
|
||||
|
||||
data[y][x] = CUPS_RAND();
|
||||
data[y][x] = rand();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-7095
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+373
-215
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -168,9 +168,6 @@ ppdcCatalog::find_message(
|
||||
ppdcMessage *m; // Current message
|
||||
|
||||
|
||||
if (!*id)
|
||||
return (id);
|
||||
|
||||
for (m = (ppdcMessage *)messages->first();
|
||||
m;
|
||||
m = (ppdcMessage *)messages->next())
|
||||
|
||||
+13
-10
@@ -690,7 +690,7 @@ ppdcDriver::write_ppd_file(
|
||||
for (int i = 0; i < 9; i ++)
|
||||
_cupsStrFormatd(profile[i], profile[i] + sizeof(profile[0]),
|
||||
p->profile[i], loc);
|
||||
|
||||
|
||||
cupsFilePrintf(fp,
|
||||
"*cupsColorProfile %s/%s: \"%s %s %s %s %s %s %s %s %s %s "
|
||||
"%s\"%s", p->resolution->value, p->media_type->value,
|
||||
@@ -1026,7 +1026,7 @@ ppdcDriver::write_ppd_file(
|
||||
if (!o->choices->count)
|
||||
continue;
|
||||
|
||||
if (!o->text->value)
|
||||
if (!o->text->value || !strcmp(o->name->value, o->text->value))
|
||||
cupsFilePrintf(fp, "*OpenUI *%s/%s: ", o->name->value,
|
||||
catalog->find_message(o->name->value));
|
||||
else
|
||||
@@ -1093,9 +1093,9 @@ ppdcDriver::write_ppd_file(
|
||||
c = (ppdcChoice *)o->choices->next())
|
||||
{
|
||||
// Write this choice...
|
||||
if (!c->text->value)
|
||||
cupsFilePrintf(fp, "*%s %s/%s: \"%s\"%s", o->name->value,
|
||||
c->name->value, catalog->find_message(c->name->value),
|
||||
if (!c->text->value || !strcmp(c->name->value, c->text->value))
|
||||
cupsFilePrintf(fp, "*%s %s: \"%s\"%s", o->name->value,
|
||||
catalog->find_message(c->name->value),
|
||||
c->code->value, lf);
|
||||
else
|
||||
cupsFilePrintf(fp, "*%s %s/%s: \"%s\"%s", o->name->value,
|
||||
@@ -1138,11 +1138,10 @@ ppdcDriver::write_ppd_file(
|
||||
if (!a->selector->value || !a->selector->value[0])
|
||||
cupsFilePrintf(fp, "*%s", a->name->value);
|
||||
else if (!a->text->value || !a->text->value[0])
|
||||
cupsFilePrintf(fp, "*%s %s/%s", a->name->value, a->selector->value,
|
||||
catalog->find_message(a->selector->value));
|
||||
cupsFilePrintf(fp, "*%s %s", a->name->value, a->selector->value);
|
||||
else
|
||||
cupsFilePrintf(fp, "*%s %s/%s", a->name->value, a->selector->value,
|
||||
catalog->find_message(a->text->value));
|
||||
a->text->value);
|
||||
|
||||
cupsFilePrintf(fp, ": %s%s", a->value->value, lf);
|
||||
}
|
||||
@@ -1279,8 +1278,12 @@ ppdcDriver::write_ppd_file(
|
||||
// Finally the localizable attributes...
|
||||
for (a = (ppdcAttr *)attrs->first(); a; a = (ppdcAttr *)attrs->next())
|
||||
{
|
||||
if ((!a->text || !a->text->value || !a->text->value[0]) &&
|
||||
strncmp(a->name->value, "Custom", 6) &&
|
||||
strncmp(a->name->value, "ParamCustom", 11))
|
||||
continue;
|
||||
|
||||
if (!a->localizable &&
|
||||
(!a->text || !a->text->value || !a->text->value[0]) &&
|
||||
strcmp(a->name->value, "APCustomColorMatchingName") &&
|
||||
strcmp(a->name->value, "APPrinterPreset") &&
|
||||
strcmp(a->name->value, "cupsICCProfile") &&
|
||||
@@ -1288,7 +1291,7 @@ ppdcDriver::write_ppd_file(
|
||||
strcmp(a->name->value, "cupsMarkerName") &&
|
||||
strncmp(a->name->value, "Custom", 6) &&
|
||||
strncmp(a->name->value, "ParamCustom", 11))
|
||||
continue;
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*%s.%s %s/%s: \"%s\"%s", locale->value,
|
||||
a->name->value, a->selector->value,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// Source class for the CUPS PPD Compiler.
|
||||
//
|
||||
// Copyright 2007-2010 by Apple Inc.
|
||||
// Copyright 2007-2009 by Apple Inc.
|
||||
// Copyright 2002-2007 by Easy Software Products.
|
||||
//
|
||||
// These coded instructions, statements, and computer programs are the
|
||||
@@ -3514,8 +3514,7 @@ ppdcSource::write_file(const char *f) // I - File to write
|
||||
for (d = (ppdcDriver *)drivers->first(); d; d = (ppdcDriver *)drivers->next())
|
||||
{
|
||||
// Start the driver...
|
||||
cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value,
|
||||
d->model_name->value);
|
||||
cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value, d->model_name->value);
|
||||
cupsFilePuts(fp, "{\n");
|
||||
|
||||
// Write the copyright stings...
|
||||
|
||||
+2
-18
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// PPD file compiler main entry for the CUPS PPD Compiler.
|
||||
//
|
||||
// Copyright 2007-2010 by Apple Inc.
|
||||
// Copyright 2007-2008 by Apple Inc.
|
||||
// Copyright 2002-2007 by Easy Software Products.
|
||||
//
|
||||
// These coded instructions, statements, and computer programs are the
|
||||
@@ -52,8 +52,6 @@ main(int argc, // I - Number of command-line arguments
|
||||
char *opt, // Current option
|
||||
*value, // Value in option
|
||||
*outname, // Output filename
|
||||
make_model[1024],
|
||||
// Make and model
|
||||
pcfilename[1024],
|
||||
// Lowercase pcfilename
|
||||
filename[1024]; // PPD filename
|
||||
@@ -313,21 +311,7 @@ main(int argc, // I - Number of command-line arguments
|
||||
{
|
||||
// Write the PPD file for this driver...
|
||||
if (use_model_name)
|
||||
{
|
||||
if (!strncasecmp(d->model_name->value, d->manufacturer->value,
|
||||
strlen(d->manufacturer->value)))
|
||||
{
|
||||
// Model name already starts with the manufacturer...
|
||||
outname = d->model_name->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add manufacturer to the front of the model name...
|
||||
snprintf(make_model, sizeof(make_model), "%s %s",
|
||||
d->manufacturer->value, d->model_name->value);
|
||||
outname = make_model;
|
||||
}
|
||||
}
|
||||
outname = d->model_name->value;
|
||||
else if (d->file_name)
|
||||
outname = d->file_name->value;
|
||||
else
|
||||
|
||||
+8
-10
@@ -4,7 +4,7 @@
|
||||
* Authentication certificate routines for the Common UNIX
|
||||
* Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -71,7 +71,7 @@ cupsdAddCert(int pid, /* I - Process ID */
|
||||
strlcpy(cert->username, username, sizeof(cert->username));
|
||||
|
||||
for (i = 0; i < 32; i ++)
|
||||
cert->certificate[i] = hex[CUPS_RAND() & 15];
|
||||
cert->certificate[i] = hex[random() & 15];
|
||||
|
||||
/*
|
||||
* Save the certificate to a file readable only by the User and Group
|
||||
@@ -390,8 +390,9 @@ cupsdFindCert(const char *certificate) /* I - Certificate */
|
||||
void
|
||||
cupsdInitCerts(void)
|
||||
{
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
cups_file_t *fp; /* /dev/random file */
|
||||
unsigned seed; /* Seed for random number generator */
|
||||
struct timeval tod; /* Time of day */
|
||||
|
||||
|
||||
/*
|
||||
@@ -401,20 +402,16 @@ cupsdInitCerts(void)
|
||||
|
||||
if ((fp = cupsFileOpen("/dev/urandom", "rb")) == NULL)
|
||||
{
|
||||
struct timeval tod; /* Time of day */
|
||||
|
||||
/*
|
||||
* Get the time in usecs and use it as the initial seed...
|
||||
*/
|
||||
|
||||
gettimeofday(&tod, NULL);
|
||||
|
||||
CUPS_SRAND((unsigned)(tod.tv_sec + tod.tv_usec));
|
||||
seed = (unsigned)(tod.tv_sec + tod.tv_usec);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned seed; /* Seed for random number generator */
|
||||
|
||||
/*
|
||||
* Read 4 random characters from the random device and use
|
||||
* them as the seed...
|
||||
@@ -423,11 +420,12 @@ cupsdInitCerts(void)
|
||||
seed = cupsFileGetChar(fp);
|
||||
seed = (seed << 8) | cupsFileGetChar(fp);
|
||||
seed = (seed << 8) | cupsFileGetChar(fp);
|
||||
CUPS_SRAND((seed << 8) | cupsFileGetChar(fp));
|
||||
seed = (seed << 8) | cupsFileGetChar(fp);
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
#endif /* !HVE_ARC4RANDOM */
|
||||
|
||||
srandom(seed);
|
||||
|
||||
/*
|
||||
* Create a root certificate and return...
|
||||
|
||||
+14
-14
@@ -631,7 +631,7 @@ cupsdReadConfiguration(void)
|
||||
MaxClients = 100;
|
||||
MaxClientsPerHost = 0;
|
||||
MaxLogSize = 1024 * 1024;
|
||||
MaxPrinterHistory = 0;
|
||||
MaxPrinterHistory = 10;
|
||||
MaxRequestSize = 0;
|
||||
MultipleOperationTimeout = DEFAULT_TIMEOUT;
|
||||
ReloadTimeout = DEFAULT_KEEPALIVE;
|
||||
@@ -969,7 +969,7 @@ cupsdReadConfiguration(void)
|
||||
Group, 1, 1) < 0 ||
|
||||
cupsdCheckPermissions(StateDir, "certs", RunUser ? 0711 : 0511, User,
|
||||
SystemGroupIDs[0], 1, 1) < 0 ||
|
||||
cupsdCheckPermissions(ServerRoot, NULL, 0755, RunUser,
|
||||
cupsdCheckPermissions(ServerRoot, NULL, 0755, RunUser,
|
||||
Group, 1, 0) < 0 ||
|
||||
cupsdCheckPermissions(ServerRoot, "ppd", 0755, RunUser,
|
||||
Group, 1, 1) < 0 ||
|
||||
@@ -1896,7 +1896,7 @@ parse_aaa(cupsd_location_t *loc, /* I - Location */
|
||||
cupsdDenyIP(loc, ones, zeros);
|
||||
}
|
||||
#ifdef AF_INET6
|
||||
else if (value[0] == '*' || value[0] == '.' ||
|
||||
else if (value[0] == '*' || value[0] == '.' ||
|
||||
(!isdigit(value[0] & 255) && value[0] != '['))
|
||||
#else
|
||||
else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
|
||||
@@ -2666,7 +2666,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
|
||||
for (addr = addrlist; addr; addr = addr->next)
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
break;
|
||||
break;
|
||||
|
||||
if (addr)
|
||||
{
|
||||
@@ -2676,7 +2676,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
"Sending browsing info to %s:%d (IPv4)",
|
||||
temp, ntohs(dira->to.ipv4.sin_port));
|
||||
|
||||
|
||||
NumBrowsers ++;
|
||||
}
|
||||
else
|
||||
@@ -2816,7 +2816,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
cupsdDenyIP(location, ones, zeros);
|
||||
}
|
||||
#ifdef AF_INET6
|
||||
else if (value[0] == '*' || value[0] == '.' ||
|
||||
else if (value[0] == '*' || value[0] == '.' ||
|
||||
(!isdigit(value[0] & 255) && value[0] != '['))
|
||||
#else
|
||||
else if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
|
||||
@@ -2912,7 +2912,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
*/
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (value[0] == '*' || value[0] == '.' ||
|
||||
if (value[0] == '*' || value[0] == '.' ||
|
||||
(!isdigit(value[0] & 255) && value[0] != '['))
|
||||
#else
|
||||
if (value[0] == '*' || value[0] == '.' || !isdigit(value[0] & 255))
|
||||
@@ -2996,14 +2996,14 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
|
||||
for (addr = addrlist; addr; addr = addr->next)
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
break;
|
||||
break;
|
||||
|
||||
if (addr)
|
||||
{
|
||||
memcpy(&(relay->to), &(addrlist->addr), sizeof(relay->to));
|
||||
|
||||
|
||||
httpAddrString(&(relay->to), temp, sizeof(temp));
|
||||
|
||||
|
||||
if (relay->from.type == CUPSD_AUTH_IP)
|
||||
snprintf(temp2, sizeof(temp2), "%u.%u.%u.%u/%u.%u.%u.%u",
|
||||
relay->from.mask.ip.address[0] >> 24,
|
||||
@@ -3016,10 +3016,10 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
|
||||
relay->from.mask.ip.netmask[0] & 255);
|
||||
else
|
||||
strlcpy(temp2, relay->from.mask.name.name, sizeof(temp2));
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_INFO, "Relaying from %s to %s:%d (IPv4)",
|
||||
temp2, temp, ntohs(relay->to.ipv4.sin_port));
|
||||
|
||||
|
||||
NumRelays ++;
|
||||
}
|
||||
else
|
||||
@@ -3580,7 +3580,7 @@ read_location(cups_file_t *fp, /* I - Configuration file */
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ((loc = cupsdCopyLocation(&parent)) == NULL)
|
||||
return (0);
|
||||
|
||||
@@ -3722,7 +3722,7 @@ read_policy(cups_file_t *fp, /* I - Configuration file */
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Scan for IPP operation names...
|
||||
*/
|
||||
|
||||
@@ -1991,8 +1991,7 @@ load_drv(const char *filename, /* I - Actual filename */
|
||||
type = PPD_TYPE_PDF;
|
||||
}
|
||||
|
||||
for (product = (ppdcAttr *)d->attrs->first(), products_found = 0,
|
||||
ppd = NULL;
|
||||
for (product = (ppdcAttr *)d->attrs->first(), products_found = 0;
|
||||
product;
|
||||
product = (ppdcAttr *)d->attrs->next())
|
||||
if (!strcmp(product->name->value, "Product"))
|
||||
|
||||
+171
-170
@@ -50,7 +50,6 @@
|
||||
* printer or update the broadcast contents.
|
||||
* dnssdStop() - Stop all DNS-SD registrations.
|
||||
* dnssdUpdate() - Handle DNS-SD queries.
|
||||
* get_auth_info_required() - Get the auth-info-required value to advertise.
|
||||
* get_hostconfig() - Get an /etc/hostconfig service setting.
|
||||
* is_local_queue() - Determine whether the URI points at a local
|
||||
* queue.
|
||||
@@ -64,7 +63,6 @@
|
||||
* send_ldap_ou() - Send LDAP ou registrations.
|
||||
* send_ldap_browse() - Send LDAP printer registrations.
|
||||
* ldap_dereg_printer() - Delete printer from directory
|
||||
* ldap_dereg_ou() - Remove the organizational unit.
|
||||
* send_slp_browse() - Register the specified printer with SLP.
|
||||
* slp_attr_callback() - SLP attribute callback
|
||||
* slp_dereg_printer() - SLPDereg() the specified printer
|
||||
@@ -998,91 +996,93 @@ cupsdSendBrowseList(void)
|
||||
* 'ldap_rebind_proc()' - Callback function for LDAP rebind
|
||||
*/
|
||||
|
||||
static int /* O - Result code */
|
||||
ldap_rebind_proc(
|
||||
LDAP *RebindLDAPHandle, /* I - LDAP handle */
|
||||
LDAP_CONST char *refsp, /* I - ??? */
|
||||
ber_tag_t request, /* I - ??? */
|
||||
ber_int_t msgid, /* I - ??? */
|
||||
void *params) /* I - ??? */
|
||||
static int
|
||||
ldap_rebind_proc (LDAP *RebindLDAPHandle,
|
||||
LDAP_CONST char *refsp,
|
||||
ber_tag_t request,
|
||||
ber_int_t msgid,
|
||||
void *params)
|
||||
{
|
||||
int rc; /* Result code */
|
||||
# if LDAP_API_VERSION > 3000
|
||||
struct berval bval; /* Bind value */
|
||||
# endif /* LDAP_API_VERSION > 3000 */
|
||||
int rc;
|
||||
|
||||
/*
|
||||
* Bind to new LDAP server...
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "ldap_rebind_proc: Rebind to %s", refsp);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"ldap_rebind_proc: Rebind to %s", refsp);
|
||||
|
||||
# if LDAP_API_VERSION > 3000
|
||||
struct berval bval;
|
||||
bval.bv_val = BrowseLDAPPassword;
|
||||
bval.bv_len = (BrowseLDAPPassword == NULL) ? 0 : strlen(BrowseLDAPPassword);
|
||||
|
||||
rc = ldap_sasl_bind_s(RebindLDAPHandle, BrowseLDAPBindDN, LDAP_SASL_SIMPLE,
|
||||
&bval, NULL, NULL, NULL);
|
||||
rc = ldap_sasl_bind_s(RebindLDAPHandle, BrowseLDAPBindDN, LDAP_SASL_SIMPLE, &bval, NULL, NULL, NULL);
|
||||
# else
|
||||
rc = ldap_bind_s(RebindLDAPHandle, BrowseLDAPBindDN, BrowseLDAPPassword,
|
||||
LDAP_AUTH_SIMPLE);
|
||||
rc = ldap_bind_s(RebindLDAPHandle, BrowseLDAPBindDN,
|
||||
BrowseLDAPPassword, LDAP_AUTH_SIMPLE);
|
||||
# endif /* LDAP_API_VERSION > 3000 */
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
|
||||
# else /* defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000) */
|
||||
|
||||
/*
|
||||
* 'ldap_rebind_proc()' - Callback function for LDAP rebind
|
||||
*/
|
||||
|
||||
static int /* O - Result code */
|
||||
ldap_rebind_proc(
|
||||
LDAP *RebindLDAPHandle, /* I - LDAP handle */
|
||||
char **dnp, /* I - ??? */
|
||||
char **passwdp, /* I - ??? */
|
||||
int *authmethodp, /* I - ??? */
|
||||
int freeit, /* I - ??? */
|
||||
void *arg) /* I - ??? */
|
||||
static int
|
||||
ldap_rebind_proc (LDAP *RebindLDAPHandle,
|
||||
char **dnp,
|
||||
char **passwdp,
|
||||
int *authmethodp,
|
||||
int freeit,
|
||||
void *arg)
|
||||
{
|
||||
switch (freeit)
|
||||
{
|
||||
case 1:
|
||||
/*
|
||||
* Free current values...
|
||||
*/
|
||||
switch ( freeit ) {
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "ldap_rebind_proc: Free values...");
|
||||
case 1:
|
||||
|
||||
if (dnp && *dnp)
|
||||
free(*dnp);
|
||||
/*
|
||||
* Free current values...
|
||||
*/
|
||||
|
||||
if (passwdp && *passwdp)
|
||||
free(*passwdp);
|
||||
break;
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"ldap_rebind_proc: Free values...");
|
||||
|
||||
case 0:
|
||||
/*
|
||||
* Return credentials for LDAP referal...
|
||||
*/
|
||||
if ( dnp && *dnp ) {
|
||||
free( *dnp );
|
||||
}
|
||||
if ( passwdp && *passwdp ) {
|
||||
free( *passwdp );
|
||||
}
|
||||
break;
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"ldap_rebind_proc: Return necessary values...");
|
||||
case 0:
|
||||
|
||||
*dnp = strdup(BrowseLDAPBindDN);
|
||||
*passwdp = strdup(BrowseLDAPPassword);
|
||||
*authmethodp = LDAP_AUTH_SIMPLE;
|
||||
break;
|
||||
/*
|
||||
* Return credentials for LDAP referal...
|
||||
*/
|
||||
|
||||
default:
|
||||
/*
|
||||
* Should never happen...
|
||||
*/
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"ldap_rebind_proc: Return necessary values...");
|
||||
|
||||
*dnp = strdup(BrowseLDAPBindDN);
|
||||
*passwdp = strdup(BrowseLDAPPassword);
|
||||
*authmethodp = LDAP_AUTH_SIMPLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* Should never happen...
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"LDAP rebind has been called with wrong freeit value!");
|
||||
break;
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"LDAP rebind has been called with wrong freeit value!");
|
||||
break;
|
||||
}
|
||||
|
||||
return (LDAP_SUCCESS);
|
||||
@@ -1096,22 +1096,25 @@ ldap_rebind_proc(
|
||||
* 'ldap_connect()' - Start new LDAP connection
|
||||
*/
|
||||
|
||||
static LDAP * /* O - LDAP handle */
|
||||
static LDAP *
|
||||
ldap_connect(void)
|
||||
{
|
||||
int rc; /* LDAP API status */
|
||||
int version = 3; /* LDAP version */
|
||||
struct berval bv = {0, ""}; /* SASL bind value */
|
||||
LDAP *TempBrowseLDAPHandle=NULL;
|
||||
/* Temporary LDAP Handle */
|
||||
# if defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP)
|
||||
int ldap_ssl = 0; /* LDAP SSL indicator */
|
||||
int ssl_err = 0; /* LDAP SSL error value */
|
||||
# endif /* defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP) */
|
||||
/*
|
||||
* Open LDAP handle...
|
||||
*/
|
||||
|
||||
int rc; /* LDAP API status */
|
||||
int version = 3; /* LDAP version */
|
||||
struct berval bv = {0, ""}; /* SASL bind value */
|
||||
LDAP *TempBrowseLDAPHandle=NULL; /* Temporary LDAP Handle */
|
||||
# if defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP)
|
||||
int ldap_ssl = 0; /* LDAP SSL indicator */
|
||||
int ssl_err = 0; /* LDAP SSL error value */
|
||||
# endif /* defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP) */
|
||||
|
||||
# ifdef HAVE_OPENLDAP
|
||||
# ifdef HAVE_LDAP_SSL
|
||||
|
||||
/*
|
||||
* Set the certificate file to use for encrypted LDAP sessions...
|
||||
*/
|
||||
@@ -1119,7 +1122,7 @@ ldap_connect(void)
|
||||
if (BrowseLDAPCACertFile)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"ldap_connect: Setting CA certificate file \"%s\"",
|
||||
"cupsdStartBrowsing: Setting CA certificate file \"%s\"",
|
||||
BrowseLDAPCACertFile);
|
||||
|
||||
if ((rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE,
|
||||
@@ -1128,8 +1131,8 @@ ldap_connect(void)
|
||||
"Unable to set CA certificate file for LDAP "
|
||||
"connections: %d - %s", rc, ldap_err2string(rc));
|
||||
}
|
||||
# endif /* HAVE_LDAP_SSL */
|
||||
|
||||
# endif /* HAVE_LDAP_SSL */
|
||||
/*
|
||||
* Initialize OPENLDAP connection...
|
||||
* LDAP stuff currently only supports ldapi EXTERNAL SASL binds...
|
||||
@@ -1150,27 +1153,26 @@ ldap_connect(void)
|
||||
* Split LDAP URI into its components...
|
||||
*/
|
||||
|
||||
if (!BrowseLDAPServer)
|
||||
if (! BrowseLDAPServer)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "BrowseLDAPServer not configured!");
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Disabling LDAP browsing!");
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"BrowseLDAPServer not configured! Disable LDAP browsing!");
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
BrowseRemoteProtocols &= ~BROWSE_LDAP;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
sscanf(BrowseLDAPServer, "%10[^:]://%254[^:/]:%d", ldap_protocol, ldap_host,
|
||||
&ldap_port);
|
||||
sscanf(BrowseLDAPServer, "%10[^:]://%254[^:/]:%d", ldap_protocol, ldap_host, &ldap_port);
|
||||
|
||||
if (!strcmp(ldap_protocol, "ldap"))
|
||||
if (strcmp(ldap_protocol, "ldap") == 0) {
|
||||
ldap_ssl = 0;
|
||||
else if (!strcmp(ldap_protocol, "ldaps"))
|
||||
} else if (strcmp(ldap_protocol, "ldaps") == 0) {
|
||||
ldap_ssl = 1;
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unrecognized LDAP protocol (%s)!",
|
||||
ldap_protocol);
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Disabling LDAP browsing!");
|
||||
} else {
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"unrecognised ldap protocol (%s)!", ldap_protocol);
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Disable LDAP browsing!");
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
BrowseRemoteProtocols &= ~BROWSE_LDAP;
|
||||
return (NULL);
|
||||
@@ -1184,14 +1186,15 @@ ldap_connect(void)
|
||||
ldap_port = LDAP_PORT;
|
||||
}
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "ldap_connect: PROT:%s HOST:%s PORT:%d",
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"LDAP Connection Details: PROT:%s HOST:%s PORT:%d",
|
||||
ldap_protocol, ldap_host, ldap_port);
|
||||
|
||||
/*
|
||||
* Initialize LDAP connection...
|
||||
*/
|
||||
|
||||
if (!ldap_ssl)
|
||||
if (! ldap_ssl)
|
||||
{
|
||||
if ((TempBrowseLDAPHandle = ldap_init(ldap_host, ldap_port)) == NULL)
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
@@ -1202,23 +1205,19 @@ ldap_connect(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* Initialize SSL LDAP connection...
|
||||
*/
|
||||
|
||||
if (BrowseLDAPCACertFile)
|
||||
{
|
||||
rc = ldapssl_client_init(BrowseLDAPCACertFile, (void *)NULL);
|
||||
if (rc != LDAP_SUCCESS)
|
||||
{
|
||||
if (rc != LDAP_SUCCESS) {
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Failed to initialize LDAP SSL client!");
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((TempBrowseLDAPHandle = ldapssl_init(ldap_host, ldap_port,
|
||||
1)) == NULL)
|
||||
} else {
|
||||
if ((TempBrowseLDAPHandle = ldapssl_init(ldap_host, ldap_port, 1)) == NULL)
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
else
|
||||
rc = LDAP_SUCCESS;
|
||||
@@ -1238,7 +1237,7 @@ ldap_connect(void)
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"LDAP client libraries do not support SSL");
|
||||
"LDAP client libraries does not support TLS");
|
||||
rc = LDAP_OPERATIONS_ERROR;
|
||||
|
||||
# endif /* HAVE_LDAP_SSL */
|
||||
@@ -1251,104 +1250,105 @@ ldap_connect(void)
|
||||
|
||||
if (rc != LDAP_SUCCESS)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to initialize LDAP!");
|
||||
|
||||
if (rc == LDAP_SERVER_DOWN || rc == LDAP_CONNECT_ERROR)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Temporarily disabling LDAP browsing...");
|
||||
if ((rc == LDAP_SERVER_DOWN) || (rc == LDAP_CONNECT_ERROR))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unable to initialize LDAP! Temporary disable LDAP browsing...");
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Disabling LDAP browsing!");
|
||||
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unable to initialize LDAP! Disable LDAP browsing!");
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
BrowseRemoteProtocols &= ~BROWSE_LDAP;
|
||||
}
|
||||
|
||||
ldap_disconnect(TempBrowseLDAPHandle);
|
||||
|
||||
return (NULL);
|
||||
TempBrowseLDAPHandle = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Upgrade LDAP version...
|
||||
*/
|
||||
|
||||
if (ldap_set_option(TempBrowseLDAPHandle, LDAP_OPT_PROTOCOL_VERSION,
|
||||
else if (ldap_set_option(TempBrowseLDAPHandle, LDAP_OPT_PROTOCOL_VERSION,
|
||||
(const void *)&version) != LDAP_SUCCESS)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to set LDAP protocol version %d!",
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unable to set LDAP protocol version %d! Disable LDAP browsing!",
|
||||
version);
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Disabling LDAP browsing!");
|
||||
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
BrowseLocalProtocols &= ~BROWSE_LDAP;
|
||||
BrowseRemoteProtocols &= ~BROWSE_LDAP;
|
||||
ldap_disconnect(TempBrowseLDAPHandle);
|
||||
|
||||
return (NULL);
|
||||
TempBrowseLDAPHandle = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* Register LDAP rebind procedure...
|
||||
*/
|
||||
/*
|
||||
* Register LDAP rebind procedure...
|
||||
*/
|
||||
|
||||
# ifdef HAVE_LDAP_REBIND_PROC
|
||||
# if defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000)
|
||||
|
||||
rc = ldap_set_rebind_proc(TempBrowseLDAPHandle, &ldap_rebind_proc,
|
||||
(void *)NULL);
|
||||
if (rc != LDAP_SUCCESS)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Setting LDAP rebind function failed with status %d: %s",
|
||||
rc, ldap_err2string(rc));
|
||||
rc = ldap_set_rebind_proc(TempBrowseLDAPHandle, &ldap_rebind_proc, (void *)NULL);
|
||||
if ( rc != LDAP_SUCCESS )
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Setting LDAP rebind function failed with status %d: %s",
|
||||
rc, ldap_err2string(rc));
|
||||
|
||||
# else
|
||||
|
||||
ldap_set_rebind_proc(TempBrowseLDAPHandle, &ldap_rebind_proc, (void *)NULL);
|
||||
ldap_set_rebind_proc(TempBrowseLDAPHandle, &ldap_rebind_proc, (void *)NULL);
|
||||
|
||||
# endif /* defined(LDAP_API_FEATURE_X_OPENLDAP) && (LDAP_API_VERSION > 2000) */
|
||||
# endif /* HAVE_LDAP_REBIND_PROC */
|
||||
|
||||
/*
|
||||
* Start LDAP bind...
|
||||
*/
|
||||
/*
|
||||
* Start LDAP bind...
|
||||
*/
|
||||
|
||||
# if LDAP_API_VERSION > 3000
|
||||
struct berval bval;
|
||||
bval.bv_val = BrowseLDAPPassword;
|
||||
bval.bv_len = (BrowseLDAPPassword == NULL) ? 0 : strlen(BrowseLDAPPassword);
|
||||
|
||||
if (!BrowseLDAPServer || !strcasecmp(BrowseLDAPServer, "localhost"))
|
||||
rc = ldap_sasl_bind_s(TempBrowseLDAPHandle, NULL, "EXTERNAL", &bv, NULL,
|
||||
NULL, NULL);
|
||||
else
|
||||
rc = ldap_sasl_bind_s(TempBrowseLDAPHandle, BrowseLDAPBindDN, LDAP_SASL_SIMPLE, &bval, NULL, NULL, NULL);
|
||||
struct berval bval;
|
||||
bval.bv_val = BrowseLDAPPassword;
|
||||
bval.bv_len = (BrowseLDAPPassword == NULL) ? 0 : strlen(BrowseLDAPPassword);
|
||||
|
||||
if (!BrowseLDAPServer || !strcasecmp(BrowseLDAPServer, "localhost"))
|
||||
rc = ldap_sasl_bind_s(TempBrowseLDAPHandle, NULL, "EXTERNAL", &bv, NULL,
|
||||
NULL, NULL);
|
||||
else
|
||||
rc = ldap_sasl_bind_s(TempBrowseLDAPHandle, BrowseLDAPBindDN, LDAP_SASL_SIMPLE, &bval, NULL, NULL, NULL);
|
||||
# else
|
||||
rc = ldap_bind_s(TempBrowseLDAPHandle, BrowseLDAPBindDN,
|
||||
BrowseLDAPPassword, LDAP_AUTH_SIMPLE);
|
||||
rc = ldap_bind_s(TempBrowseLDAPHandle, BrowseLDAPBindDN,
|
||||
BrowseLDAPPassword, LDAP_AUTH_SIMPLE);
|
||||
# endif /* LDAP_API_VERSION > 3000 */
|
||||
|
||||
if (rc != LDAP_SUCCESS)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "LDAP bind failed with error %d: %s",
|
||||
rc, ldap_err2string(rc));
|
||||
|
||||
# if defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP)
|
||||
if (ldap_ssl && (rc == LDAP_SERVER_DOWN || rc == LDAP_CONNECT_ERROR))
|
||||
if (rc != LDAP_SUCCESS)
|
||||
{
|
||||
ssl_err = PORT_GetError();
|
||||
if (ssl_err != 0)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "LDAP SSL error %d: %s", ssl_err,
|
||||
ldapssl_err2string(ssl_err));
|
||||
}
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"LDAP bind failed with error %d: %s",
|
||||
rc, ldap_err2string(rc));
|
||||
# if defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP)
|
||||
if (ldap_ssl && ((rc == LDAP_SERVER_DOWN) || (rc == LDAP_CONNECT_ERROR)))
|
||||
{
|
||||
ssl_err = PORT_GetError();
|
||||
if (ssl_err != 0)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"LDAP SSL error %d: %s",
|
||||
ssl_err, ldapssl_err2string(ssl_err));
|
||||
}
|
||||
# endif /* defined(HAVE_LDAP_SSL) && defined (HAVE_MOZILLA_LDAP) */
|
||||
ldap_disconnect(TempBrowseLDAPHandle);
|
||||
TempBrowseLDAPHandle = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
"LDAP connection established");
|
||||
}
|
||||
|
||||
ldap_disconnect(TempBrowseLDAPHandle);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_INFO, "LDAP connection established");
|
||||
|
||||
return (TempBrowseLDAPHandle);
|
||||
}
|
||||
|
||||
@@ -1360,23 +1360,24 @@ ldap_connect(void)
|
||||
static void
|
||||
ldap_reconnect(void)
|
||||
{
|
||||
LDAP *TempBrowseLDAPHandle = NULL; /* Temp Handle to LDAP server */
|
||||
LDAP *TempBrowseLDAPHandle = NULL; /* Temp Handle to LDAP server */
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
"Try LDAP reconnect...");
|
||||
|
||||
/*
|
||||
* Get a new LDAP Handle and replace the global Handle
|
||||
* if the new connection was successful
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_INFO, "Try LDAP reconnect...");
|
||||
|
||||
TempBrowseLDAPHandle = ldap_connect();
|
||||
|
||||
if (TempBrowseLDAPHandle != NULL)
|
||||
{
|
||||
if (BrowseLDAPHandle != NULL)
|
||||
{
|
||||
ldap_disconnect(BrowseLDAPHandle);
|
||||
|
||||
}
|
||||
BrowseLDAPHandle = TempBrowseLDAPHandle;
|
||||
}
|
||||
}
|
||||
@@ -1387,10 +1388,9 @@ ldap_reconnect(void)
|
||||
*/
|
||||
|
||||
static void
|
||||
ldap_disconnect(LDAP *ld) /* I - LDAP handle */
|
||||
ldap_disconnect(LDAP *ld) /* I - LDAP handle */
|
||||
{
|
||||
int rc; /* Return code */
|
||||
|
||||
int rc; /* return code */
|
||||
|
||||
/*
|
||||
* Close LDAP handle...
|
||||
@@ -1401,7 +1401,6 @@ ldap_disconnect(LDAP *ld) /* I - LDAP handle */
|
||||
# else
|
||||
rc = ldap_unbind_s(ld);
|
||||
# endif /* defined(HAVE_OPENLDAP) && LDAP_API_VERSION > 3000 */
|
||||
|
||||
if (rc != LDAP_SUCCESS)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unbind from LDAP server failed with status %d: %s",
|
||||
@@ -3972,7 +3971,7 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */
|
||||
* 'ldap_search_rec()' - LDAP Search with reconnect
|
||||
*/
|
||||
|
||||
static int /* O - Return code */
|
||||
static int
|
||||
ldap_search_rec(LDAP *ld, /* I - LDAP handler */
|
||||
char *base, /* I - Base dn */
|
||||
int scope, /* I - LDAP search scope */
|
||||
@@ -4041,9 +4040,11 @@ ldap_freeres(LDAPMessage *entry) /* I - LDAP handler */
|
||||
|
||||
rc = ldap_msgfree(entry);
|
||||
if (rc == -1)
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "Can't free LDAPMessage!");
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"Can't free LDAPMessage!");
|
||||
else if (rc == 0)
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "Freeing LDAPMessage was unnecessary");
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"Freeing LDAPMessage was unnecessary");
|
||||
}
|
||||
|
||||
|
||||
@@ -4051,7 +4052,7 @@ ldap_freeres(LDAPMessage *entry) /* I - LDAP handler */
|
||||
* 'ldap_getval_char()' - Get first LDAP value and convert to string
|
||||
*/
|
||||
|
||||
static int /* O - Return code */
|
||||
static int
|
||||
ldap_getval_firststring(
|
||||
LDAP *ld, /* I - LDAP handler */
|
||||
LDAPMessage *entry, /* I - LDAP message or search result */
|
||||
@@ -4081,6 +4082,7 @@ ldap_getval_firststring(
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* Check size and copy value into our string...
|
||||
*/
|
||||
@@ -4102,7 +4104,7 @@ ldap_getval_firststring(
|
||||
ldap_value_free_len(bval);
|
||||
}
|
||||
# else
|
||||
char **value; /* LDAP value */
|
||||
char **value; /* LDAP value */
|
||||
|
||||
/*
|
||||
* Get value from LDAPMessage...
|
||||
@@ -4112,7 +4114,8 @@ ldap_getval_firststring(
|
||||
{
|
||||
rc = -1;
|
||||
dn = ldap_get_dn(ld, entry);
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "Failed to get LDAP value %s for %s!",
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"Failed to get LDAP value %s for %s!",
|
||||
attr, dn);
|
||||
ldap_memfree(dn);
|
||||
}
|
||||
@@ -4165,10 +4168,11 @@ send_ldap_ou(char *ou, /* I - Servername/ou to register */
|
||||
* Reconnect if LDAP Handle is invalid...
|
||||
*/
|
||||
|
||||
if (!BrowseLDAPHandle)
|
||||
if (! BrowseLDAPHandle)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"send_ldap_ou: LDAP Handle is invalid. Try reconnecting...");
|
||||
"send_ldap_ou: LDAP Handle is invalid. Try "
|
||||
"reconnecting...");
|
||||
ldap_reconnect();
|
||||
return;
|
||||
}
|
||||
@@ -4626,10 +4630,6 @@ ldap_dereg_printer(cupsd_printer_t *p) /* I - Printer to deregister */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ldap_dereg_ou()' - Remove the organizational unit.
|
||||
*/
|
||||
|
||||
static void
|
||||
ldap_dereg_ou(char *ou, /* I - Organizational unit (servername) */
|
||||
char *basedn) /* I - Dase dn */
|
||||
@@ -4688,6 +4688,7 @@ ldap_dereg_ou(char *ou, /* I - Organizational unit (servername) */
|
||||
"LDAP delete for %s failed with status %d: %s",
|
||||
ou, rc, ldap_err2string(rc));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_LDAP */
|
||||
|
||||
+16
-34
@@ -1332,6 +1332,7 @@ add_job(cupsd_client_t *con, /* I - Client connection */
|
||||
*auth_info; /* auth-info attribute */
|
||||
const char *val; /* Default option value */
|
||||
int priority; /* Job priority */
|
||||
char *title; /* Job name/title */
|
||||
cupsd_job_t *job; /* Current job */
|
||||
char job_uri[HTTP_MAX_URI]; /* Job URI */
|
||||
int kbytes; /* Size of print file */
|
||||
@@ -1546,9 +1547,12 @@ add_job(cupsd_client_t *con, /* I - Client connection */
|
||||
priority);
|
||||
}
|
||||
|
||||
if (!ippFindAttribute(con->request, "job-name", IPP_TAG_NAME))
|
||||
if ((attr = ippFindAttribute(con->request, "job-name",
|
||||
IPP_TAG_NAME)) != NULL)
|
||||
title = attr->values[0].string.text;
|
||||
else
|
||||
ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL,
|
||||
"Untitled");
|
||||
title = "Untitled");
|
||||
|
||||
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
|
||||
{
|
||||
@@ -1702,6 +1706,8 @@ add_job(cupsd_client_t *con, /* I - Client connection */
|
||||
"job-media-sheets-completed", 0);
|
||||
ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-printer-uri", NULL,
|
||||
printer->uri);
|
||||
ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL,
|
||||
title);
|
||||
|
||||
if ((attr = ippFindAttribute(job->attrs, "job-k-octets",
|
||||
IPP_TAG_INTEGER)) != NULL)
|
||||
@@ -3193,7 +3199,7 @@ apple_register_profiles(
|
||||
num_profiles ++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* If we have profiles, add them...
|
||||
*/
|
||||
@@ -3239,7 +3245,7 @@ apple_register_profiles(
|
||||
snprintf(q_keyword, sizeof(q_keyword), "Default%s", attr->value);
|
||||
q2_attr = ppdFindAttr(ppd, q_keyword, NULL);
|
||||
}
|
||||
else
|
||||
else
|
||||
q2_attr = ppdFindAttr(ppd, "DefaultMediaType", NULL);
|
||||
|
||||
if (q2_attr && q2_attr->value && q2_attr->value[0])
|
||||
@@ -3253,7 +3259,7 @@ apple_register_profiles(
|
||||
snprintf(q_keyword, sizeof(q_keyword), "Default%s", attr->value);
|
||||
q3_attr = ppdFindAttr(ppd, q_keyword, NULL);
|
||||
}
|
||||
else
|
||||
else
|
||||
q3_attr = ppdFindAttr(ppd, "DefaultResolution", NULL);
|
||||
|
||||
if (q3_attr && q3_attr->value && q3_attr->value[0])
|
||||
@@ -3422,7 +3428,7 @@ apple_register_profiles(
|
||||
attr = ppdFindAttr(ppd, "DefaultColorSpace", NULL);
|
||||
|
||||
num_profiles = (attr && ppd->colorspace == PPD_CS_GRAY) ? 1 : 2;
|
||||
|
||||
|
||||
if ((profiles = calloc(num_profiles, sizeof(CMDeviceProfileArray))) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
@@ -4420,7 +4426,7 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */
|
||||
if (q->page_count == -4) /* special case: unlimited user */
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_INFO,
|
||||
"User \"%s\" request approved for printer %s (%s): "
|
||||
"User \"%s\" request approved for printer %s (%s): "
|
||||
"unlimited quota.",
|
||||
username, p->name, p->info);
|
||||
q->page_count = 0; /* allow user to print */
|
||||
@@ -6740,7 +6746,6 @@ get_job_attrs(cupsd_client_t *con, /* I - Client connection */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
int jobid; /* Job ID */
|
||||
cupsd_job_t *job; /* Current job */
|
||||
cupsd_printer_t *printer; /* Current printer */
|
||||
char scheme[HTTP_MAX_URI], /* Method portion of URI */
|
||||
username[HTTP_MAX_URI], /* Username portion of URI */
|
||||
host[HTTP_MAX_URI], /* Host portion of URI */
|
||||
@@ -6815,19 +6820,7 @@ get_job_attrs(cupsd_client_t *con, /* I - Client connection */
|
||||
* Check policy...
|
||||
*/
|
||||
|
||||
if ((printer = job->printer) == NULL)
|
||||
printer = cupsdFindDest(job->dest);
|
||||
|
||||
if (printer)
|
||||
{
|
||||
if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con,
|
||||
NULL)) != HTTP_OK)
|
||||
{
|
||||
send_http_error(con, status, printer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
|
||||
if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK)
|
||||
{
|
||||
send_http_error(con, status, NULL);
|
||||
return;
|
||||
@@ -7003,18 +6996,7 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
|
||||
else
|
||||
username[0] = '\0';
|
||||
|
||||
if ((ra = create_requested_array(con->request)) == NULL &&
|
||||
!ippFindAttribute(con->request, "requested-attributes", IPP_TAG_KEYWORD))
|
||||
{
|
||||
/*
|
||||
* IPP conformance - Get-Jobs has a default requested-attributes value of
|
||||
* "job-id" and "job-uri".
|
||||
*/
|
||||
|
||||
ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
|
||||
cupsArrayAdd(ra, "job-id");
|
||||
cupsArrayAdd(ra, "job-uri");
|
||||
}
|
||||
ra = create_requested_array(con->request);
|
||||
|
||||
/*
|
||||
* OK, build a list of jobs for this printer...
|
||||
@@ -9635,7 +9617,7 @@ save_auth_info(
|
||||
* Write a random number of newlines to the end of the file...
|
||||
*/
|
||||
|
||||
for (i = (CUPS_RAND() % 1024); i >= 0; i --)
|
||||
for (i = (rand() % 1024); i >= 0; i --)
|
||||
cupsFilePutChar(fp, '\n');
|
||||
|
||||
/*
|
||||
|
||||
+18
-76
@@ -168,7 +168,7 @@ static mime_filter_t gziptoany_filter =
|
||||
static int compare_active_jobs(void *first, void *second, void *data);
|
||||
static int compare_jobs(void *first, void *second, void *data);
|
||||
static void dump_job_history(cupsd_job_t *job);
|
||||
static void finalize_job(cupsd_job_t *job, int set_job_state);
|
||||
static void finalize_job(cupsd_job_t *job);
|
||||
static void free_job_history(cupsd_job_t *job);
|
||||
static char *get_options(cupsd_job_t *job, int banner_page, char *copies,
|
||||
size_t copies_size, char *title,
|
||||
@@ -253,7 +253,7 @@ cupsdCancelJobs(const char *dest, /* I - Destination to cancel */
|
||||
if (purge)
|
||||
cupsdSetJobState(job, IPP_JOB_CANCELED, CUPSD_JOB_PURGE,
|
||||
"Job purged by user.");
|
||||
else if (job->state_value < IPP_JOB_CANCELED)
|
||||
else
|
||||
cupsdSetJobState(job, IPP_JOB_CANCELED, CUPSD_JOB_DEFAULT,
|
||||
"Job canceled by user.");
|
||||
}
|
||||
@@ -433,11 +433,11 @@ cupsdCleanJobs(void)
|
||||
cupsd_job_t *job; /* Current job */
|
||||
|
||||
|
||||
if (MaxJobs <= 0 && JobHistory)
|
||||
if (MaxJobs <= 0)
|
||||
return;
|
||||
|
||||
for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
|
||||
job && (cupsArrayCount(Jobs) >= MaxJobs || !JobHistory);
|
||||
job && cupsArrayCount(Jobs) >= MaxJobs;
|
||||
job = (cupsd_job_t *)cupsArrayNext(Jobs))
|
||||
if (job->state_value >= IPP_JOB_CANCELED && !job->printer)
|
||||
cupsdDeleteJob(job, CUPSD_JOB_PURGE);
|
||||
@@ -1233,7 +1233,7 @@ cupsdDeleteJob(cupsd_job_t *job, /* I - Job */
|
||||
cupsd_jobaction_t action)/* I - Action */
|
||||
{
|
||||
if (job->printer)
|
||||
finalize_job(job, 1);
|
||||
finalize_job(job);
|
||||
|
||||
if (action == CUPSD_JOB_PURGE)
|
||||
{
|
||||
@@ -1657,30 +1657,7 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"[Job %d] Ran out of memory for job file types!",
|
||||
job->id);
|
||||
|
||||
ippDelete(job->attrs);
|
||||
job->attrs = NULL;
|
||||
|
||||
if (compressions)
|
||||
free(compressions);
|
||||
|
||||
if (filetypes)
|
||||
free(filetypes);
|
||||
|
||||
if (job->compressions)
|
||||
{
|
||||
free(job->compressions);
|
||||
job->compressions = NULL;
|
||||
}
|
||||
|
||||
if (job->filetypes)
|
||||
{
|
||||
free(job->filetypes);
|
||||
job->filetypes = NULL;
|
||||
}
|
||||
|
||||
job->num_files = 0;
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
job->compressions = compressions;
|
||||
@@ -1748,21 +1725,6 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */
|
||||
|
||||
ippDelete(job->attrs);
|
||||
job->attrs = NULL;
|
||||
|
||||
if (job->compressions)
|
||||
{
|
||||
free(job->compressions);
|
||||
job->compressions = NULL;
|
||||
}
|
||||
|
||||
if (job->filetypes)
|
||||
{
|
||||
free(job->filetypes);
|
||||
job->filetypes = NULL;
|
||||
}
|
||||
|
||||
job->num_files = 0;
|
||||
|
||||
unlink(jobfile);
|
||||
|
||||
return (0);
|
||||
@@ -2234,7 +2196,7 @@ cupsdSetJobState(
|
||||
*/
|
||||
|
||||
if (oldstate == IPP_JOB_PROCESSING)
|
||||
stop_job(job, action);
|
||||
stop_job(job, action != CUPSD_JOB_DEFAULT);
|
||||
|
||||
/*
|
||||
* Set the new job state...
|
||||
@@ -2434,6 +2396,8 @@ cupsdSetJobState(
|
||||
job->dirty = 1;
|
||||
cupsdMarkDirty(CUPSD_DIRTY_JOBS);
|
||||
}
|
||||
else if (!job->printer)
|
||||
cupsdDeleteJob(job, CUPSD_JOB_PURGE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2441,8 +2405,8 @@ cupsdSetJobState(
|
||||
* Finalize the job immediately if we forced things...
|
||||
*/
|
||||
|
||||
if (action >= CUPSD_JOB_FORCE && job->printer)
|
||||
finalize_job(job, 0);
|
||||
if (action == CUPSD_JOB_FORCE)
|
||||
finalize_job(job);
|
||||
|
||||
/*
|
||||
* Update the server "busy" state...
|
||||
@@ -2677,8 +2641,7 @@ free_job_history(cupsd_job_t *job) /* I - Job */
|
||||
*/
|
||||
|
||||
static void
|
||||
finalize_job(cupsd_job_t *job, /* I - Job */
|
||||
int set_job_state) /* I - 1 = set the job state */
|
||||
finalize_job(cupsd_job_t *job) /* I - Job */
|
||||
{
|
||||
ipp_pstate_t printer_state; /* New printer state value */
|
||||
ipp_jstate_t job_state; /* New job state value */
|
||||
@@ -2964,9 +2927,7 @@ finalize_job(cupsd_job_t *job, /* I - Job */
|
||||
* Update the printer and job state.
|
||||
*/
|
||||
|
||||
if (job_state != job->state_value)
|
||||
cupsdSetJobState(job, job_state, CUPSD_JOB_DEFAULT, "%s", message);
|
||||
|
||||
cupsdSetJobState(job, job_state, CUPSD_JOB_DEFAULT, "%s", message);
|
||||
cupsdSetPrinterState(job->printer, printer_state,
|
||||
printer_state == IPP_PRINTER_STOPPED);
|
||||
update_job_attrs(job, 0);
|
||||
@@ -3934,34 +3895,15 @@ stop_job(cupsd_job_t *job, /* I - Job */
|
||||
|
||||
if (action == CUPSD_JOB_DEFAULT && !job->kill_time)
|
||||
job->kill_time = time(NULL) + JobKillDelay;
|
||||
else if (action >= CUPSD_JOB_FORCE)
|
||||
else if (action == CUPSD_JOB_FORCE)
|
||||
job->kill_time = 0;
|
||||
|
||||
for (i = 0; job->filters[i]; i ++)
|
||||
if (job->filters[i] > 0)
|
||||
{
|
||||
cupsdEndProcess(job->filters[i], action >= CUPSD_JOB_FORCE);
|
||||
|
||||
if (action >= CUPSD_JOB_FORCE)
|
||||
job->filters[i] = -job->filters[i];
|
||||
}
|
||||
cupsdEndProcess(job->filters[i], action == CUPSD_JOB_FORCE);
|
||||
|
||||
if (job->backend > 0)
|
||||
{
|
||||
cupsdEndProcess(job->backend, action >= CUPSD_JOB_FORCE);
|
||||
|
||||
if (action >= CUPSD_JOB_FORCE)
|
||||
job->backend = -job->backend;
|
||||
}
|
||||
|
||||
if (action >= CUPSD_JOB_FORCE)
|
||||
{
|
||||
/*
|
||||
* Clear job status...
|
||||
*/
|
||||
|
||||
job->status = 0;
|
||||
}
|
||||
cupsdEndProcess(job->backend, action == CUPSD_JOB_FORCE);
|
||||
}
|
||||
|
||||
|
||||
@@ -4351,7 +4293,7 @@ update_job(cupsd_job_t *job) /* I - Job to check */
|
||||
* Handle the end of job stuff...
|
||||
*/
|
||||
|
||||
finalize_job(job, 1);
|
||||
finalize_job(job);
|
||||
|
||||
/*
|
||||
* Check for new jobs...
|
||||
@@ -4405,7 +4347,7 @@ update_job_attrs(cupsd_job_t *job, /* I - Job to update */
|
||||
else if (job->printer->state_message[0] && do_message)
|
||||
cupsdSetString(&(job->printer_message->values[0].string.text),
|
||||
job->printer->state_message);
|
||||
|
||||
|
||||
/*
|
||||
* ... and the printer-state-reasons value...
|
||||
*/
|
||||
|
||||
+22
-29
@@ -134,7 +134,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
senddoc_time, /* Send-Document time */
|
||||
expire_time, /* Subscription expire time */
|
||||
report_time, /* Malloc/client/job report time */
|
||||
event_time; /* Last event notification time */
|
||||
event_time; /* Last time an event notification was done */
|
||||
long timeout; /* Timeout for cupsdDoSelect() */
|
||||
struct rlimit limit; /* Runtime limit */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
@@ -270,22 +270,19 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
|
||||
case 'p' : /* Stop immediately for profiling */
|
||||
fputs("cupsd: -p (startup profiling) is for internal testing "
|
||||
"use only!\n", stderr);
|
||||
puts("Warning: -p (startup profiling) is for internal testing use only!");
|
||||
stop_scheduler = 1;
|
||||
fg = 1;
|
||||
break;
|
||||
|
||||
case 'P' : /* Disable security profiles */
|
||||
fputs("cupsd: -P (disable security profiles) is for internal "
|
||||
"testing use only!\n", stderr);
|
||||
puts("Warning: -P (disable security profiles) is for internal testing use only!");
|
||||
UseProfiles = 0;
|
||||
break;
|
||||
|
||||
#ifdef __APPLE__
|
||||
case 'S' : /* Disable system management functions */
|
||||
fputs("cupsd: -S (disable system management) for internal "
|
||||
"testing use only!\n", stderr);
|
||||
puts("Warning: -S (disable system management) for internal testing use only!");
|
||||
use_sysman = 0;
|
||||
break;
|
||||
#endif /* __APPLE__ */
|
||||
@@ -382,7 +379,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* parent's file descriptors to be blocking. This is a workaround for a
|
||||
* limitation of userland libpthread on OpenBSD.
|
||||
*/
|
||||
|
||||
|
||||
_thread_sys_closefrom(0);
|
||||
#endif /* __OpenBSD__ */
|
||||
|
||||
@@ -766,8 +763,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (Launchd)
|
||||
{
|
||||
/*
|
||||
* If we were started by launchd, get the listen socket file
|
||||
* descriptors...
|
||||
* If we were started by launchd get the listen sockets file descriptors...
|
||||
*/
|
||||
|
||||
launchd_checkin();
|
||||
@@ -811,8 +807,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (timeout == 86400 && Launchd && LaunchdTimeout && !NumPolled &&
|
||||
!cupsArrayCount(ActiveJobs) &&
|
||||
(!Browsing ||
|
||||
(!BrowseRemoteProtocols &&
|
||||
(!Browsing ||
|
||||
(!BrowseRemoteProtocols &&
|
||||
(!NumBrowsers || !BrowseLocalProtocols ||
|
||||
cupsArrayCount(Printers) == 0))))
|
||||
{
|
||||
@@ -1040,7 +1036,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
if ((current_time - senddoc_time) >= 10)
|
||||
{
|
||||
cupsdCheckJobs();
|
||||
cupsdCleanJobs();
|
||||
senddoc_time = current_time;
|
||||
}
|
||||
|
||||
@@ -1199,8 +1194,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
|
||||
/*
|
||||
* Unload Print Service quota enforcement library (X Server only)
|
||||
/*
|
||||
* Unload Print Service quota enforcement library (X Server only)
|
||||
*/
|
||||
|
||||
PSQUpdateQuotaProc = NULL;
|
||||
@@ -1557,21 +1552,21 @@ launchd_checkin(void)
|
||||
|
||||
if (lis)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_checkin: Matched existing listener %s with fd %d...",
|
||||
httpAddrString(&(lis->address), s, sizeof(s)), fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_checkin: Adding new listener %s with fd %d...",
|
||||
httpAddrString(&addr, s, sizeof(s)), fd);
|
||||
|
||||
if ((lis = calloc(1, sizeof(cupsd_listener_t))) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_checkin: Unable to allocate listener - "
|
||||
"%s.", strerror(errno));
|
||||
"launchd_checkin: Unable to allocate listener - %s.",
|
||||
strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -1617,18 +1612,17 @@ launchd_checkout(void)
|
||||
|
||||
/*
|
||||
* Create or remove the launchd KeepAlive file based on whether
|
||||
* there are active jobs, polling, browsing for remote printers or
|
||||
* there are active jobs, polling, browsing for remote printers or
|
||||
* shared printers to advertise...
|
||||
*/
|
||||
|
||||
if ((cupsArrayCount(ActiveJobs) || NumPolled ||
|
||||
(Browsing &&
|
||||
if ((cupsArrayCount(ActiveJobs) || NumPolled ||
|
||||
(Browsing &&
|
||||
(BrowseRemoteProtocols ||
|
||||
(BrowseLocalProtocols && NumBrowsers && cupsArrayCount(Printers))))))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"Creating launchd keepalive file \"" CUPS_KEEPALIVE
|
||||
"\"...");
|
||||
"Creating launchd keepalive file \"" CUPS_KEEPALIVE "\"...");
|
||||
|
||||
if ((fd = open(CUPS_KEEPALIVE, O_RDONLY | O_CREAT | O_EXCL, S_IRUSR)) >= 0)
|
||||
close(fd);
|
||||
@@ -1636,8 +1630,7 @@ launchd_checkout(void)
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"Removing launchd keepalive file \"" CUPS_KEEPALIVE
|
||||
"\"...");
|
||||
"Removing launchd keepalive file \"" CUPS_KEEPALIVE "\"...");
|
||||
|
||||
unlink(CUPS_KEEPALIVE);
|
||||
}
|
||||
@@ -1773,7 +1766,7 @@ process_children(void)
|
||||
job->printer_message = ippAddString(job->attrs, IPP_TAG_JOB,
|
||||
IPP_TAG_TEXT,
|
||||
"job-printer-state-message",
|
||||
NULL, NULL);
|
||||
NULL, "");
|
||||
}
|
||||
|
||||
if (job->printer_message)
|
||||
@@ -1787,7 +1780,7 @@ process_children(void)
|
||||
* filters are done, and if so move to the next file.
|
||||
*/
|
||||
|
||||
if (job->current_file < job->num_files && job->printer)
|
||||
if (job->current_file < job->num_files)
|
||||
{
|
||||
for (i = 0; job->filters[i] < 0; i ++);
|
||||
|
||||
@@ -1800,7 +1793,7 @@ process_children(void)
|
||||
cupsdContinueJob(job);
|
||||
}
|
||||
}
|
||||
else if (job->state_value >= IPP_JOB_CANCELED)
|
||||
else if (job->state_value == IPP_JOB_CANCELED)
|
||||
{
|
||||
/*
|
||||
* Remove the job from the active list if there are no processes still
|
||||
|
||||
@@ -649,10 +649,7 @@ cupsdDeleteAllPrinters(void)
|
||||
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
|
||||
p;
|
||||
p = (cupsd_printer_t *)cupsArrayNext(Printers))
|
||||
{
|
||||
p->op_policy_ptr = DefaultPolicyPtr;
|
||||
cupsdDeletePrinter(p, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3758,7 +3755,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */
|
||||
filter;
|
||||
filter = (mime_filter_t *)cupsArrayNext(MimeDatabase->filters))
|
||||
{
|
||||
if (filter->dst == p->filetype && filter->filter &&
|
||||
if (filter->dst == p->filetype && filter->filter &&
|
||||
strstr(filter->filter, "PrintJobMgr"))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -488,11 +488,8 @@ cupsdStartProcess(
|
||||
* Reset group membership to just the main one we belong to.
|
||||
*/
|
||||
|
||||
if (setgid(Group) && !RunUser)
|
||||
exit(errno);
|
||||
|
||||
if (setgroups(1, &Group) && !RunUser)
|
||||
exit(errno);
|
||||
setgid(Group);
|
||||
setgroups(1, &Group);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -508,7 +505,6 @@ cupsdStartProcess(
|
||||
#ifdef HAVE_SIGSET
|
||||
sigset(SIGTERM, SIG_DFL);
|
||||
sigset(SIGCHLD, SIG_DFL);
|
||||
sigset(SIGPIPE, SIG_DFL);
|
||||
#elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
@@ -517,11 +513,9 @@ cupsdStartProcess(
|
||||
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
sigaction(SIGCHLD, &action, NULL);
|
||||
sigaction(SIGPIPE, &action, NULL);
|
||||
#else
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
signal(SIGPIPE, SIG_DFL);
|
||||
#endif /* HAVE_SIGSET */
|
||||
|
||||
cupsdReleaseSignals();
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
*
|
||||
* 4. kqueue() - O(n)
|
||||
* b. cupsdStartSelect() creates kqueue file descriptor
|
||||
* using kqueue() function and allocates a global event
|
||||
* using kqyeue() function and allocates a global event
|
||||
* buffer.
|
||||
* c. cupsdAdd/RemoveSelect() uses EV_SET and kevent() to
|
||||
* register the changes. The event user data field is a
|
||||
@@ -144,7 +144,7 @@
|
||||
* d. cupsdDoSelect() uses kevent() to poll for events and
|
||||
* loops through the events, using the user data field to
|
||||
* find the callback record.
|
||||
* e. cupsdStopSelect() closes the kqueue() file descriptor
|
||||
* e. cupsdStopSelect() closes the kqyeye() file descriptor
|
||||
* and frees all of the memory used by the event buffer.
|
||||
*
|
||||
* 5. /dev/poll - O(n log n) - NOT YET IMPLEMENTED
|
||||
@@ -454,7 +454,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds */
|
||||
if (fdptr->read_cb && event->filter == EVFILT_READ)
|
||||
(*(fdptr->read_cb))(fdptr->data);
|
||||
|
||||
if (fdptr->use > 1 && fdptr->write_cb && event->filter == EVFILT_WRITE)
|
||||
if (fdptr->write_cb && event->filter == EVFILT_WRITE)
|
||||
(*(fdptr->write_cb))(fdptr->data);
|
||||
|
||||
release_fd(fdptr);
|
||||
@@ -499,8 +499,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds */
|
||||
if (fdptr->read_cb && (event->events & (EPOLLIN | EPOLLERR | EPOLLHUP)))
|
||||
(*(fdptr->read_cb))(fdptr->data);
|
||||
|
||||
if (fdptr->use > 1 && fdptr->write_cb &&
|
||||
(event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
|
||||
if (fdptr->write_cb && (event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
|
||||
(*(fdptr->write_cb))(fdptr->data);
|
||||
|
||||
release_fd(fdptr);
|
||||
@@ -591,8 +590,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds */
|
||||
if (fdptr->read_cb && (pfd->revents & (POLLIN | POLLERR | POLLHUP)))
|
||||
(*(fdptr->read_cb))(fdptr->data);
|
||||
|
||||
if (fdptr->use > 1 && fdptr->write_cb &&
|
||||
(pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
|
||||
if (fdptr->write_cb && (pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
|
||||
(*(fdptr->write_cb))(fdptr->data);
|
||||
|
||||
release_fd(fdptr);
|
||||
@@ -647,8 +645,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds */
|
||||
if (fdptr->read_cb && FD_ISSET(fdptr->fd, &cupsd_current_input))
|
||||
(*(fdptr->read_cb))(fdptr->data);
|
||||
|
||||
if (fdptr->use > 1 && fdptr->write_cb &&
|
||||
FD_ISSET(fdptr->fd, &cupsd_current_output))
|
||||
if (fdptr->write_cb && FD_ISSET(fdptr->fd, &cupsd_current_output))
|
||||
(*(fdptr->write_cb))(fdptr->data);
|
||||
|
||||
release_fd(fdptr);
|
||||
|
||||
+14
-5
@@ -31,7 +31,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <cups/globals.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/md5.h>
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -77,6 +79,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
groupline[17], /* Group from line */
|
||||
md5line[33], /* MD5-sum from line */
|
||||
md5new[33]; /* New MD5 sum */
|
||||
const char *root; /* CUPS server root directory */
|
||||
char passwdmd5[1024], /* passwd.md5 file */
|
||||
passwdold[1024], /* passwd.old file */
|
||||
passwdnew[1024]; /* passwd.tmp file */
|
||||
@@ -85,7 +88,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
int flag; /* Password check flags... */
|
||||
int fd; /* Password file descriptor */
|
||||
int error; /* Write error */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Signal action */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET*/
|
||||
@@ -111,11 +113,18 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
/*
|
||||
* Find the server directory...
|
||||
*
|
||||
* We use the CUPS_SERVERROOT environment variable when we are running
|
||||
* as root or when lppasswd is not setuid...
|
||||
*/
|
||||
|
||||
snprintf(passwdmd5, sizeof(passwdmd5), "%s/passwd.md5", cg->cups_serverroot);
|
||||
snprintf(passwdold, sizeof(passwdold), "%s/passwd.old", cg->cups_serverroot);
|
||||
snprintf(passwdnew, sizeof(passwdnew), "%s/passwd.new", cg->cups_serverroot);
|
||||
if ((root = getenv("CUPS_SERVERROOT")) == NULL ||
|
||||
(getuid() != geteuid() && getuid()))
|
||||
root = CUPS_SERVERROOT;
|
||||
|
||||
snprintf(passwdmd5, sizeof(passwdmd5), "%s/passwd.md5", root);
|
||||
snprintf(passwdold, sizeof(passwdold), "%s/passwd.old", root);
|
||||
snprintf(passwdnew, sizeof(passwdnew), "%s/passwd.new", root);
|
||||
|
||||
/*
|
||||
* Find the default system group...
|
||||
|
||||
+3
-3
@@ -1287,10 +1287,10 @@ show_jobs(const char *dests, /* I - Destinations */
|
||||
"job-id",
|
||||
"job-k-octets",
|
||||
"job-name",
|
||||
"job-originating-user-name",
|
||||
"time-at-creation",
|
||||
"job-printer-uri",
|
||||
"job-state-reasons",
|
||||
"time-at-creation"
|
||||
"job-originating-user-name",
|
||||
"job-state-reasons"
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
{?current_make!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE" VALUE="{current_make}">:}
|
||||
{?current_make_and_model!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{current_make_and_model}">:}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<H2 CLASS="title">Jobs</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/jobs/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Manage Jobs"></FORM>
|
||||
<FORM ACTION="/jobs/" METHDO="GET"><INPUT TYPE="SUBMIT" VALUE="Manage Jobs"></FORM>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
@@ -2,18 +2,21 @@
|
||||
|
||||
<H2 CLASS="title">{op=modify-printer?Modify {printer_name}:Add Printer}</H2>
|
||||
|
||||
{CUPS_GET_DEVICES_DONE?<FORM METHOD="POST" ACTION="/admin">
|
||||
{CUPS_GET_DEVICES_DONE?:<P><IMG SRC="/images/wait.gif" WIDTH="16" HEIGHT="16" ALIGN="ABSMIDDLE"
|
||||
ALT="Busy Indicator"> Looking for printers...</P>}
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
{printer_name?<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">:}
|
||||
|
||||
<TABLE>
|
||||
{op=add-printer?:<TR>
|
||||
<TH CLASS="label">Current Connection\:</TH>
|
||||
<TH CLASS="label">Current Connection:</TH>
|
||||
<TD><INPUT TYPE="RADIO" NAME="DEVICE_URI" VALUE="{current_device_uri}" CHECKED>
|
||||
{current_device_uri}</TD>
|
||||
</TR>}
|
||||
<TR>
|
||||
<TH CLASS="label">Local Printers\:</TH>
|
||||
<TH CLASS="label">Local Printers:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class!network?<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
@@ -22,7 +25,7 @@ VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Discovered Network Printers\:</TH>
|
||||
<TH CLASS="label">Discovered Network Printers:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class=network?{device_uri~[a-z]+://?<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
@@ -32,7 +35,7 @@ VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
</TR>
|
||||
<TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Other Network Printers\:</TH>
|
||||
<TH CLASS="label">Other Network Printers:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class=network?{device_uri~[a-z]+://?:<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
@@ -46,7 +49,5 @@ VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>:<P><IMG SRC="/images/wait.gif" WIDTH="16" HEIGHT="16" ALIGN="ABSMIDDLE"
|
||||
ALT="Busy Indicator"> Looking for printers...</P>}
|
||||
|
||||
</DIV>
|
||||
</FORM>
|
||||
</DIV>
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
{?current_make!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE" VALUE="{current_make}">:}
|
||||
{?current_make_and_model!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{current_make_and_model}">:}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<H2 CLASS="title">Druckaufträge</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/jobs/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Aufträge verwalten"></FORM>
|
||||
<FORM ACTION="/jobs/" METHDO="GET"><INPUT TYPE="SUBMIT" VALUE="Aufträge verwalten"></FORM>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
@@ -45,7 +45,7 @@ Diesen Drucker {?printer_is_shared=?nicht:{?printer_is_shared=0?nicht:}} freigeb
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Oder stellen Sie eine PPD Datei bereit:</TH>
|
||||
<TH CLASS="label">>Oder stellen Sie eine PPD Datei bereit:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
<H2 CLASS="title">Klasse {printer_name} löschen</H2>
|
||||
|
||||
<P><B>Warnung:</B> Sind Sie sicher, dass Sie die Klasse
|
||||
{printer_name} löschen wollen?</P>
|
||||
<P><B>Warning:</B> Sind Sie sicher Sie wollen die Klasse
|
||||
{printer_name} löschen?</P>
|
||||
|
||||
<P ALIGN="CENTER"><FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="op" VALUE="delete-class"><INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}"><INPUT TYPE="SUBMIT" NAME="confirm" VALUE="Klasse löschen"></FORM></P>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ AUTOSAVE="org.cups.help" RESULTS="20">
|
||||
<DIV CLASS="sidebar"><TABLE CLASS="inset" SUMMARY="Inhalt">
|
||||
<TR><TD>
|
||||
|
||||
<H3 CLASS="title">Online Hilfe Dokumente</H3>
|
||||
<H3 CLASS="title">On-Line Hilfe Dokumente</H3>
|
||||
|
||||
<P CLASS="l0"><A HREF="/help/{QUERY??QUERY={QUERY}:}">Alle Dokumente</A></P>
|
||||
<HR>
|
||||
@@ -46,6 +46,6 @@ Erfahrene Benutzer sollten "<a href="/help/whatsnew.html">Was ist neu in CUPS
|
||||
1.4</a>" lesen.</P>
|
||||
|
||||
<P>Die <A HREF="http://www.cups.org/">CUPS Webseite</A> bietet
|
||||
ebenfalls viele Angebote inklusive Diskussionsforen fü Benutzer,
|
||||
ebenfalls viele Angebote inklusive Benutzer Diskussionsforen,
|
||||
Antworten auf häufig gestellte Fragen, und ein Formular für
|
||||
Fehlerberichte und Wünsche.</P>}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<TD>{job_media_sheets_completed=0?Unbekannt:{?job_media_sheets_completed}} </TD>
|
||||
<TD>{job_state=3?unerledigt seit<BR>{time_at_creation}:{job_state=4?angehalten seit<BR>{time_at_creation}:
|
||||
{job_state=5?verarbeitet seit<BR>{time_at_processing}:{job_state=6?gestoppt:
|
||||
{job_state=7?gelöscht am<BR>{time_at_completed}:{job_state=8?abgebrochen:beendet am<BR>{time_at_completed}}}}}}} {job_printer_state_message?<BR>
|
||||
{job_state=7?getlöscht am<BR>{time_at_completed}:{job_state=8?abgebrochen:beendet am<BR>{time_at_completed}}}}}}} {job_printer_state_message?<BR>
|
||||
<EM>"{job_printer_state_message}"</EM>:}</TD>
|
||||
<TD>
|
||||
{job_preserved>0?{job_state>5?
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
|
||||
<TABLE>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<P><B>Error:</B> The following options are conflicting:</P>
|
||||
|
||||
<UL>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A>: {cchoice}</LI>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A></LI>
|
||||
}</UL>
|
||||
|
||||
<P>Bitte ändern sie eine oder mehrere Einstellungen um die Konflikte zu lösen.</P>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
<H2 CLASS="title">Drucker {printer_name} löschen</H2>
|
||||
|
||||
<P><B>Warnung:</B> Sind Sie sicher, dass Sie den Drucker
|
||||
{printer_name} löschen wollen?</P>
|
||||
<P><B>Warnung:</B> Sind sie sicher sie wollen den Drucker
|
||||
{printer_name} löschen?</P>
|
||||
|
||||
<P ALIGN="CENTER"><FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="delete-printer"><INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}"><INPUT TYPE="SUBMIT" NAME="confirm" VALUE="Drucker löschen"></FORM></P>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>
|
||||
({printer_state=3?Frei:{printer_state=4?Beschäftigt:Angehalten}},
|
||||
({printer_state=3?Frei:{printer_state=4?Beschäftig:Angehalten}},
|
||||
{printer_is_accepting_jobs=0?Aufträge werden ablehnt:Aufträge werden akzeptiert},
|
||||
{server_is_sharing_printers=0?Nicht:{printer_is_shared=0?Nicht:}} freigegeben{default_name={printer_name}?, Standarddrucker:})</H2>
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
{?current_make!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE" VALUE="{current_make}">:}
|
||||
{?current_make_and_model!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{current_make_and_model}">:}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<H2 CLASS="title">Trabajos</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/jobs/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Administrar trabajos"></FORM>
|
||||
<FORM ACTION="/jobs/" METHDO="GET"><INPUT TYPE="SUBMIT" VALUE="Administrar trabajos"></FORM>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
|
||||
<TABLE>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<P><B>Error:</B> Las siguientes opciones están en conflicto:</P>
|
||||
|
||||
<UL>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A>: {cchoice}</LI>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A></LI>
|
||||
}</UL>
|
||||
|
||||
<P>Cambie una o más de las opciones para resolver el problema.</P>
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
{?current_make!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE" VALUE="{current_make}">:}
|
||||
{?current_make_and_model!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{current_make_and_model}">:}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<H2 CLASS="title">Lanak</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/jobs/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Kudeatu lanak"></FORM>
|
||||
<FORM ACTION="/jobs/" METHDO="GET"><INPUT TYPE="SUBMIT" VALUE="Kudeatu lanak"></FORM>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
|
||||
<TABLE>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<P><B>Errorea:</B> honako aukerak gatazkan daude:</P>
|
||||
|
||||
<UL>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A>: {cchoice}</LI>
|
||||
{[ckeyword]<LI><A HREF="#{ckeyword}">{ckeytext}</A></LI>
|
||||
}</UL>
|
||||
|
||||
<P>Aldatu aukera bat edo gehiago gatazkak ebazteko.</P>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">Tambah Kelas</H2>
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Nama:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(Karakter apa saja yang dapat dicetak, kecuali "/", "#", dan spasi)</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Deskripsi:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(Deskripsi yang mudah dibaca, seperti "HP LaserJet dengan Duplexer")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Lokasi:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(Lokasi yang mudah dibaca, seperti "Lab 1")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Anggota:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="MEMBER_URIS" SIZE="10" MULTIPLE>
|
||||
{[member_uris]<OPTION VALUE="{member_uris}" {?member_selected}>{member_names}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="Tambah Kelas"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
@@ -1,42 +0,0 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">Add Printer</H2>
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
{?current_make!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE" VALUE="{current_make}">:}
|
||||
{?current_make_and_model!?<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{current_make_and_model}">:}
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Nama:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127" VALUE="{?template_name}"><BR>
|
||||
<SMALL>(Karakter apa saja yang dapat dicetak, kecuali "/", "#", dan spasi)</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Deskripsi:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127" VALUE="{?PRINTER_INFO}"><BR>
|
||||
<SMALL>(Deskripsi yang mudah dibaca, seperti "HP LaserJet dengan Duplexer")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Location:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127" VALUE="{?PRINTER_LOCATION}"><BR>
|
||||
<SMALL>(Lokasi yang mudah dibaca, seperti "Lab 1")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Koneksi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Berbagi:</TH>
|
||||
<TD><INPUT TYPE="CHECKBOX" NAME="PRINTER_IS_SHARED" {PRINTER_IS_SHARED=1?CHECKED:}>
|
||||
Berbagi Pencetak Ini</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="Lanjut"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
@@ -1,43 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="add-rss-subscription">
|
||||
|
||||
<H2 CLASS="title">Tambah Subskripsi RSS</H2>
|
||||
|
||||
<TABLE SUMMARY="Add RSS Subscription form">
|
||||
<TR>
|
||||
<TH CLASS="label">Nama:</TH>
|
||||
<TD COLSPAN="5"><INPUT TYPE="TEXT" NAME="SUBSCRIPTION_NAME" SIZE="40" MAXLENGTH="127" VALUE="{?SUBSCRIPTION_NAME}"><BR>
|
||||
<SMALL>(Karakter apa saja yang dapat dicetak, kecuali "/", "#", dan spasi)</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Antrian:</TH>
|
||||
<TD COLSPAN="5"><SELECT NAME="PRINTER_URI" SIZE="10"><OPTION VALUE="#ALL#"{?PRINTER_URI=#ALL#? SELECTED:}>Semua Antrian</OPTION>{[printer_name]<OPTION VALUE="{printer_uri_supported}"{?PRINTER_URI={printer_uri_supported}? SELECTED:}>{printer_name}</OPTION>}</SELECT></TD>
|
||||
</TR>
|
||||
<TR VALIGN="TOP">
|
||||
<TH CLASS="label">Kejadian:</TH>
|
||||
<TD><INPUT TYPE="CHECKBOX" NAME="EVENT_JOB_CREATED" {?EVENT_JOB_CREATED}>Tugas Dibuat<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_JOB_COMPLETED" {?EVENT_JOB_COMPLETED}>Tugas Selesai<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_JOB_STOPPED" {?EVENT_JOB_STOPPED}>Tugas Berhenti<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_JOB_CONFIG_CHANGED" {?EVENT_JOB_CONFIG_CHANGED}>Opsi Tugas Berubah</TD>
|
||||
<TD> </TD>
|
||||
<TD><INPUT TYPE="CHECKBOX" NAME="EVENT_PRINTER_STOPPED" {?EVENT_PRINTER_STOPPED}>Antrian Berhenti<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_PRINTER_ADDED" {?EVENT_PRINTER_ADDED}>Antrian Ditambah<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_PRINTER_MODIFIED" {?EVENT_PRINTER_MODIFIED}>Antrian Berubah<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_PRINTER_DELETED" {?EVENT_PRINTER_DELETED}>Antrian Dihapus</TD>
|
||||
<TD> </TD>
|
||||
<TD><INPUT TYPE="CHECKBOX" NAME="EVENT_SERVER_STARTED" {?EVENT_SERVER_STARTED}>Server Dimulai<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_SERVER_STOPPED" {?EVENT_SERVER_STOPPED}>Server Berhenti<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_SERVER_RESTARTED" {?EVENT_SERVER_RESTARTED}>Server Dijalankan Ulang<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="EVENT_SERVER_AUDIT" {?EVENT_SERVER_AUDIT}>Audit Keamanan Server</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Maksimal Kejadian dalam Berita:</TH>
|
||||
<TD COLSPAN="5"><INPUT TYPE="TEXT" NAME="MAX_EVENTS" SIZE="4" MAXLENGTH="4" VALUE="{MAX_EVENTS?{MAX_EVENTS}:20}"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD COLSPAN="5"><INPUT TYPE="SUBMIT" VALUE="Tambah Subskripsi RSS"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,109 +0,0 @@
|
||||
<TABLE CLASS="indent" SUMMARY="Administration Tasks">
|
||||
<TR><TD VALIGN="TOP">
|
||||
|
||||
<H2 CLASS="title">Pencetak</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="add-printer"><INPUT TYPE="SUBMIT" VALUE="Tambah Pencetak"></FORM>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="find-new-printers"><INPUT TYPE="SUBMIT" VALUE="Cari Pencetak Baru"></FORM>
|
||||
<FORM ACTION="/printers/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Atur Pencetak"></FORM>
|
||||
{have_samba?<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="export-samba"><INPUT TYPE="SUBMIT" VALUE="Ekspor Pencetak ke Samba"></FORM>:}
|
||||
</P>
|
||||
|
||||
<H2 CLASS="title">Kelas</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="add-class"><INPUT TYPE="SUBMIT" VALUE="Tambah Kelas"></FORM>
|
||||
<FORM ACTION="/classes/" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Atur Kelas"></FORM>
|
||||
</P>
|
||||
|
||||
<H2 CLASS="title">Tugas</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/jobs/" METHDO="GET"><INPUT TYPE="SUBMIT" VALUE="Atur Tugas"></FORM>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
<H2 CLASS="title">Server</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server"><INPUT TYPE="SUBMIT" VALUE="Sunting Berkas Konfigurasi"></FORM>
|
||||
<FORM ACTION="/admin/log/access_log" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Lihat Log Akses"></FORM>
|
||||
<FORM ACTION="/admin/log/error_log" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Lihat Log Kesalahan"></FORM>
|
||||
<FORM ACTION="/admin/log/page_log" METHOD="GET"><INPUT TYPE="SUBMIT" VALUE="Lihat Log Halaman"></FORM>
|
||||
</P>
|
||||
|
||||
{SETTINGS_ERROR?<P>{SETTINGS_MESSAGE}</P>
|
||||
<BLOCKQUOTE>{SETTINGS_ERROR}</BLOCKQUOTE>:
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
|
||||
{ADVANCEDSETTINGS?<P><B>Pengaturan Server\:</B></P>
|
||||
|
||||
<P><A HREF="/admin/">Lanjutan <SMALL>▼</SMALL></A><BR>
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server">
|
||||
<INPUT TYPE="HIDDEN" NAME="ADVANCEDSETTINGS" VALUE="YES">
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_PRINTERS" {?remote_printers}> Lihat pencetak yang dibagikan oleh sistem lain<BR>
|
||||
Protokol\:
|
||||
<INPUT TYPE="CHECKBOX" NAME="BROWSE_REMOTE_CUPS" {?browse_remote_cups}> CUPS
|
||||
{HAVE_LDAP?<INPUT TYPE="CHECKBOX" NAME="BROWSE_REMOTE_LDAP" {?browse_remote_ldap}> LDAP:}
|
||||
{HAVE_LIBSLP?<INPUT TYPE="CHECKBOX" NAME="BROWSE_REMOTE_SLP" {?browse_remote_slp}> SLP:}<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Bagikan pencetak yang terhubung ke sistem ini<BR>
|
||||
Klien maks.\:
|
||||
<INPUT TYPE="TEXT" NAME="MAX_CLIENTS" VALUE="{?max_clients}" SIZE="6"><BR>
|
||||
Protokol\:
|
||||
<INPUT TYPE="CHECKBOX" NAME="BROWSE_LOCAL_CUPS" {?browse_local_cups}> CUPS
|
||||
{HAVE_DNSSD?<INPUT TYPE="CHECKBOX" NAME="BROWSE_LOCAL_DNSSD" {?browse_local_dnssd}> DNS-SD:}
|
||||
{HAVE_LDAP?<INPUT TYPE="CHECKBOX" NAME="BROWSE_LOCAL_LDAP" {?browse_local_ldap}> LDAP:}
|
||||
{HAVE_LIBSLP?<INPUT TYPE="CHECKBOX" NAME="BROWSE_LOCAL_SLP" {?browse_local_slp}> SLP:}<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Perbolehkan mencetak dari Internet<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="BROWSE_WEB_IF" {?browse_web_if}> Advertise web interface<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Perbolehkan administrasi dari jarak jauh<BR>
|
||||
{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Gunakan otentikasi Kerberos (<A HREF="/help/kerberos.html?TOPIC=Getting+Started">FAQ</A>)<BR>:}
|
||||
<INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Perbolehkan pengguna biasa untuk membatalkan semua tugas (termasuk tugas orang lain)<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="PRESERVE_JOB_HISTORY" {?preserve_job_history}> Catat histori tugas<BR>
|
||||
Banyaknya tugas\:
|
||||
<INPUT TYPE="TEXT" NAME="MAX_JOBS" VALUE="{?max_jobs}" SIZE="6"><BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="PRESERVE_JOB_FILES" {?preserve_job_files}> Catat berkas tugas cetak<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Simpan informasi kesalahan untuk mencari dan memecahkan masalah<BR>
|
||||
Ukuran maks. berkas log\:
|
||||
<INPUT TYPE="TEXT" NAME="MAX_LOG_SIZE" VALUE="{?max_log_size}" SIZE="6"></P>
|
||||
|
||||
:<P><B>Pengaturan Server:</B></P>
|
||||
|
||||
<P><A HREF="/admin/?ADVANCEDSETTINGS=YES">Lanjutan <SMALL>▶</SMALL></A><BR>
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server">
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_PRINTERS" {?remote_printers}> Lihat pencetak yang dibagikan oleh sistem lain<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Bagikan pencetak yang terhubung ke sistem ini<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Perbolehkan mencetak dari Internet<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Perbolehkan administrasi dari jarak jauh<BR>
|
||||
{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Gunakan otentikasi Kerberos (<A HREF="/help/kerberos.html?TOPIC=Getting+Started">FAQ</A>)<BR>:}
|
||||
<INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Perbolehkan pengguna biasa untuk membatalkan semua tugas (termasuk tugas orang lain)<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Save debugging information for troubleshooting</P>
|
||||
|
||||
}
|
||||
<P><INPUT TYPE="SUBMIT" NAME="CHANGESETTINGS" VALUE="Ubah Pengaturan"></P>
|
||||
|
||||
</FORM>}
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">Subskripsi RSS</H2>
|
||||
|
||||
<P>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="add-rss-subscription"><INPUT TYPE="SUBMIT" VALUE="Tambah Subskripsi RSS"></FORM>
|
||||
</P>
|
||||
|
||||
</DIV>
|
||||
|
||||
{notify_subscription_id?<TABLE CLASS="list" SUMMARY="RSS Subscriptions">
|
||||
<THEAD><TR><TH>Nama</TH><TH>Kejadian</TH><TH>Nama Antrian</TH></TR></THEAD>
|
||||
<TBODY>{[notify_subscription_id]
|
||||
<TR><TD><A HREF="{notify_recipient_uri}">{notify_recipient_name}</A><BR>
|
||||
<FORM ACTION="/admin/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="cancel-subscription"><INPUT TYPE="HIDDEN" NAME="notify_subscription_id" VALUE="{notify_subscription_id}"><INPUT TYPE="SUBMIT" VALUE="Cancel RSS Subscription"></FORM> </TD><TD>{notify_events}</TD><TD NOWRAP> {notify_printer_name?{notify_printer_name}:Semua Antrian}</TD></TR>}
|
||||
</TBODY>
|
||||
</TABLE>:}
|
||||
@@ -1,53 +0,0 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">{op=modify-printer?Ubah {printer_name}:Tambah Pencetak}</H2>
|
||||
|
||||
{CUPS_GET_DEVICES_DONE?:<P><IMG SRC="/images/wait.gif" WIDTH="16" HEIGHT="16" ALIGN="ABSMIDDLE"
|
||||
ALT="Busy Indicator"> Mencari pencetak...</P>}
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
{printer_name?<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">:}
|
||||
|
||||
<TABLE>
|
||||
{op=add-printer?:<TR>
|
||||
<TH CLASS="label">Koneksi yang Ada:</TH>
|
||||
<TD><INPUT TYPE="RADIO" NAME="DEVICE_URI" VALUE="{current_device_uri}" CHECKED>
|
||||
{current_device_uri}</TD>
|
||||
</TR>}
|
||||
<TR>
|
||||
<TH CLASS="label">Pencetak Lokal:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class!network?<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
{device_info} {?device_make_and_model!Unknown?({device_make_and_model}):}<BR>
|
||||
:}}
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Pencetak Jaringan yang Ditemukan:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class=network?{device_uri~[a-z]+://?<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
{device_info} {?device_make_and_model!Unknown?({device_make_and_model}):}<BR>
|
||||
:}:}}
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Pencetak Jaringan Lainnya:</TH>
|
||||
<TD>
|
||||
{[device_uri]{device_class=network?{device_uri~[a-z]+://?:<INPUT TYPE="RADIO" NAME="DEVICE_URI"
|
||||
VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}">
|
||||
{device_info} {?device_make_and_model!Unknown?({device_make_and_model}):}<BR>
|
||||
}:}}
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="Lanjut"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
@@ -1,63 +0,0 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">{op=modify-printer?Ubah {printer_name}:Tambah Pencetak}</H2>
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
{printer_name?<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">:}
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
|
||||
<TABLE>
|
||||
{op=modify-printer?:<TR>
|
||||
<TH CLASS="label">Nama:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">{printer_name}</TD>
|
||||
</TR>}
|
||||
<TR>
|
||||
<TH CLASS="label">Deskripsi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{printer_info}">{printer_info}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Lokasi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{printer_location}">{printer_location}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Koneksi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Berbagi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_IS_SHARED" VALUE="{?printer_is_shared}">
|
||||
{?printer_is_shared=?Do Not:{?printer_is_shared=0?Do Not:}} Share This Printer</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Buatan:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="PPD_MAKE" SIZE="10">
|
||||
{[ppd_make]<OPTION VALUE="{ppd_make}" {?current_make={ppd_make}?SELECTED:}>{ppd_make}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="Lanjut"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Atau, Sediakan Berkas PPD:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="{op=add-printer?Tambah Pencetak:Ubah Pencetak}"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
@@ -1,59 +0,0 @@
|
||||
<DIV CLASS="indent">
|
||||
|
||||
<H2 CLASS="title">{op=modify-printer?Modify {printer_name}:Tambah Pencetak}</H2>
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
{printer_name?<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">:}
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
<TABLE>
|
||||
{op=modify-printer?:<TR>
|
||||
<TH CLASS="label">Nama:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">{printer_name}</TD>
|
||||
</TR>}
|
||||
<TR>
|
||||
<TH CLASS="label">Deskripsi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{printer_info}">{printer_info}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Lokasi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{printer_location}">{printer_location}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Koneksi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">{device_uri}</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Berbagi:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="PRINTER_IS_SHARED" VALUE="{?printer_is_shared}">
|
||||
{?printer_is_shared=?Jangan:{?printer_is_shared=0?Jangan:}} Berbagi Pencetak Ini</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Pembuat:</TH>
|
||||
<TD>{PPD_MAKE} <INPUT TYPE="SUBMIT" NAME="SELECT_MAKE" VALUE="Pilih Manufaktur/Pembuat Lainnya"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Model:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="PPD_NAME" SIZE="10">
|
||||
{op=add-printer?:<OPTION VALUE="__no_change__" SELECTED>Penggerak Saat Ini - {current_make_and_model}</OPTION>:}
|
||||
{[ppd_name]<OPTION VALUE="{ppd_name}" {op=modify-printer?:{?current_make_and_model={ppd_make_and_model}?SELECTED:}}>{ppd_make_and_model} ({ppd_natural_language})
|
||||
}</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Atau Sediakan Berkas PPD:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="SUBMIT" VALUE="{op=add-printer?Tambah Pencetak:Ubah Pencetak}"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
</DIV>
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário