Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 8ef505f309 Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.0.1@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
66 arquivos alterados com 2144 adições e 1339 exclusões
-1
Ver Arquivo
@@ -44,7 +44,6 @@ RANLIB = @RANLIB@
RM = @RM@ -f
SED = @SED@
SHELL = /bin/sh
SMBCLIENT = @SMBCLIENT@
#
# Libraries...
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
README - CUPS v1.0 - 10/01/1999
-------------------------------
README - CUPS v1.0.1 - 10/26/1999
---------------------------------
INTRODUCTION
+12 -2
Ver Arquivo
@@ -24,8 +24,8 @@
include ../Makedefs
TARGETS = ipp lpd parallel serial socket
OBJS = ipp.o lpd.o parallel.o serial.o socket.o
TARGETS = betest ipp lpd parallel serial socket
OBJS = betest.o ipp.o lpd.o parallel.o serial.o socket.o
#
# Make all targets...
@@ -50,6 +50,16 @@ install:
-$(LN) ipp $(SERVERROOT)/backend/http
$(CHMOD) u+s $(SERVERROOT)/backend/lpd
#
# betest
#
betest: betest.o ../cups/$(LIBCUPS)
echo Linking $@...
$(CC) $(LDFLAGS) -o betest betest.o $(LIBS)
betest.o: ../cups/string.h ../Makedefs
#
# ipp
#
+85
Ver Arquivo
@@ -0,0 +1,85 @@
/*
* "$Id$"
*
* Backend test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-1999 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* main() - Run the named backend.
*/
/*
* Include necessary headers.
*/
#include <stdio.h>
#include <stdlib.h>
#include <cups/string.h>
#include <unistd.h>
/*
* 'main()' - Run the named backend.
*
* Usage:
*
* betest device-uri job-id user title copies options [file]
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (7 or 8) */
char *argv[]) /* I - Command-line arguments */
{
char backend[255]; /* Method in URI */
if (argc < 7 || argc > 8)
{
fputs("Usage: betest device-uri job-id user title copies options [file]\n",
stderr);
return (1);
}
/*
* Extract the method from the device-uri - that's the program we want to
* execute.
*/
if (sscanf(argv[1], "%254[^:]", backend) != 1)
{
fputs("betest: Bad device-uri - no colon!\n", stderr);
return (1);
}
/*
* Execute and return
*/
execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7],
NULL);
return (1);
}
/*
* End of "$Id$".
*/
+20 -10
Ver Arquivo
@@ -133,7 +133,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
request->request.op.operation_id = IPP_PRINT_JOB;
request->request.op.request_id = 1;
sprintf(uri, "%s://%s:%d%s", method, hostname, port, resource);
snprintf(uri, sizeof(uri), "%s://%s:%d%s", method, hostname, port, resource);
language = cupsLangDefault();
@@ -166,7 +166,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
if (fp != stdin)
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
for (i = 0; i < num_options; i ++)
{
@@ -174,7 +175,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Skip the "raw" option - handled above...
*/
if (strcmp(options[i].name, "raw") == 0)
if (strcasecmp(options[i].name, "raw") == 0)
continue;
/*
@@ -218,7 +219,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
else
{
if (strncmp(option, "no", 2) == 0)
if (strncasecmp(option, "no", 2) == 0)
{
option += 2;
n = 0;
@@ -249,9 +250,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
{
n2 = strtol(s + 1, &s, 0);
if (strcmp(s, "dpc") == 0)
if (strcasecmp(s, "dpc") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
else if (strcmp(s, "dpi") == 0)
else if (strcasecmp(s, "dpi") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_INCH, n, n2);
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, option, NULL, val);
@@ -272,8 +273,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
if (fp != stdin)
{
@@ -369,9 +373,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else
{
response = NULL;
httpFlush(http);
fprintf(stderr, "ERROR: Print request was not accepted (%d)!\n", status);
if (status == HTTP_ERROR)
{
fprintf(stderr, "WARNING: Did not receive the IPP response (%d)\n",
errno);
status = HTTP_OK;
}
else
fprintf(stderr, "ERROR: Print request was not accepted (%d)!\n", status);
}
break;
+12 -7
Ver Arquivo
@@ -125,7 +125,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fclose(fp);
}
else
strcpy(filename, argv[6]);
{
strncpy(filename, argv[6], sizeof(filename) - 1);
filename[sizeof(filename) - 1] = '\0';
}
/*
* Extract the hostname and printer name from the URI...
@@ -175,7 +178,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
*/
va_start(ap, format);
bytes = vsprintf(buf, format, ap);
bytes = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
fprintf(stderr, "DEBUG: lpd_command %02.2x %s", buf[0], buf + 1);
@@ -308,19 +311,21 @@ lpd_queue(char *hostname, /* I - Host to connect to */
gethostname(localhost, sizeof(localhost));
localhost[31] = '\0'; /* RFC 1179, Section 7.2 - host name < 32 chars */
sprintf(control, "H%s\nP%s\n", localhost, user);
snprintf(control, sizeof(control), "H%s\nP%s\n", localhost, user);
cptr = control + strlen(control);
while (copies > 0)
{
sprintf(cptr, "ldfA%03.3d%s\n", getpid() % 1000, localhost);
snprintf(cptr, sizeof(control) - (cptr - control), "ldfA%03.3d%s\n",
getpid() % 1000, localhost);
cptr += strlen(cptr);
copies --;
}
sprintf(cptr, "UdfA%03.3d%s\nNdfA%03.3d%s\n",
getpid() % 1000, localhost,
getpid() % 1000, localhost);
snprintf(cptr, sizeof(control) - (cptr - control),
"UdfA%03.3d%s\nNdfA%03.3d%s\n",
getpid() % 1000, localhost,
getpid() % 1000, localhost);
fprintf(stderr, "DEBUG: Control file is:\n%s", control);
+2 -1
Ver Arquivo
@@ -411,7 +411,8 @@ show_status(http_t *http, /* I - HTTP connection to server */
"attributes-natural-language", NULL,
language->language);
sprintf(printer_uri, "ipp://localhost/printers/%s", printer);
snprintf(printer_uri, sizeof(printer_uri),
"ipp://localhost/printers/%s", printer);
attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
+5 -5
Ver Arquivo
@@ -219,7 +219,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
}
else
{
sprintf(resource, "ipp://localhost/printers/%s", dest);
snprintf(resource, sizeof(resource), "ipp://localhost/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
NULL, resource);
@@ -237,7 +237,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
*/
if (!longstatus)
puts("Rank\tPri Owner Job Files Total Size");
puts("Rank\tPri Owner Job Files Total Size");
jobcount = 0;
@@ -338,7 +338,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
}
printf("[job %03dlocalhost]\n", jobid);
printf("\t%-33s%d bytes\n", jobname, jobsize);
printf("\t%-32.32s %d bytes\n", jobname, jobsize);
}
else
{
@@ -350,8 +350,8 @@ show_jobs(http_t *http, /* I - HTTP connection to server */
rank ++;
}
printf(" %-5d%-7.7s%-7d%-19s%d bytes\n", jobpriority, jobuser, jobid,
jobname, jobsize);
printf(" %-4d %-10.10s %-6d %-18.18s %d bytes\n", jobpriority, jobuser,
jobid, jobname, jobsize);
}
if (attr == NULL)
break;
+46 -4
Ver Arquivo
@@ -23,7 +23,8 @@
*
* Contents:
*
* main() - Parse options and send files for printing.
* main() - Parse options and send files for printing.
* sighandler() - Signal catcher for when we print from stdin...
*/
/*
@@ -35,6 +36,25 @@
#include <cups/cups.h>
#ifndef WIN32
# include <signal.h>
/*
* Local functions.
*/
void sighandler(void);
#endif /* !WIN32 */
/*
* Globals...
*/
char tempfile[1024]; /* Temporary file for printing from stdin */
/*
* 'main()' - Parse options and send files for printing.
*/
@@ -54,7 +74,6 @@ main(int argc, /* I - Number of command-line arguments */
cups_option_t *options; /* Options */
int silent, /* Silent or verbose output? */
deletefile; /* Delete file after print? */
char tempfile[1024]; /* Temporary file for printing from stdin */
char buffer[8192]; /* Copy buffer */
FILE *temp; /* Temporary file pointer */
@@ -190,7 +209,8 @@ main(int argc, /* I - Number of command-line arguments */
if (job_id < 1)
{
fprintf(stderr, "lpr: unable to print file \'%s\'.\n", argv[i]);
fprintf(stderr, "lpr: unable to print file \'%s\' - error code %x.\n",
argv[i], cupsLastError());
return (1);
}
else if (deletefile)
@@ -209,6 +229,10 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
#ifndef WIN32
signal(SIGTERM, sighandler);
#endif /* !WIN32 */
temp = fopen(cupsTempFile(tempfile, sizeof(tempfile)), "w");
if (temp == NULL)
@@ -238,7 +262,8 @@ main(int argc, /* I - Number of command-line arguments */
if (job_id < 1)
{
fputs("lpr: unable to print standard input.\n", stderr);
fprintf(stderr, "lpr: unable to print standard input - error code %x.\n",
cupsLastError());
return (1);
}
}
@@ -247,6 +272,23 @@ main(int argc, /* I - Number of command-line arguments */
}
#ifndef WIN32
/*
* 'sighandler()' - Signal catcher for when we print from stdin...
*/
void
sighandler(void)
{
/*
* Remove the temporary file we're using to print from stdin...
*/
unlink(tempfile);
}
#endif /* !WIN32 */
/*
* End of "$Id$".
*/
+21 -5
Ver Arquivo
@@ -65,6 +65,7 @@ main(int argc, /* I - Number of command-line arguments */
job_id = 0;
dest = cupsGetDefault();
response = NULL;
http = NULL;
/*
* Open a connection to the server...
@@ -146,7 +147,7 @@ main(int argc, /* I - Number of command-line arguments */
if (dest)
{
sprintf(uri, "ipp://localhost/printers/%s", dest);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
@@ -159,6 +160,9 @@ main(int argc, /* I - Number of command-line arguments */
uri);
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
/*
* Do the request and get back a response...
*/
@@ -170,10 +174,22 @@ main(int argc, /* I - Number of command-line arguments */
if (response != NULL)
{
if (response->request.status.status_code == IPP_NOT_FOUND)
fputs("lprm: Job or printer not found!\n", stderr);
else if (response->request.status.status_code > IPP_OK_CONFLICT)
fputs("lprm: Unable to cancel job(s)!\n", stderr);
switch (response->request.status.status_code)
{
case IPP_NOT_FOUND :
fputs("lprm: Job or printer not found!\n", stderr);
break;
case IPP_NOT_AUTHORIZED :
fputs("lprm: Not authorized to lprm job(s)!\n", stderr);
break;
case IPP_FORBIDDEN :
fprintf(stderr, "lprm: You don't own job ID %d!\n", job_id);
break;
default :
if (response->request.status.status_code > IPP_OK_CONFLICT)
fputs("lprm: Unable to lprm job(s)!\n", stderr);
break;
}
ippDelete(response);
}
+11 -10
Ver Arquivo
@@ -105,10 +105,10 @@ main(int argc, /* I - Number of command-line arguments */
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/printpro/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/printpro/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
@@ -216,7 +216,7 @@ show_class_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/classes/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Loop through the classes returned in the list and display
@@ -297,7 +297,7 @@ show_class_info(http_t *http,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/classes/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/classes/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -305,7 +305,7 @@ show_class_info(http_t *http,
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -341,7 +341,8 @@ show_class_info(http_t *http,
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
{
strcpy(uri, "http:");
strcpy(uri + 5, strchr(attr->values[0].string.text, '/'));
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
uri[sizeof(uri) - 1] = '\0';
}
/*
@@ -397,11 +398,11 @@ show_class_info(http_t *http,
"attributes-natural-language", NULL,
language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
jobs = cupsDoRequest(http, request, uri + 15);
jobs = cupsDoRequest(http, request, "/");
}
else
jobs = NULL;
+7 -8
Ver Arquivo
@@ -105,10 +105,10 @@ main(int argc, /* I - Number of command-line arguments */
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/printpro/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/printpro/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
@@ -217,7 +217,7 @@ show_job_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/jobs/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Do a table for the jobs...
@@ -386,14 +386,14 @@ show_job_info(http_t *http, /* I - Server connection */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/jobs/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri);
/*
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -507,8 +507,7 @@ show_job_info(http_t *http, /* I - Server connection */
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
if (attr->group_tag != IPP_TAG_JOB &&
attr->group_tag != IPP_TAG_EXTENSION)
if (attr->group_tag != IPP_TAG_JOB)
continue;
if (strcmp(attr->name, "job-uri") == 0 ||
+11 -10
Ver Arquivo
@@ -105,10 +105,10 @@ main(int argc, /* I - Number of command-line arguments */
puts("<LINK REL=STYLESHEET TYPE=\"text/css\" HREF=\"/cups.css\">");
puts("<MAP NAME=\"navbar\">");
#ifdef ESPPRINTPRO
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"10,10,76,30\" HREF=\"/printers\" ALT=\"Current Printer Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"88,10,158,30\" HREF=\"/classes\" ALT=\"Current Printer Classes Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"170,10,210,30\" HREF=\"/jobs\" ALT=\"Current Jobs Status\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"222,10,354,30\" HREF=\"/documentation.html\" ALT=\"Read CUPS Documentation On-Line\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"366,10,442,30\" HREF=\"http://www.easysw.com/printpro/software.html\" ALT=\"Download the Current ESP Print Pro Software\">");
puts("<AREA SHAPE=\"RECT\" COORDS=\"454,10,530,30\" HREF=\"http://www.easysw.com/printpro/support.html\" ALT=\"Get Tech Support for Current ESP Print Pro\">");
#else
@@ -216,7 +216,7 @@ show_printer_list(http_t *http, /* I - HTTP connection */
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, "/printers/")) != NULL)
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
/*
* Loop through the printers returned in the list and display
@@ -297,7 +297,7 @@ show_printer_info(http_t *http,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -305,7 +305,7 @@ show_printer_info(http_t *http,
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(http, request, uri + 15)) == NULL)
if ((response = cupsDoRequest(http, request, "/")) == NULL)
{
puts("<P>Unable to communicate with CUPS server!");
return;
@@ -341,7 +341,8 @@ show_printer_info(http_t *http,
if ((attr = ippFindAttribute(response, "printer-uri-supported", IPP_TAG_URI)) != NULL)
{
strcpy(uri, "http:");
strcpy(uri + 5, strchr(attr->values[0].string.text, '/'));
strncpy(uri + 5, strchr(attr->values[0].string.text, '/'), sizeof(uri) - 6);
uri[sizeof(uri) - 1] = '\0';
}
/*
@@ -399,11 +400,11 @@ show_printer_info(http_t *http,
"attributes-natural-language", NULL,
language->language);
sprintf(uri, "ipp://localhost/printers/%s", name);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", name);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
jobs = cupsDoRequest(http, request, uri + 15);
jobs = cupsDoRequest(http, request, "/");
}
else
jobs = NULL;
+8 -1
Ver Arquivo
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.0b9"
#define CUPS_SVERSION "CUPS v1.0.1"
/*
* Where are files stored?
@@ -82,6 +82,13 @@
#undef HAVE_STRCASECMP
#undef HAVE_STRNCASECMP
/*
* Do we have the (v)snprintf() functions?
*/
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
/*
* What signal functions to use?
*/
+22 -14
Ver Arquivo
@@ -45,8 +45,8 @@ CFLAGS="${CFLAGS:=}"
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],[if eval "test x$enable_debug = xyes"; then
OPTIM="-g "
fi])
AC_ARG_ENABLE(shared, [ --disable-shared turn off shared libraries [default=no]])
if test "$disable_shared" != "yes"; then
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
if test "$enable_shared" != "no"; then
case "$uname" in
SunOS* | UNIX_S*)
LIBCUPS="libcups.so.1"
@@ -58,7 +58,12 @@ if test "$disable_shared" != "yes"; then
LIBCUPSIMAGE="libcupsimage.sl.1"
DSO="ld -b -z +h \$@ -o"
;;
OSF1* | Linux* | FreeBSD*)
FreeBSD* | NetBSD* | OpenBSD*)
LIBCUPS="libcups.so.1"
LIBCUPSIMAGE="libcupsimage.so.1"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
OSF1* | Linux*)
LIBCUPS="libcups.so.1"
LIBCUPSIMAGE="libcupsimage.so.1"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
@@ -120,12 +125,6 @@ fi
AC_SUBST(CAT)
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(SMBCLIENT,smbclient)
if test "$SMBCLIENT" = ""; then
echo "Looking for smbclient in standard locations..."
AC_PATH_PROG(SMBCLIENT,smbclient,samba_not_detected,
/usr/samba/bin:/usr/local/samba/bin:/usr/freeware/samba/bin:/opt/samba/bin)
fi
dnl Architecture checks...
AC_C_BIGENDIAN
@@ -160,16 +159,23 @@ AC_SUBST(LIBPNG)
AC_SUBST(LIBTIFF)
AC_SUBST(LIBZ)
AC_CHECK_HEADER(jpeglib.h,
dnl AC_CHECK_HEADER(jpeglib.h,
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
AC_DEFINE(HAVE_LIBJPEG)
LIBJPEG="-ljpeg")
AC_CHECK_HEADER(png.h,
dnl AC_CHECK_HEADER(png.h,
AC_CHECK_LIB(png, png_read_info,
AC_DEFINE(HAVE_LIBPNG)
LIBPNG="-lpng")
AC_CHECK_HEADER(tiff.h,
dnl AC_CHECK_HEADER(tiff.h,
AC_CHECK_LIB(tiff, TIFFReadScanline,
AC_DEFINE(HAVE_LIBTIFF)
LIBTIFF="-ltiff")
AC_CHECK_HEADER(zlib.h,
dnl AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, deflateInit,
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz")
@@ -182,6 +188,8 @@ dnl Checks for string functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)
dnl Checks for signal functions.
AC_CHECK_FUNCS(sigset)
@@ -194,7 +202,7 @@ AC_CHECK_FUNCS(wait3)
dnl Update compiler options...
if test -n "$GXX"; then
if test -z "$OPTIM"; then
OPTIM="-O2"
OPTIM="-O2"
fi
if test $PICFLAG = 1; then
OPTIM="-fPIC $OPTIM"
+5
Ver Arquivo
@@ -64,6 +64,11 @@ case "`uname`" in
;;
esac
# Change to the root directory first, in case we are being run from a
# CD-ROM installation script...
cd /
# Start or stop the CUPS server based upon the first argument to the script.
case $1 in
start | restart | reload)
+25 -200
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: cups.spec 714 1999-10-01 14:40:53Z mike $"
# "$Id: cups.spec 755 1999-10-26 20:40:13Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
@@ -26,11 +26,11 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.0
Version: 1.0.1
Release: 0
Copyright: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/beta/cups-1.0-source.tar.gz
Source: ftp://ftp.easysw.com/pub/cups/1.0.1/cups-1.0.1-source.tar.gz
Url: http://www.cups.org
Packager: Michael Sweet <mike@easysw.com>
Vendor: Easy Software Products
@@ -80,16 +80,22 @@ mkdir -p $RPM_BUILD_ROOT/usr/share/locale
mkdir -p $RPM_BUILD_ROOT/var/cups
mkdir -p $RPM_BUILD_ROOT/var/cups/conf
mkdir -p $RPM_BUILD_ROOT/var/cups/logs
mkdir -p $RPM_BUILD_ROOT/var/logs
mkdir -p $RPM_BUILD_ROOT/var/log
ln -sf /var/cups/logs $RPM_BUILD_ROOT/var/logs/cups
ln -sf /var/cups/logs $RPM_BUILD_ROOT/var/log/cups
ln -sf /var/cups/conf $RPM_BUILD_ROOT/etc/cups
make prefix=$RPM_BUILD_ROOT/usr DATADIR=$RPM_BUILD_ROOT/usr/share/cups LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale SERVERROOT=$RPM_BUILD_ROOT/var/cups install
$RPM_BUILD_ROOT/etc/rc.d/init.d/cups
install -m 755 -o root -g root cups.sh $RPM_BUILD_ROOT/etc/rc.d/init.d/cups
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/bin/disable
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/bin/enable
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/lib/accept
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/lib/reject
ln -sf /usr/sbin/accept $RPM_BUILD_ROOT/usr/sbin/reject
ln -sf /usr/sbin/lpadmin $RPM_BUILD_ROOT/usr/lib/lpadmin
%post
/sbin/chkconfig --add cups
@@ -101,209 +107,28 @@ rm -rf $RPM_BUILD_ROOT
%files
/etc/rc.d/init.d/cups
%config /var/cups/conf/classes.conf
%config /var/cups/conf/cupsd.conf
%config /var/cups/conf/mime.convs
%config /var/cups/conf/mime.types
%config /var/cups/conf/printers.conf
/usr/bin/lpr
/usr/bin/lprm
/usr/bin/disable
/usr/bin/enable
/usr/bin/cancel
/usr/bin/lp
/usr/bin/lpstat
/usr/lib/accept
/usr/lib/libcups.so.1
/usr/lib/libcupsimage.so.1
/usr/lib/lpadmin
/usr/lib/reject
/usr/man/man1/backend.1
/usr/man/man1/filter.1
/usr/man/man1/lprm.1
/usr/man/man1/lpr.1
/usr/man/man1/lpstat.1
/usr/man/man1/lp.1
/usr/man/man1/cancel.1
/usr/man/man5/classes.conf.5
/usr/man/man5/cupsd.conf.5
/usr/man/man5/mime.convs.5
/usr/man/man5/mime.types.5
/usr/man/man5/printers.conf.5
/usr/man/man8/accept.8
/usr/man/man8/cupsd.8
/usr/man/man8/enable.8
/usr/man/man8/lpadmin.8
/usr/man/man8/lpc.8
/usr/man/man8/reject.8
/usr/man/man8/disable.8
/usr/sbin/accept
/usr/sbin/cupsd
/usr/sbin/lpadmin
/usr/sbin/lpc
/usr/sbin/reject
%config /var/cups/conf/*
/usr/bin/*
/usr/lib/*
/usr/man/*
/usr/sbin/*
%dir /usr/share/cups
/usr/share/cups/data/8859-1
/usr/share/cups/data/8859-14
/usr/share/cups/data/8859-15
/usr/share/cups/data/8859-2
/usr/share/cups/data/8859-3
/usr/share/cups/data/8859-4
/usr/share/cups/data/8859-5
/usr/share/cups/data/8859-6
/usr/share/cups/data/8859-7
/usr/share/cups/data/8859-8
/usr/share/cups/data/8859-9
/usr/share/cups/data/HPGLprolog
/usr/share/cups/data/psglyphs
/usr/share/cups/doc/cmp.html
/usr/share/cups/doc/cmp.pdf
/usr/share/cups/doc/cups.css
/usr/share/cups/doc/cupsdoc.css
/usr/share/cups/doc/documentation.html
/usr/share/cups/doc/idd.html
/usr/share/cups/doc/idd.pdf
/usr/share/cups/doc/images/classes.gif
/usr/share/cups/doc/images/cups-block-diagram.gif
/usr/share/cups/doc/images/cups-large.gif
/usr/share/cups/doc/images/cups-medium.gif
/usr/share/cups/doc/images/cups-small.gif
/usr/share/cups/doc/images/logo.gif
/usr/share/cups/doc/images/navbar.gif
/usr/share/cups/doc/images/printer-idle.gif
/usr/share/cups/doc/images/printer-processing.gif
/usr/share/cups/doc/images/printer-stopped.gif
/usr/share/cups/doc/index.html
/usr/share/cups/doc/overview.html
/usr/share/cups/doc/overview.pdf
/usr/share/cups/doc/sam.html
/usr/share/cups/doc/sam.pdf
/usr/share/cups/doc/sdd.html
/usr/share/cups/doc/sdd.pdf
/usr/share/cups/doc/ssr.html
/usr/share/cups/doc/ssr.pdf
/usr/share/cups/doc/stp.html
/usr/share/cups/doc/stp.pdf
/usr/share/cups/doc/sum.html
/usr/share/cups/doc/sum.pdf
/usr/share/cups/doc/svd.html
/usr/share/cups/doc/svd.pdf
/usr/share/cups/fonts/AvantGarde-Book
/usr/share/cups/fonts/AvantGarde-BookOblique
/usr/share/cups/fonts/AvantGarde-Demi
/usr/share/cups/fonts/AvantGarde-DemiOblique
/usr/share/cups/fonts/Bookman-Demi
/usr/share/cups/fonts/Bookman-DemiItalic
/usr/share/cups/fonts/Bookman-Light
/usr/share/cups/fonts/Bookman-LightItalic
/usr/share/cups/fonts/Courier
/usr/share/cups/fonts/Courier-Bold
/usr/share/cups/fonts/Courier-BoldOblique
/usr/share/cups/fonts/Courier-Oblique
/usr/share/cups/fonts/Helvetica
/usr/share/cups/fonts/Helvetica-Bold
/usr/share/cups/fonts/Helvetica-BoldOblique
/usr/share/cups/fonts/Helvetica-Narrow
/usr/share/cups/fonts/Helvetica-Narrow-Bold
/usr/share/cups/fonts/Helvetica-Narrow-BoldOblique
/usr/share/cups/fonts/Helvetica-Narrow-Oblique
/usr/share/cups/fonts/Helvetica-Oblique
/usr/share/cups/fonts/NewCenturySchlbk-Bold
/usr/share/cups/fonts/NewCenturySchlbk-BoldItalic
/usr/share/cups/fonts/NewCenturySchlbk-Italic
/usr/share/cups/fonts/NewCenturySchlbk-Roman
/usr/share/cups/fonts/Palatino-Bold
/usr/share/cups/fonts/Palatino-BoldItalic
/usr/share/cups/fonts/Palatino-Italic
/usr/share/cups/fonts/Palatino-Roman
/usr/share/cups/fonts/Symbol
/usr/share/cups/fonts/Times-Bold
/usr/share/cups/fonts/Times-BoldItalic
/usr/share/cups/fonts/Times-Italic
/usr/share/cups/fonts/Times-Roman
/usr/share/cups/fonts/Utopia-Bold
/usr/share/cups/fonts/Utopia-BoldItalic
/usr/share/cups/fonts/Utopia-Italic
/usr/share/cups/fonts/Utopia-Regular
/usr/share/cups/fonts/ZapfChancery-MediumItalic
/usr/share/cups/fonts/ZapfDingbats
/usr/share/cups/model/deskjet.ppd
/usr/share/cups/model/laserjet.ppd
/usr/share/cups/pstoraster/Fontmap
/usr/share/cups/pstoraster/gs_btokn.ps
/usr/share/cups/pstoraster/gs_ccfnt.ps
/usr/share/cups/pstoraster/gs_cidfn.ps
/usr/share/cups/pstoraster/gs_cmap.ps
/usr/share/cups/pstoraster/gs_cmdl.ps
/usr/share/cups/pstoraster/gs_dbt_e.ps
/usr/share/cups/pstoraster/gs_diskf.ps
/usr/share/cups/pstoraster/gs_dps1.ps
/usr/share/cups/pstoraster/gs_fform.ps
/usr/share/cups/pstoraster/gs_fonts.ps
/usr/share/cups/pstoraster/gs_init.ps
/usr/share/cups/pstoraster/gs_iso_e.ps
/usr/share/cups/pstoraster/gs_kanji.ps
/usr/share/cups/pstoraster/gs_ksb_e.ps
/usr/share/cups/pstoraster/gs_l2img.ps
/usr/share/cups/pstoraster/gs_lev2.ps
/usr/share/cups/pstoraster/gs_mex_e.ps
/usr/share/cups/pstoraster/gs_mro_e.ps
/usr/share/cups/pstoraster/gs_pdf.ps
/usr/share/cups/pstoraster/gs_pdf_e.ps
/usr/share/cups/pstoraster/gs_pdfwr.ps
/usr/share/cups/pstoraster/gs_pfile.ps
/usr/share/cups/pstoraster/gs_res.ps
/usr/share/cups/pstoraster/gs_setpd.ps
/usr/share/cups/pstoraster/gs_statd.ps
/usr/share/cups/pstoraster/gs_std_e.ps
/usr/share/cups/pstoraster/gs_sym_e.ps
/usr/share/cups/pstoraster/gs_ttf.ps
/usr/share/cups/pstoraster/gs_typ42.ps
/usr/share/cups/pstoraster/gs_type1.ps
/usr/share/cups/pstoraster/gs_wan_e.ps
/usr/share/cups/pstoraster/gs_wl1_e.ps
/usr/share/cups/pstoraster/gs_wl2_e.ps
/usr/share/cups/pstoraster/gs_wl5_e.ps
/usr/share/cups/pstoraster/pdf_2ps.ps
/usr/share/cups/pstoraster/pdf_base.ps
/usr/share/cups/pstoraster/pdf_draw.ps
/usr/share/cups/pstoraster/pdf_font.ps
/usr/share/cups/pstoraster/pdf_main.ps
/usr/share/cups/pstoraster/pdf_sec.ps
/usr/share/cups/pstoraster/pfbtogs.ps
/usr/share/cups/*
%dir /var/cups
/var/cups/backend/http
/var/cups/backend/ipp
/var/cups/backend/lpd
/var/cups/backend/parallel
/var/cups/backend/serial
/var/cups/backend/socket
/var/cups/cgi-bin/classes.cgi
/var/cups/cgi-bin/jobs.cgi
/var/cups/cgi-bin/printers.cgi
/var/cups/conf
/var/cups/filter/hpgltops
/var/cups/filter/imagetops
/var/cups/filter/imagetoraster
/var/cups/filter/pstops
/var/cups/filter/pstoraster
/var/cups/filter/rastertohp
/var/cups/filter/texttops
/var/cups/backend/*
/var/cups/cgi-bin/*
/var/cups/filter/*
%dir /var/cups/interfaces
%dir /var/cups/logs
%dir /var/cups/ppd
%dir /var/cups/requests
%dir /etc/cups
%dir /var/log/cups
%files devel
%dir /usr/include/cups
/usr/include/cups/cups.h
/usr/include/cups/http.h
/usr/include/cups/ipp.h
/usr/include/cups/language.h
/usr/include/cups/mime.h
/usr/include/cups/ppd.h
/usr/include/cups/raster.h
/usr/include/cups/*
#
# End of "$Id: cups.spec 714 1999-10-01 14:40:53Z mike $".
# End of "$Id: cups.spec 755 1999-10-26 20:40:13Z mike $".
#
+3 -2
Ver Arquivo
@@ -29,8 +29,8 @@ include ../Makedefs
#
LIBOBJS = emit.o filter.o http.o ipp.o language.o mark.o mime.o \
options.o page.o ppd.o raster.o string.o type.o usersys.o \
util.o
options.o page.o ppd.o raster.o snprintf.o string.o type.o \
usersys.o util.o
OBJS = $(LIBOBJS) testhttp.o testmime.o testppd.o
#
@@ -110,6 +110,7 @@ options.o: cups.h ../config.h ../Makedefs
page.o: ppd.h ../config.h ../Makedefs
ppd.o: language.h ppd.h ../config.h ../Makedefs
raster.o: raster.h ../config.h ../Makedefs
snprintf.o: string.h ../config.h ../Makedefs
string.o: string.h ../config.h ../Makedefs
type.o: mime.h ../config.h ../Makedefs
usersys.o: cups.h ../config.h ../Makedefs
+1
Ver Arquivo
@@ -114,6 +114,7 @@ extern int cupsGetClasses(char ***classes);
extern const char *cupsGetDefault(void);
extern const char *cupsGetPPD(const char *printer);
extern int cupsGetPrinters(char ***printers);
extern ipp_status_t cupsLastError(void);
extern int cupsPrintFile(const char *printer, const char *filename,
const char *title, int num_options,
cups_option_t *options);
+2 -2
Ver Arquivo
@@ -86,8 +86,8 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
return (-1);
}
if (strcmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 &&
strcmp(choices[i]->choice, "Custom") == 0)
if (strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 &&
strcasecmp(choices[i]->choice, "Custom") == 0)
{
/*
* Variable size; write out standard size options (this should
+4 -2
Ver Arquivo
@@ -88,7 +88,8 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */
if (temp->cost > cost)
{
temp->cost = cost;
strcpy(temp->filter, filter);
strncpy(temp->filter, filter, sizeof(temp->filter) - 1);
temp->filter[sizeof(temp->filter) - 1] = '\0';
}
}
else
@@ -116,7 +117,8 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */
temp->src = src;
temp->dst = dst;
temp->cost = cost;
strcpy(temp->filter, filter);
strncpy(temp->filter, filter, sizeof(temp->filter) - 1);
temp->filter[sizeof(temp->filter) - 1] = '\0';
if (mime->num_filters > 1)
qsort(mime->filters, mime->num_filters, sizeof(mime_filter_t),
+49 -26
Ver Arquivo
@@ -284,8 +284,7 @@ httpConnect(const char *host, /* I - Host to connect to */
* Copy the hostname and port and then "reconnect"...
*/
strcpy(http->hostname, host);
memset((char *)&(http->hostaddr), 0, sizeof(http->hostaddr));
strncpy(http->hostname, host, sizeof(http->hostname) - 1);
memcpy((char *)&(http->hostaddr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
http->hostaddr.sin_family = hostaddr->h_addrtype;
#ifdef WIN32
@@ -381,11 +380,11 @@ httpReconnect(http_t *http) /* I - HTTP data */
void
httpSeparate(const char *uri, /* I - Universal Resource Identifier */
char *method, /* O - Method (http, https, etc.) */
char *username, /* O - Username */
char *host, /* O - Hostname */
char *method, /* O - Method [32] (http, https, etc.) */
char *username, /* O - Username [32] */
char *host, /* O - Hostname [32] */
int *port, /* O - Port number to use */
char *resource) /* O - Resource/filename */
char *resource) /* O - Resource/filename [1024] */
{
char *ptr; /* Pointer into string... */
@@ -415,7 +414,8 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
{
if ((ptr = strchr(host, '/')) != NULL)
{
strcpy(resource, ptr);
strncpy(resource, ptr, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
*ptr = '\0';
}
else
@@ -430,7 +430,10 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
*port = strtol(uri, (char **)&uri, 10);
if (*uri == '/')
strcpy(resource, uri);
{
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
}
else
*port = 0;
@@ -440,7 +443,10 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
return;
}
else
strcpy(method, host);
{
strncpy(method, host, 31);
method[31] = '\0';
}
/*
* If the method starts with less than 2 slashes then it is a local resource...
@@ -448,7 +454,9 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
if (strncmp(uri, "//", 2) != 0)
{
strcpy(resource, uri);
strncpy(resource, uri, 1023);
resource[1023] = '\0';
username[0] = '\0';
host[0] = '\0';
*port = 0;
@@ -463,7 +471,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
uri ++;
ptr = host;
while (*uri != ':' && *uri != '@' && *uri != '/' && *uri != '\0')
while (!(*uri == ':' && isdigit(uri[1])) && *uri != '@' && *uri != '/' && *uri != '\0')
*ptr ++ = *uri ++;
*ptr = '\0';
@@ -474,9 +482,11 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* Got a username...
*/
strcpy(username, host);
strncpy(username, host, 31);
username[31] = '\0';
ptr = host;
uri ++;
while (*uri != ':' && *uri != '/' && *uri != '\0')
*ptr ++ = *uri ++;
@@ -532,7 +542,8 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* The remaining portion is the resource string...
*/
strcpy(resource, uri);
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
@@ -779,22 +790,29 @@ httpWrite(http_t *http, /* I - HTTP data */
if (http->data_encoding == HTTP_ENCODE_CHUNKED &&
(http->state == HTTP_GET_SEND || http->state == HTTP_POST_RECV ||
http->state == HTTP_POST_SEND || http->state == HTTP_PUT_RECV))
{
if (httpPrintf(http, "%x\r\n", length) < 0)
return (-1);
if (length == 0)
{
/*
* A zero-length chunk ends a transfer; unless we are sending POST
* data, go idle...
*/
if (length == 0)
{
/*
* A zero-length chunk ends a transfer; unless we are sending POST
* data, go idle...
*/
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
DEBUG_puts("httpWrite: changing states...");
return (0);
if (http->state == HTTP_POST_RECV)
http->state ++;
else
http->state = HTTP_WAITING;
if (httpPrintf(http, "\r\n") < 0)
return (-1);
return (0);
}
}
tbytes = 0;
@@ -828,6 +846,8 @@ httpWrite(http_t *http, /* I - HTTP data */
* Finished with the transfer; unless we are sending POST data, go idle...
*/
DEBUG_puts("httpWrite: changing states...");
if (http->state == HTTP_POST_RECV)
http->state ++;
else
@@ -973,7 +993,7 @@ httpPrintf(http_t *http, /* I - HTTP data */
va_start(ap, format);
bytes = vsprintf(buf, format, ap);
bytes = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
DEBUG_printf(("httpPrintf: %s", buf));
@@ -1061,7 +1081,7 @@ httpGetDateTime(const char *s) /* I - Date/time string */
int hour, min, sec; /* Time */
if (sscanf(s, "%*s%d%s%d%d:%d:%d", &day, mon, &year, &hour, &min, &sec) < 6)
if (sscanf(s, "%*s%d%15s%d%d:%d:%d", &day, mon, &year, &hour, &min, &sec) < 6)
return (0);
for (i = 0; i < 12; i ++)
@@ -1305,7 +1325,10 @@ httpEncode64(char *out, /* I - String to write to */
in ++;
if (*in == '\0')
{
*outptr ++ = '=';
break;
}
*outptr ++ = base64[((in[0] << 2) | (in[1] >> 6)) & 63];
+2 -2
Ver Arquivo
@@ -593,7 +593,7 @@ ippFindAttribute(ipp_t *ipp, /* I - IPP request */
DEBUG_printf(("ippFindAttribute: attr = %08x, name = \'%s\'\n", attr,
attr->name));
if (attr->name != NULL && strcmp(attr->name, name) == 0 &&
if (attr->name != NULL && strcasecmp(attr->name, name) == 0 &&
(attr->value_tag == type ||
(attr->value_tag == IPP_TAG_TEXTLANG && type == IPP_TAG_TEXT) ||
(attr->value_tag == IPP_TAG_NAMELANG && type == IPP_TAG_NAME)))
@@ -801,7 +801,7 @@ ippRead(http_t *http, /* I - HTTP data */
ipp->state = IPP_DATA;
break;
}
else if (tag <= IPP_TAG_UNSUPPORTED)
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
{
/*
* Group tag... Set the current group and continue...
+2 -2
Ver Arquivo
@@ -75,8 +75,8 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_JOB,
IPP_TAG_END,
IPP_TAG_PRINTER,
IPP_TAG_EXTENSION,
IPP_TAG_UNSUPPORTED = 0x10,
IPP_TAG_UNSUPPORTED_GROUP,
IPP_TAG_UNSUPPORTED_VALUE = 0x10,
IPP_TAG_DEFAULT,
IPP_TAG_UNKNOWN,
IPP_TAG_NOVALUE,
+20 -4
Ver Arquivo
@@ -146,14 +146,29 @@ cupsLangGet(const char *language) /* I - Language or locale */
* standard POSIX locale and is copied unchanged. Otherwise the
* language string is converted from ll-cc (language-country) to ll_CC
* to match the file naming convention used by all POSIX-compliant
* operating systems.
* operating systems. Any trailing character set specification is
* dropped.
*/
if (language == NULL || language[0] == '\0' ||
strcmp(language, "POSIX") == 0)
strcpy(langname, "C");
else
strcpy(langname, language);
{
/*
* Copy the locale string over safely...
*/
strncpy(langname, language, sizeof(langname) - 1);
langname[sizeof(langname) - 1] = '\0';
/*
* Strip charset from "locale.charset"...
*/
if ((text = strchr(langname, '.')) != NULL)
*text = '\0';
}
if (strlen(langname) < 2)
strcpy(real, "C");
@@ -186,7 +201,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
if ((localedir = getenv("LOCALEDIR")) == NULL)
localedir = CUPS_LOCALEDIR;
sprintf(filename, "%s/%s/cups_%s", localedir, real, real);
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real, real);
if ((fp = fopen(filename, "r")) == NULL)
if (strlen(real) > 2)
@@ -196,7 +211,8 @@ cupsLangGet(const char *language) /* I - Language or locale */
*/
real[2] = '\0';
sprintf(filename, "%s/%s/cups_%s", localedir, real, real);
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real,
real);
fp = fopen(filename, "r");
}
+12 -12
Ver Arquivo
@@ -117,7 +117,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c1->marked)
break;
if (j == 0)
if (j == 0 || strcasecmp(c1->choice, "None") == 0)
c1 = NULL;
}
@@ -147,7 +147,7 @@ ppdConflicts(ppd_file_t *ppd) /* I - PPD to check */
if (c2->marked)
break;
if (j == 0)
if (j == 0 || strcasecmp(c2->choice, "None") == 0)
c2 = NULL;
}
@@ -188,7 +188,7 @@ ppdFindChoice(ppd_option_t *o, /* I - Pointer to option */
return (NULL);
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) == 0)
if (strcasecmp(c->choice, choice) == 0)
return (c);
return (NULL);
@@ -239,12 +239,12 @@ ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
{
for (j = g->num_options, o = g->options; j > 0; j --, o ++)
if (strcmp(o->keyword, option) == 0)
if (strcasecmp(o->keyword, option) == 0)
return (o);
for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++)
for (k = sg->num_options, o = sg->options; k > 0; k --, o ++)
if (strcmp(o->keyword, option) == 0)
if (strcasecmp(o->keyword, option) == 0)
return (o);
}
@@ -320,7 +320,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
if (ppd == NULL)
return (0);
if (strcmp(option, "PageSize") == 0 && strncmp(choice, "Custom.", 7) == 0)
if (strcasecmp(option, "PageSize") == 0 && strncasecmp(choice, "Custom.", 7) == 0)
{
/*
* Handle variable page sizes...
@@ -334,7 +334,7 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
return (0);
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) == 0)
if (strcasecmp(c->choice, choice) == 0)
break;
if (i)
@@ -347,23 +347,23 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */
if (o->ui != PPD_UI_PICKMANY)
for (i = o->num_choices, c = o->choices; i > 0; i --, c ++)
if (strcmp(c->choice, choice) != 0)
if (strcasecmp(c->choice, choice) != 0)
c->marked = 0;
if (strcmp(option, "PageSize") == 0 || strcmp(option, "PageRegion") == 0)
if (strcasecmp(option, "PageSize") == 0 || strcasecmp(option, "PageRegion") == 0)
{
/*
* Mark current page size...
*/
for (i = 0; i < ppd->num_sizes; i ++)
ppd->sizes[i].marked = strcmp(ppd->sizes[i].name, choice) == 0;
ppd->sizes[i].marked = strcasecmp(ppd->sizes[i].name, choice) == 0;
/*
* Unmark the current PageSize or PageRegion setting, as appropriate...
*/
if (strcmp(option, "PageSize") == 0)
if (strcasecmp(option, "PageSize") == 0)
{
if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
for (i = 0; i < o->num_choices; i ++)
@@ -399,7 +399,7 @@ ppd_defaults(ppd_file_t *ppd, /* I - PPD file */
return;
for (i = g->num_options, o = g->options; i > 0; i --, o ++)
if (strcmp(o->keyword, "PageRegion") != 0)
if (strcasecmp(o->keyword, "PageRegion") != 0)
ppdMarkOption(ppd, o->keyword, o->defchoice);
for (i = g->num_subgroups, sg = g->subgroups; i > 0; i --, sg ++)
+8 -3
Ver Arquivo
@@ -33,6 +33,9 @@
* Revision History:
*
* $Log: mime.c,v $
* Revision 1.15 1999/10/10 15:40:23 mike
* Scanf, strcpy, and sprintf security changes.
*
* Revision 1.14 1999/07/12 16:09:38 mike
* Fixed all constant arrays to use "const" modifier.
*
@@ -198,7 +201,9 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
if (pathname == NULL)
return (NULL);
strcpy(filename, pathname);
strncpy(filename, pathname, sizeof(filename) - 1);
filename[sizeof(filename) - 1] = '\0';
pathsep = filename + strlen(filename);
if (pathsep == filename ||
(pathsep[-1] != '/' && pathsep[-1] != '\\'))
@@ -298,7 +303,7 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
* Load a mime.types file...
*/
sprintf(filename, "%s/%s", pathname, dent->d_name);
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
load_types(mime, filename);
}
}
@@ -318,7 +323,7 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */
* Load a mime.convs file...
*/
sprintf(filename, "%s/%s", pathname, dent->d_name);
snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name);
load_convs(mime, filename);
}
}
+8 -8
Ver Arquivo
@@ -62,7 +62,7 @@ cupsAddOption(const char *name, /* I - Name of option */
*/
for (i = 0, temp = *options; i < num_options; i ++, temp ++)
if (strcmp(temp->name, name) == 0)
if (strcasecmp(temp->name, name) == 0)
break;
if (i >= num_options)
@@ -140,7 +140,7 @@ cupsGetOption(const char *name, /* I - Name of option */
return (NULL);
for (i = 0; i < num_options; i ++)
if (strcmp(options[i].name, name) == 0)
if (strcasecmp(options[i].name, name) == 0)
return (options[i].value);
return (NULL);
@@ -287,7 +287,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 0;
for (i = num_options; i > 0; i --, options ++)
if (strcmp(options->name, "media") == 0)
if (strcasecmp(options->name, "media") == 0)
{
/*
* Loop through the option string, separating it at commas and
@@ -324,9 +324,9 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 1;
}
}
else if (strcmp(options->name, "sides") == 0)
else if (strcasecmp(options->name, "sides") == 0)
{
if (strcmp(options->value, "one-sided") == 0)
if (strcasecmp(options->value, "one-sided") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "None"))
conflict = 1;
@@ -335,7 +335,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
if (ppdMarkOption(ppd, "KD03Duplex", "None")) /* Kodak */
conflict = 1;
}
else if (strcmp(options->value, "two-sided-long-edge") == 0)
else if (strcasecmp(options->value, "two-sided-long-edge") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "DuplexNoTumble"))
conflict = 1;
@@ -344,7 +344,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
if (ppdMarkOption(ppd, "KD03Duplex", "DuplexNoTumble")) /* Kodak */
conflict = 1;
}
else if (strcmp(options->value, "two-sided-short-edge") == 0)
else if (strcasecmp(options->value, "two-sided-short-edge") == 0)
{
if (ppdMarkOption(ppd, "Duplex", "DuplexTumble"))
conflict = 1;
@@ -354,7 +354,7 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
conflict = 1;
}
}
else if (strcmp(options->name, "resolution") == 0)
else if (strcasecmp(options->name, "resolution") == 0)
{
if (ppdMarkOption(ppd, "Resolution", options->value))
conflict = 1;
+1 -1
Ver Arquivo
@@ -80,7 +80,7 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */
*/
units[0] = '\0';
if (sscanf(name + 7, "%fx%f%s", &w, &l, units) < 2)
if (sscanf(name + 7, "%fx%f%254s", &w, &l, units) < 2)
return (NULL);
if (strcasecmp(units, "in") == 0)
+1 -1
Ver Arquivo
@@ -1028,7 +1028,7 @@ ppdOpen(FILE *fp) /* I - File to read from */
else if (strcmp(keyword, "OrderDependency") == 0 ||
strcmp(keyword, "NonUIOrderDependency") == 0)
{
if (sscanf(string, "%f%s%s", &order, name, keyword) != 3)
if (sscanf(string, "%f%40s%40s", &order, name, keyword) != 3)
{
ppdClose(ppd);
safe_free(string);
+287
Ver Arquivo
@@ -0,0 +1,287 @@
/*
* "$Id$"
*
* snprintf functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-1999 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
* copyright law. Distribution and use rights are outlined in the file
* "LICENSE.txt" which should have been included with this file. If this
* file is missing or damaged please contact Easy Software Products
* at:
*
* Attn: CUPS Licensing Information
* Easy Software Products
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
* Contents:
*
* vsnprintf() - Format a string into a fixed size buffer.
* snprintf() - Format a string into a fixed size buffer.
*/
/*
* Include necessary headers...
*/
#include <stdio.h>
#include <ctype.h>
#include "string.h"
#ifndef HAVE_VSNPRINTF
/*
* 'vsnprintf()' - Format a string into a fixed size buffer.
*/
int /* O - Number of bytes formatted */
vsnprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
sign, /* Sign of format width */
size, /* Size character (h, l, L) */
type; /* Format type character */
const char *bufformat; /* Start of format */
int width, /* Width of field */
prec; /* Number of characters of precision */
char tformat[100], /* Temporary format string for sprintf() */
temp[1024]; /* Buffer for formatted numbers */
int *chars; /* Pointer to integer for %p */
char *s; /* Pointer to string */
int slen; /* Length of string */
/*
* Loop through the format string, formatting as needed...
*/
bufptr = buffer;
bufend = buffer + bufsize - 1;
while (*format && bufptr < bufend)
{
if (*format == '%')
{
bufformat = format;
format ++;
if (*format == '%')
{
*bufptr++ = *format++;
continue;
}
else if (strchr(" -+#\'", *format))
sign = *format++;
else
sign = 0;
width = 0;
while (isdigit(*format))
width = width * 10 + *format++ - '0';
if (*format == '.')
{
format ++;
prec = 0;
while (isdigit(*format))
prec = prec * 10 + *format++ - '0';
}
else
prec = -1;
if (*format == 'l' && format[1] == 'l')
{
size = 'L';
format += 2;
}
else if (*format == 'h' || *format == 'l' || *format == 'L')
size = *format++;
if (!*format)
break;
type = *format++;
switch (type)
{
case 'E' : /* Floating point formats */
case 'G' :
case 'e' :
case 'f' :
case 'g' :
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, double));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
case 'B' : /* Integer formats */
case 'X' :
case 'b' :
case 'd' :
case 'i' :
case 'o' :
case 'u' :
case 'x' :
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, int));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
case 'p' : /* Pointer value */
if ((chars = va_arg(ap, int *)) != NULL)
*chars = bufptr - buffer;
break;
case 'c' : /* Character or character array */
if (width <= 1)
*bufptr++ = va_arg(ap, int);
else
{
if ((bufptr + width) > bufend)
width = bufend - bufptr;
memcpy(bufptr, va_arg(ap, char *), width);
bufptr += width;
}
break;
case 's' : /* String */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
slen = strlen(s);
if (slen > width && prec != width)
width = slen;
if ((bufptr + width) > bufend)
width = bufend - bufptr;
if (slen > width)
slen = width;
if (sign == '-')
{
strncpy(bufptr, s, slen);
memset(bufptr + slen, ' ', width - slen);
}
else
{
memset(bufptr, ' ', width - slen);
strncpy(bufptr + width - slen, s, slen);
}
bufptr += width;
break;
case 'n' : /* Output number of chars so far */
if ((format - bufformat + 1) > sizeof(tformat) ||
(width + 2) > sizeof(temp))
break;
strncpy(tformat, bufformat, format - bufformat);
tformat[format - bufformat] = '\0';
sprintf(temp, tformat, va_arg(ap, int));
if ((bufptr + strlen(temp)) > bufend)
{
strncpy(bufptr, temp, bufend - bufptr);
bufptr = bufend;
break;
}
else
{
strcpy(bufptr, temp);
bufptr += strlen(temp);
}
break;
}
}
else
*bufptr++ = *format++;
}
/*
* Nul-terminate the string and return the number of characters in it.
*/
*bufptr = '\0';
return (bufptr - buffer);
}
#endif /* !HAVE_VSNPRINT */
#ifndef HAVE_SNPRINTF
/*
* 'snprintf()' - Format a string into a fixed size buffer.
*/
int /* O - Number of bytes formatted */
snprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
...) /* I - Additional arguments as needed */
{
int bytes; /* Number of bytes formatted */
va_list ap; /* Pointer to additional arguments */
va_start(ap, format);
bytes = vsnprintf(buffer, bufsize, format, ap);
va_end(ap);
return (bytes);
}
#endif /* !HAVE_SNPRINTF */
/*
* End of "$Id$".
*/
+28
Ver Arquivo
@@ -29,6 +29,8 @@
* Include necessary headers...
*/
# include <stdio.h>
# include <stdarg.h>
# include <config.h>
# include <string.h>
@@ -43,6 +45,15 @@
# endif /* WIN32 || __EMX__ */
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Prototypes...
*/
@@ -59,6 +70,23 @@ extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t n);
# endif /* !HAVE_STRNCASECMP */
# ifndef HAVE_SNPRINTF
extern int snprintf(char *, size_t, const char *, ...);
# endif /* !HAVE_SNPRINTF */
# ifndef HAVE_VSNPRINTF
extern int vsnprintf(char *, size_t, const char *, va_list);
# endif /* !HAVE_VSNPRINTF */
/*
* C++ magic...
*/
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_STRING_H_ */
/*
+1 -1
Ver Arquivo
@@ -104,7 +104,7 @@ main(int argc, /* I - Number of command-line args */
case 3 :
src = mimeFileType(mime, argv[1]);
sscanf(argv[2], "%[^/]/%s", super, type);
sscanf(argv[2], "%15[^/]/31%s", super, type);
dst = mimeType(mime, super, type);
filters = mimeFilter(mime, src, dst, &num_filters);
+8 -5
Ver Arquivo
@@ -108,8 +108,8 @@ mimeAddType(mime_t *mime, /* I - MIME database */
mime->num_types ++;
*types = temp;
strcpy(temp->super, super);
strcpy(temp->type, type);
strncpy(temp->super, super, sizeof(temp->super) - 1);
strncpy(temp->type, type, sizeof(temp->type) - 1);
if (mime->num_types > 1)
qsort(mime->types, mime->num_types, sizeof(mime_type_t *),
@@ -392,7 +392,7 @@ mimeAddTypeRule(mime_type_t *mt, /* I - Type to add to */
* This is just a filename match on the extension...
*/
sprintf(value[0], "*.%s", name);
snprintf(value[0], sizeof(value[0]), "*.%s", name);
length[0] = strlen(value[0]);
num_values = 1;
op = MIME_MAGIC_MATCH;
@@ -582,8 +582,11 @@ mimeType(mime_t *mime, /* I - MIME database */
* Lookup the type in the array...
*/
strcpy(key.super, super);
strcpy(key.type, type);
strncpy(key.super, super, sizeof(key.super) - 1);
key.super[sizeof(key.super) - 1] = '\0';
strncpy(key.type, type, sizeof(key.type) - 1);
key.type[sizeof(key.type) - 1] = '\0';
keyptr = &key;
match = (mime_type_t **)bsearch(&keyptr, mime->types, mime->num_types,
+129 -37
Ver Arquivo
@@ -57,7 +57,9 @@
* Local globals...
*/
static http_t *cups_server = NULL;
static http_t *cups_server = NULL; /* Current server connection */
static ipp_status_t last_error = IPP_OK; /* Last IPP error */
static char authstring[255] = ""; /* Authorization string */
/*
@@ -98,6 +100,7 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
* attributes-natural-language
* printer-uri
* job-id
* [requesting-user-name]
*/
request = ippNew();
@@ -114,21 +117,31 @@ cupsCancelJob(const char *name, /* I - Name of printer or class */
"attributes-natural-language", NULL,
language != NULL ? language->language : "C");
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
snprintf(uri, sizeof(uri), "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", job);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
/*
* Do the request...
*/
if ((response = cupsDoRequest(cups_server, request, "/jobs/")) == NULL)
{
last_error = IPP_BAD_REQUEST;
return (0);
}
else
{
last_error = response->request.status.status_code;
ippDelete(response);
ippDelete(response);
return (1);
return (1);
}
}
@@ -152,8 +165,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
const char *password; /* Password string */
char plain[255], /* Plaintext username:password */
encode[255]; /* Encoded username:password */
static char authstring[255] = "";
/* Authorization string */
DEBUG_printf(("cupsDoFileRequest(%08x, %08s, \'%s\', \'%s\')\n",
@@ -260,7 +271,10 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
httpFlush(http);
if ((password = cupsGetPassword("Password:")) != NULL)
printf("Authentication required for %s on %s...\n", cupsUser(),
http->hostname);
if ((password = cupsGetPassword("UNIX Password: ")) != NULL)
{
/*
* Got a password; send it to the server...
@@ -268,9 +282,9 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
if (!password[0])
break;
sprintf(plain, "%s:%s", cupsUser(), password);
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), password);
httpEncode64(encode, plain);
sprintf(authstring, "Basic %s", encode);
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
continue;
}
@@ -392,8 +406,10 @@ cupsGetClasses(char ***classes) /* O - Classes */
if ((response = cupsDoRequest(cups_server, request, "/classes/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
if (strcmp(attr->name, "printer-name") == 0 &&
if (strcasecmp(attr->name, "printer-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
{
if (n == 0)
@@ -413,6 +429,8 @@ cupsGetClasses(char ***classes) /* O - Classes */
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
@@ -474,17 +492,22 @@ cupsGetDefault(void)
* Do the request and get back a response...
*/
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
if ((response = cupsDoRequest(cups_server, request, "/")) != NULL)
{
last_error = response->request.status.status_code;
if ((attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME)) != NULL)
{
strcpy(def_printer, attr->values[0].string.text);
strncpy(def_printer, attr->values[0].string.text, sizeof(def_printer) - 1);
def_printer[sizeof(def_printer) - 1] = '\0';
ippDelete(response);
return (def_printer);
}
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (NULL);
}
@@ -503,8 +526,12 @@ cupsGetPPD(const char *name) /* I - Printer name */
char printer[HTTP_MAX_URI], /* Printer name */
hostname[HTTP_MAX_URI], /* Hostname */
resource[HTTP_MAX_URI]; /* Resource name */
static char filename[HTTP_MAX_URI]; /* Local filename */
char *tempdir; /* Temporary file directory */
const char *password; /* Password string */
char plain[255], /* Plaintext username:password */
encode[255]; /* Encoded username:password */
http_status_t status; /* HTTP status from server */
static char filename[HTTP_MAX_URI]; /* Local filename */
/*
@@ -521,31 +548,66 @@ cupsGetPPD(const char *name) /* I - Printer name */
#if defined(WIN32) || defined(__EMX__)
tempdir = "C:/WINDOWS/TEMP";
sprintf(filename, "%s/%s.ppd", tempdir, printer);
snprintf(filename, sizeof(filename), "%s/%s.ppd", tempdir, printer);
#else
if ((tempdir = getenv("TMPDIR")) == NULL)
tempdir = "/tmp";
sprintf(filename, "%s/%d.%s.ppd", tempdir, getuid(), printer);
snprintf(filename, sizeof(filename), "%s/%d.%s.ppd", tempdir, getuid(), printer);
#endif /* WIN32 || __EMX__ */
/*
* And send a request to the HTTP server...
*/
sprintf(resource, "/printers/%s.ppd", printer);
snprintf(resource, sizeof(resource), "/printers/%s.ppd", printer);
httpClearFields(cups_server);
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
httpGet(cups_server, resource);
switch (httpUpdate(cups_server))
do
{
case HTTP_OK : /* New file - get it! */
httpClearFields(cups_server);
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
httpSetField(cups_server, HTTP_FIELD_AUTHORIZATION, authstring);
if (httpGet(cups_server, resource))
{
status = HTTP_UNAUTHORIZED;
continue;
}
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
if (status == HTTP_UNAUTHORIZED)
{
DEBUG_puts("cupsGetPPD: unauthorized...");
/*
* Flush any error message...
*/
httpFlush(cups_server);
printf("Authentication required for %s on %s...\n", cupsUser(),
cups_server->hostname);
if ((password = cupsGetPassword("UNIX Password: ")) != NULL)
{
/*
* Got a password; send it to the server...
*/
if (!password[0])
break;
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), password);
httpEncode64(encode, plain);
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
continue;
}
else
break;
default :
return (NULL);
}
}
while (status == HTTP_UNAUTHORIZED);
/*
* OK, we need to copy the file; open the file and copy it...
@@ -623,8 +685,10 @@ cupsGetPrinters(char ***printers) /* O - Printers */
if ((response = cupsDoRequest(cups_server, request, "/printers/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
if (strcmp(attr->name, "printer-name") == 0 &&
if (strcasecmp(attr->name, "printer-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
{
if (n == 0)
@@ -644,11 +708,24 @@ cupsGetPrinters(char ***printers) /* O - Printers */
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
/*
* 'cupsLastError()' - Return the last IPP error that occurred.
*/
ipp_status_t /* O - IPP error code */
cupsLastError(void)
{
return (last_error);
}
/*
* 'cupsPrintFile()' - Print a file to a printer or class.
*/
@@ -704,7 +781,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
request->request.op.operation_id = IPP_PRINT_JOB;
request->request.op.request_id = 1;
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
snprintf(uri, sizeof(uri), "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
language = cupsLangDefault();
@@ -745,7 +822,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
* Skip the "raw" option - handled above...
*/
if (strcmp(options[i].name, "raw") == 0)
if (strcasecmp(options[i].name, "raw") == 0)
continue;
/*
@@ -789,7 +866,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
}
else
{
if (strncmp(option, "no", 2) == 0)
if (strncasecmp(option, "no", 2) == 0)
{
option += 2;
n = 0;
@@ -829,9 +906,9 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
{
n2 = strtol(s + 1, &s, 0);
if (strcmp(s, "dpc") == 0)
if (strcasecmp(s, "dpc") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_CM, n, n2);
else if (strcmp(s, "dpi") == 0)
else if (strcasecmp(s, "dpi") == 0)
ippAddResolution(request, IPP_TAG_JOB, option, IPP_RES_PER_INCH, n, n2);
else
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, option, NULL, val);
@@ -863,7 +940,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
* Try printing the file...
*/
sprintf(uri, "/printers/%s", printer);
snprintf(uri, sizeof(uri), "/printers/%s", printer);
if ((response = cupsDoFileRequest(cups_server, request, uri, filename)) == NULL)
jobid = 0;
@@ -944,8 +1021,8 @@ cupsTempFile(char *filename, /* I - Pointer to buffer */
static char * /* I - Printer name or NULL */
cups_connect(const char *name, /* I - Destination (printer[@host]) */
char *printer, /* O - Printer name */
char *hostname) /* O - Hostname */
char *printer, /* O - Printer name [HTTP_MAX_URI] */
char *hostname) /* O - Hostname [HTTP_MAX_URI] */
{
char hostbuf[HTTP_MAX_URI];
/* Name of host */
@@ -954,18 +1031,30 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
if (name == NULL)
{
last_error = IPP_BAD_REQUEST;
return (NULL);
}
if (sscanf(name, "%[^@]@%s", printerbuf, hostbuf) == 1)
strcpy(hostbuf, cupsServer());
if (sscanf(name, "%1023[^@]@%1023s", printerbuf, hostbuf) == 1)
{
strncpy(hostbuf, cupsServer(), sizeof(hostbuf) - 1);
hostbuf[sizeof(hostbuf) - 1] = '\0';
}
if (hostname != NULL)
strcpy(hostname, hostbuf);
{
strncpy(hostname, hostbuf, HTTP_MAX_URI - 1);
hostname[HTTP_MAX_URI - 1] = '\0';
}
else
hostname = hostbuf;
if (printer != NULL)
strcpy(printer, printerbuf);
{
strncpy(printer, printerbuf, HTTP_MAX_URI - 1);
printer[HTTP_MAX_URI - 1] = '\0';
}
else
printer = printerbuf;
@@ -978,7 +1067,10 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
}
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
}
else
return (printer);
}
+2 -2
Ver Arquivo
@@ -340,7 +340,7 @@ extension of &quot;.h&quot;.
the file, the purpose or nature of the source file, the copyright and
licensing notice, and the functions contained in the file. The file
name and revision information is provided by the CVS &quot;$Id: cmp.shtml,v
1.3 1999/05/21 20:54:04 mike Exp $&quot; tag:
1.4 1999/09/22 20:06:18 mike Exp $&quot; tag:
<UL>
<PRE>
/*
@@ -376,7 +376,7 @@ name and revision information is provided by the CVS &quot;$Id: cmp.shtml,v
</PRE>
</UL>
The bottom of each source file shall contain a trailer giving the name
of the file using the CVS &quot;$Id: cmp.shtml,v 1.3 1999/05/21 20:54:04
of the file using the CVS &quot;$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18
mike Exp $&quot; tag. The primary purpose of this is to mark the end of a
source file; if the trailer is missing it is possible that code has
been lost near the end of the file:
+88 -88
Ver Arquivo
@@ -1,6 +1,6 @@
%PDF-1.2
%âãÏÓ
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990922200456Z)/Title(CUPS Configuration Management Plan)/Author(Easy Software Products)>>endobj
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19991004131140Z)/Title(CUPS Configuration Management Plan)/Author(Easy Software Products)>>endobj
2 0 obj<</Type/Encoding/BaseEncoding/WinAnsiEncoding>>endobj
3 0 obj<</Type/Font/Subtype/Type1/BaseFont/Courier/Encoding 2 0 R>>endobj
4 0 obj<</Type/Font/Subtype/Type1/BaseFont/Times-Roman/Encoding 2 0 R>>endobj
@@ -485,19 +485,19 @@ endobj
endobj
222 0 obj<</Type/Page/Parent 191 0 R/Contents 223 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F0 3 0 R/F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
223 0 obj<</Length 224 0 R/Filter/FlateDecode>>stream
VMSÛ0½çWìpjgˆ'’Þ€N/”¤\Y^'flÉ•d(ÿ¾»’çchÃ!±õôöí7¿1Œè/†«1L¦ ËÁÍjðå~ñVL¯.`•~º„¥ÎÜ«0X °h?¯žò2šìðrtÃ#k?ê2A“«uÀ_@7èñ4 o-–P#pƒ8¬„qðÒ(Oé­p˜Bò1êÔ‚Ó`°2hQ9º‹PŠgmΡÌ •B%œÜÊ‹f
d9žDc¶¨í× ms~q ¶öFÌž=òä‘çÝ9£Q4ÚõrÈT­Ÿ7èÄСu­r˜â™«”ÔçY\U…*¥xy
VMSÛ0½çWìpjgˆ'’Þ€N/”¤\Y^'flÉ•d(ÿ¾»’çchÃ!±õôöí7¿1Œè/†«1L¦ ËÁÍjðå~ñVL¯.`•~º„¥ÎÜ«0X °h?¯žò2šìðrtÃ#k?ê2A“«uÀ_@7èñ4 o-–P#pƒ8¬„qðÒ(Oé­p˜Bò1êÔ‚Ó`°2hQ9º‹PŠgmΡÌ •B%œÜÊ‹f
d9žDc¶¨í× ms~q ¶öFÌž=òä‘çÝ9£Q4ÚõrÈT­Ÿ7èÄСu­r˜â™«”ÔçY\U…*¥xy
tŽœ¿L…~
>Hê¼H›Øü¿þÄÓì{‘Ä'ü¸†ÛÇ%X%*»Ñr kTr“iH™{ƒ„¼õ Èr%ŠÖeÿÆçšè¥˜)1ÝúØKVг—3Oòš»'IQæ%Y¨t®œåz(„ $5…ÖX©©@>£—øiôÔ ÷òDLî™ÜµF%QòÆqMg¢.(LŠ~Ú¶‰l í›uXÒ4X"kgwv굉Lß3ºø{aYæíðÝ-}Š6_+Ðøæ¢3ÚƒSß#§H¥«BÁãï©9Ø=ÀÝç¸G^¦7H5!uYQʰx#DЃi×£ÿ ¢g6ø°×Ú
‘}§çÃ9ojèsŸjP_¼=¯ß!ÇŒ\¢Ô$â4 #­ŒNké¸àáã=”B°
Ô‹=ÒcWâ.zh¦Ö.ô4{ÿÊø` :ngâ.ôû¸£ÝrñÍ6™·ëe ßÂÈ¡»G÷Êvcmǭ݈Pe½ÅÍkk)ÑÚ¬.¨bÛâM»–rF×IÁd•6.‚kbÒÉ3õ×b¯FñÊÚ ÆgyñÞrŠ·¢f¸Ji•‘†’>ŠšQ~´Ó*[›fžX]Ù²§X$=¦ÑMÜ…j+Z9§öï6N.;±\à” nEI-l%í›Ø·ùö&›€E!Ô¹?.W‹!× Ü Vè™m/FRЀåêÁ¯ñ¤Ðs3?Ã2š"YZJMôÆÝYçÈtü“r1EsÂbÎÏw«ÁÏÁ_øe¼?endstream
endobj
845
endobj
224 0 obj
845
endobj
225 0 obj<</Type/Page/Parent 191 0 R/Contents 226 0 R/Resources<</ProcSet[/PDF/Text]/Font<</F4 4 0 R/F8 7 0 R/F9 8 0 R>>>>>>endobj
226 0 obj<</Length 227 0 R/Filter/FlateDecode>>stream
xÚmP½R„0îyŠ+- ǶÞh§sz¨õ^XŽ8`6Ì,,œ¤Úý~÷+QÉS°-ã×crß$·w vi
xÚmP½R„0îyŠ+- ǶÞh§sz¨õ^XŽ8`6Ì,,œ¤Úý~÷+QÉS°-ã×crß$·w vi
M'»²ªÒšöz—ðJ!ÓMó)¨”Z1›¼”¥`>z²ˆƒ±gè‘áD2Ðnœ
ÔÏZs7Ã7 Xº@k8xsšƒq̈gà=a$tÞz={O6Àþý(zíAŒÕ6Í£ñ[œ¸wá*…g“wí¬I¿Fîq„j ìºpAO¢aIj]€ ™Å4úá$“7’âXšqº¶¯Û«¢’SÕKŠýÛá{g;sž=.öOh¥Ò£´‘»Y)*Ï"IeqXäuº…ìŸC?4ÉKòc„endstream
endobj
@@ -872,89 +872,89 @@ xref
0000016725 00000 n
0000016774 00000 n
0000016823 00000 n
0000017019 00000 n
0000017068 00000 n
0000017117 00000 n
0000017166 00000 n
0000017215 00000 n
0000017264 00000 n
0000017313 00000 n
0000017362 00000 n
0000017411 00000 n
0000017460 00000 n
0000017509 00000 n
0000017558 00000 n
0000017607 00000 n
0000017656 00000 n
0000017705 00000 n
0000017754 00000 n
0000017803 00000 n
0000017852 00000 n
0000017901 00000 n
0000017950 00000 n
0000017999 00000 n
0000018260 00000 n
0000018412 00000 n
0000024803 00000 n
0000024825 00000 n
0000024938 00000 n
0000025040 00000 n
0000025060 00000 n
0000025200 00000 n
0000026140 00000 n
0000026161 00000 n
0000026274 00000 n
0000026462 00000 n
0000026483 00000 n
0000026623 00000 n
0000027230 00000 n
0000027251 00000 n
0000027364 00000 n
0000027557 00000 n
0000027578 00000 n
0000027709 00000 n
0000028322 00000 n
0000028343 00000 n
0000028456 00000 n
0000028645 00000 n
0000028666 00000 n
0000028797 00000 n
0000029741 00000 n
0000029762 00000 n
0000029893 00000 n
0000030180 00000 n
0000030201 00000 n
0000030341 00000 n
0000031257 00000 n
0000031278 00000 n
0000031409 00000 n
0000031767 00000 n
0000031788 00000 n
0000031928 00000 n
0000032424 00000 n
0000032445 00000 n
0000032576 00000 n
0000033028 00000 n
0000033049 00000 n
0000033189 00000 n
0000034329 00000 n
0000034351 00000 n
0000034491 00000 n
0000035397 00000 n
0000035418 00000 n
0000035558 00000 n
0000036484 00000 n
0000036505 00000 n
0000036645 00000 n
0000037291 00000 n
0000037312 00000 n
0000037452 00000 n
0000038272 00000 n
0000038293 00000 n
0000038433 00000 n
0000039360 00000 n
0000016872 00000 n
0000016921 00000 n
0000016970 00000 n
0000017019 00000 n
0000017068 00000 n
0000017117 00000 n
0000017166 00000 n
0000017215 00000 n
0000017264 00000 n
0000017313 00000 n
0000017362 00000 n
0000017411 00000 n
0000017460 00000 n
0000017509 00000 n
0000017558 00000 n
0000017607 00000 n
0000017656 00000 n
0000017705 00000 n
0000017754 00000 n
0000017803 00000 n
0000017852 00000 n
0000017901 00000 n
0000017950 00000 n
0000017999 00000 n
0000018260 00000 n
0000018412 00000 n
0000024803 00000 n
0000024825 00000 n
0000024938 00000 n
0000025040 00000 n
0000025060 00000 n
0000025200 00000 n
0000026140 00000 n
0000026161 00000 n
0000026274 00000 n
0000026462 00000 n
0000026483 00000 n
0000026623 00000 n
0000027230 00000 n
0000027251 00000 n
0000027364 00000 n
0000027557 00000 n
0000027578 00000 n
0000027709 00000 n
0000028322 00000 n
0000028343 00000 n
0000028456 00000 n
0000028645 00000 n
0000028666 00000 n
0000028797 00000 n
0000029741 00000 n
0000029762 00000 n
0000029893 00000 n
0000030180 00000 n
0000030201 00000 n
0000030341 00000 n
0000031257 00000 n
0000031278 00000 n
0000031409 00000 n
0000031767 00000 n
0000031788 00000 n
0000031928 00000 n
0000032424 00000 n
0000032445 00000 n
0000032576 00000 n
0000033028 00000 n
0000033049 00000 n
0000033189 00000 n
0000034329 00000 n
0000034351 00000 n
0000034491 00000 n
0000035395 00000 n
0000035416 00000 n
0000035556 00000 n
0000036482 00000 n
0000036503 00000 n
0000036643 00000 n
0000037289 00000 n
0000037310 00000 n
0000037450 00000 n
0000038270 00000 n
0000038291 00000 n
0000038431 00000 n
0000039358 00000 n
0000039946 00000 n
0000039379 00000 n
0000039519 00000 n
+3 -3
Ver Arquivo
@@ -11,7 +11,7 @@
<TD><H1 ALIGN=right>An Overview of the<BR>
Common UNIX Printing System</H1></DIV>
<P ALIGN=right>September 14, 1999<BR>
<P ALIGN=right>October 4, 1999<BR>
Michael Sweet, Easy Software Products<BR>
Copyright 1998-1999, All Rights Reserved.</P>
</TD>
@@ -229,8 +229,8 @@ interfaces to ensure compatibility with existing applications.
<H2>Licensing</H2>
CUPS is available under the terms of the Aladdin Free Public
License, which means that it is basically free except for commercial
CUPS is available under the terms of the GNU General Public License
which means that it is basically free except for binary-only
distribution. Vendors wishing to license CUPS for their printing
solution should contact Easy Software Products at:
Arquivo binário não exibido.
+3 -3
Ver Arquivo
@@ -3,12 +3,12 @@
<TITLE>CUPS Software Administrators Manual</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.1">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>CUPS Software Administrators Manual</H1></A><BR>
CUPS-SAM-1.0.0<BR>
CUPS-SAM-1.0.1<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
</CENTER>
@@ -92,7 +92,7 @@ Copyright 1997-1999, All Rights Reserved<BR>
<HR>
<H1 ALIGN=RIGHT><A NAME=1>Preface</A></H1>
This software administrators manual provides printer administration
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.0.0.
information for the Common UNIX Printing System (&quot;CUPS&quot;) Version 1.0.1.
<H2><A NAME=1_1>System Overview</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
+143 -143
Ver Arquivo
@@ -1,6 +1,6 @@
%PDF-1.2
%âãÏÓ
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19990922200503Z)/Title(CUPS Software Administrators Manual)/Author(Easy Software Products)>>endobj
1 0 obj<</Producer(htmldoc 2.0b1 Copyright 1997-1999 Michael Sweet, All Rights Reserved.)/CreationDate(D:19991012190200Z)/Title(CUPS Software Administrators Manual)/Author(Easy Software Products)>>endobj
2 0 obj<</Type/Encoding/BaseEncoding/WinAnsiEncoding>>endobj
3 0 obj<</Type/Font/Subtype/Type1/BaseFont/Courier/Encoding 2 0 R>>endobj
4 0 obj<</Type/Font/Subtype/Type1/BaseFont/Courier-Oblique/Encoding 2 0 R>>endobj
@@ -396,7 +396,7 @@ H
“ã¿DÝ<jåš÷Áª¥µ(N°JúF¥.ƒk–—¦f7\¡ê¨ Šó ,¥ÉTë2¸‚²¥t•=<ë_]{:­WÖepMJ_Ý
Wr<(”×…/-Hà)»BY—Ï•vÉN¬W'ïRpY§äsM]Õ6¿ú[ËÇ;I—\¢ ò4«NXx!³¦.Ë?Ÿn&ñ¤3®°¸
'*J2ž¸¡.kr|Q—I<_úg8©Åq‚¥å$mU]×ôø86O&è‡+9ýé˜å$mU]WP|t33®–ôÃã?gg2/ˆU\¸#¥¯KâÚÞÿ:>¦y§\Ý?ly
IÅM[ýx.q˜¤Û)¼ìŒ+Ô¥ãΔ³ºƒçZ>oûÉëθö‘àZ7NJÓH[—Ädhkéqg\‡³Îóµ:ÀÚeR<ɹ¶.‰ NÙ¯~Þ×1D¯õvÿÃëë*¹ê‰;Šä0_·î«;®B>H¥·Ñ“·9úb}]
IÅM[ýx.q˜¤Û)¼ìŒ+Ô¥ãΔ³ºƒçZ>oûÉëθö‘àZ7NJÓH[—Ädhkéqg\‡³Îóµ:ÀÚeR<ɹ¶.‰ NÙ¯~Þ×1D¯õvÿÃëë*¹ê‰;Šä0_·î«;®B>H¥·Ñ“·9úb}]
Wz0€ÕöƒÍ¸šÎõŠõJï%NêY´Úº®ìðÇ­[6äj:‡”÷8J‹ã¸µ.…KzǢϚ¹ŒÎ—¥6³TÔ²Zôu \ùÁ1ïþ¶;®J­×F2@Ô¥píóÎ-wÉUxÑV™Bõ#sºº®½cNw>¾K®§‹°µ\*U²ic]×Þ1§»úf\­y_÷¡jÖåCQ×Åû匷ÿï·pÙÈg{¸¨/jÍ"GU—À•ì,pç–»ç:õvZ ¥Ö¨º®½cÞ¹å>¸žDa¢4Mu \{Ǽsˆ\Øw‹¦ÍbÐT—À%Ÿ¼Ø¬/®Sâu;W¥.kï˜÷"ÙÈe½}•̲습\Mu)\œd§ýÓN¸ÊîZ7;uu)\ÉðÓ½c4äŠqû‡-\Mu)\Û‘N¼ã‹ê:ãš”lËoäÒÕ¥pÁþ2¬ßÆerïF”þY4ê|S]
W²¿Y31çZ6/¿æÅuÈTËÕT—•žœzg\Iq<W•¯©t¶©.…+;­¹Lî!îÛú·§C­¥–«©nK<_zÛ–,Ÿ
pÍ[ÏaO‡úÅbS]
@@ -414,12 +414,12 @@ endobj
| ê%è@N‰ǵ‚-Ý®)’+udÀdÈ
Â!72ÄÊO-
j¨V¹ gÉ·ÈÍ ±S­Ç>Ý9š oˆJGj`3¢¬ñJñ3íÒï<¾j¹¤7´%fFÒ¹±!v¤‰Âȇ‚ñ¤íÈ;£­P½3Ƴ¶ïœZ ûúN¦˜
e l<1û+–•é# ×¾»'|qNåJHfS;(š¹¤7˜ Í'Ø1r`RXøR°d*Ò¼ž3¸hß°)ßõ,…
e l<1û+–•é# ×¾»'|qNåJHfS;(š¹¤7˜ Í'Ø1r`RXøR°d*Ò¼ž3¸hß°)ßõ,…
¡XØ](X…¹*^Û1°±^µFÃÒÇ`e¡àNÖ}bé¥
lEiG°7=)aóa0XÔ&Sõ c5ÜF{žÿd<[ÌBêl®<ä€UéUnè_³æs%,.Ï¿¥Ãâ›â€6.æ€yÞyÜñ`5¯Z¹"[ð?:ÿ XÓ87á’¿œ£¬1»à}úÒˆË`À¶óì²Í˜T-ˇv.“Û£=ê?û&dîÜ‹º SäåcmÜäÃ"4y\¹)WæÙ)gç‹ÅâÍã¦<,¡á§Í¹l ˜õÒ–ÿˆá’rÍ-p™Iâ Ã…ãroÀ–V¸œ°ö­/Ûp!¹§6}Ć+]âZÛãJÇ5\h.ÖNGGÛäÊœášç6¹œÑzÜñžK†cÑxw gÑ q9!Øó^
lEiG°7=)aóa0XÔ&Sõ c5ÜF{žÿd<[ÌBêl®<ä€UéUnè_³æs%,.Ï¿¥Ãâ›â€6.æ€yÞyÜñ`5¯Z¹"[ð?:ÿ XÓ87á’¿œ£¬1»à}úÒˆË`À¶óì²Í˜T-ˇv.“Û£=ê?û&dîÜ‹º SäåcmÜäÃ"4y\¹)WæÙ)gç‹ÅâÍã¦<,¡á§Í¹l ˜õÒ–ÿˆá’rÍ-p™Iâ Ã…ãroÀ–V¸œ°ö­/Ûp!¹§6}Ć+]âZÛãJÇ5\h.ÖNGGÛäÊœášç6¹œÑzÜñžK†cÑxw gÑ q9!Øó^
Ò¸°DôÑ!‰kpKÄgи²‘X!•kàø—p€MäÔ)¹/T®!½3åø‰Ê5``OJš#s
6Åhi/t®¦1±ŒÁ5Ì#ží2¸™bÔ,%=pÍ`sõ®ôT9WÏÚÁÈdrIᮚpõ)ЬÔa.W`¼L26#í§ÇeÌÕÓbŒyãÀ€«ÿìs/R˜puoŠü,M#®®Á O͸ºUE“daC®.´Q´)Ww`fÉøÆ\äêŽ&ö¹ºX¶¦«Ûá²/‹æ÷&¬påÒ®-^š÷Èׯí
Ùd»Ã•Ë wË&—¥!;_ç®qåòÆXߨê‹M.~jõêÒ^Oìr¤W#R·‡äâ’٥ꂋCvþÆvºà"æÅû‹ÞsÑ
Ùd»Ã•Ë wË&—¥!;_ç®qåòÆXߨê‹M.~jõêÒ^Oìr¤W#R·‡äâ’٥ꂋCvþÆvºà"æÅû‹ÞsÑ
צ<â²ãýóÛN¾¾3®Ý¨µäÙⱫïî’k7l7‹3õ8]>vù½]sín{Ãaqq¶-ç‹Ååãcç_Ù ×âO¯’W÷òÕ»ß}×…ü£øðÃÕ÷âvuu+äÿðC&²_ÿøíÿ>ùIÜýøçŸÿòó×o_>ûõËWñûÏùíó/ÿ(ÿ{ÓúV\_o[_¿¿¾ú(Þ^¿¿ºyjÿ6»ûýÛë«ÕÕõ¶êÛ{óaÿùñç¯;}>|ùõÇßþðíë®Þíû«úõþöåçÿúÓ·M/?~ÿvóÿIÜýò‹H·ùU¤?}ýéËÿþôã¶i,7Lÿíò´endstream
endobj
210 0 obj
@@ -986,145 +986,145 @@ xref
0000010313 00000 n
0000010419 00000 n
0000010525 00000 n
0000010631 00000 n
0000010737 00000 n
0000010843 00000 n
0000010949 00000 n
0000011055 00000 n
0000011161 00000 n
0000011267 00000 n
0000011373 00000 n
0000011479 00000 n
0000011585 00000 n
0000011691 00000 n
0000011797 00000 n
0000011903 00000 n
0000012009 00000 n
0000012115 00000 n
0000012221 00000 n
0000012327 00000 n
0000012432 00000 n
0000012536 00000 n
0000012640 00000 n
0000013405 00000 n
0000013511 00000 n
0000013615 00000 n
0000013720 00000 n
0000013826 00000 n
0000013932 00000 n
0000014036 00000 n
0000014140 00000 n
0000014244 00000 n
0000014349 00000 n
0000014454 00000 n
0000014560 00000 n
0000014666 00000 n
0000014772 00000 n
0000014878 00000 n
0000014984 00000 n
0000015088 00000 n
0000015193 00000 n
0000015299 00000 n
0000015403 00000 n
0000015508 00000 n
0000015614 00000 n
0000015718 00000 n
0000015823 00000 n
0000015929 00000 n
0000016139 00000 n
0000016173 00000 n
0000016207 00000 n
0000016908 00000 n
0000016957 00000 n
0000017006 00000 n
0000017055 00000 n
0000017104 00000 n
0000017153 00000 n
0000017202 00000 n
0000017251 00000 n
0000017300 00000 n
0000017349 00000 n
0000017398 00000 n
0000017447 00000 n
0000017496 00000 n
0000017545 00000 n
0000017594 00000 n
0000017643 00000 n
0000017692 00000 n
0000017741 00000 n
0000017790 00000 n
0000017839 00000 n
0000017888 00000 n
0000017937 00000 n
0000017986 00000 n
0000018035 00000 n
0000018084 00000 n
0000018133 00000 n
0000018182 00000 n
0000018231 00000 n
0000018280 00000 n
0000018329 00000 n
0000018378 00000 n
0000018427 00000 n
0000018476 00000 n
0000018525 00000 n
0000018574 00000 n
0000018623 00000 n
0000018672 00000 n
0000018721 00000 n
0000018770 00000 n
0000018819 00000 n
0000018868 00000 n
0000018917 00000 n
0000018966 00000 n
0000019015 00000 n
0000019064 00000 n
0000019113 00000 n
0000019162 00000 n
0000019211 00000 n
0000019260 00000 n
0000019309 00000 n
0000019358 00000 n
0000019407 00000 n
0000019456 00000 n
0000019765 00000 n
0000019917 00000 n
0000026302 00000 n
0000026324 00000 n
0000026437 00000 n
0000026539 00000 n
0000026559 00000 n
0000026690 00000 n
0000027459 00000 n
0000027480 00000 n
0000027621 00000 n
0000027997 00000 n
0000028018 00000 n
0000028158 00000 n
0000029072 00000 n
0000029093 00000 n
0000029233 00000 n
0000030669 00000 n
0000030691 00000 n
0000030831 00000 n
0000031723 00000 n
0000031744 00000 n
0000031857 00000 n
0000032054 00000 n
0000032075 00000 n
0000032229 00000 n
0000033131 00000 n
0000033152 00000 n
0000033306 00000 n
0000034227 00000 n
0000034248 00000 n
0000034397 00000 n
0000035103 00000 n
0000035124 00000 n
0000035237 00000 n
0000035434 00000 n
0000010631 00000 n
0000010737 00000 n
0000010843 00000 n
0000010949 00000 n
0000011055 00000 n
0000011161 00000 n
0000011267 00000 n
0000011373 00000 n
0000011479 00000 n
0000011585 00000 n
0000011691 00000 n
0000011797 00000 n
0000011903 00000 n
0000012009 00000 n
0000012115 00000 n
0000012221 00000 n
0000012327 00000 n
0000012432 00000 n
0000012536 00000 n
0000012640 00000 n
0000013405 00000 n
0000013511 00000 n
0000013615 00000 n
0000013720 00000 n
0000013826 00000 n
0000013932 00000 n
0000014036 00000 n
0000014140 00000 n
0000014244 00000 n
0000014349 00000 n
0000014454 00000 n
0000014560 00000 n
0000014666 00000 n
0000014772 00000 n
0000014878 00000 n
0000014984 00000 n
0000015088 00000 n
0000015193 00000 n
0000015299 00000 n
0000015403 00000 n
0000015508 00000 n
0000015614 00000 n
0000015718 00000 n
0000015823 00000 n
0000015929 00000 n
0000016139 00000 n
0000016173 00000 n
0000016207 00000 n
0000016908 00000 n
0000016957 00000 n
0000017006 00000 n
0000017055 00000 n
0000017104 00000 n
0000017153 00000 n
0000017202 00000 n
0000017251 00000 n
0000017300 00000 n
0000017349 00000 n
0000017398 00000 n
0000017447 00000 n
0000017496 00000 n
0000017545 00000 n
0000017594 00000 n
0000017643 00000 n
0000017692 00000 n
0000017741 00000 n
0000017790 00000 n
0000017839 00000 n
0000017888 00000 n
0000017937 00000 n
0000017986 00000 n
0000018035 00000 n
0000018084 00000 n
0000018133 00000 n
0000018182 00000 n
0000018231 00000 n
0000018280 00000 n
0000018329 00000 n
0000018378 00000 n
0000018427 00000 n
0000018476 00000 n
0000018525 00000 n
0000018574 00000 n
0000018623 00000 n
0000018672 00000 n
0000018721 00000 n
0000018770 00000 n
0000018819 00000 n
0000018868 00000 n
0000018917 00000 n
0000018966 00000 n
0000019015 00000 n
0000019064 00000 n
0000019113 00000 n
0000019162 00000 n
0000019211 00000 n
0000019260 00000 n
0000019309 00000 n
0000019358 00000 n
0000019407 00000 n
0000019456 00000 n
0000019765 00000 n
0000019917 00000 n
0000026302 00000 n
0000026324 00000 n
0000026437 00000 n
0000026539 00000 n
0000026559 00000 n
0000026690 00000 n
0000027460 00000 n
0000027481 00000 n
0000027622 00000 n
0000027998 00000 n
0000028019 00000 n
0000028159 00000 n
0000029073 00000 n
0000029094 00000 n
0000029234 00000 n
0000030670 00000 n
0000030692 00000 n
0000030832 00000 n
0000031724 00000 n
0000031745 00000 n
0000031858 00000 n
0000032055 00000 n
0000032076 00000 n
0000032230 00000 n
0000033132 00000 n
0000033153 00000 n
0000033307 00000 n
0000034228 00000 n
0000034249 00000 n
0000034398 00000 n
0000035104 00000 n
0000035125 00000 n
0000035238 00000 n
0000035435 00000 n
0000035456 00000 n
0000035614 00000 n
0000036367 00000 n
0000036387 00000 n
0000036388 00000 n
0000036546 00000 n
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.0.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Administrators Manual</TITLE>
</HEAD>
@@ -10,7 +10,7 @@
<H1 ALIGN=RIGHT>Preface</H1>
This software administrators manual provides printer administration
information for the Common UNIX Printing System ("CUPS") Version 1.0.0.
information for the Common UNIX Printing System ("CUPS") Version 1.0.1.
<H2>System Overview</H2>
+27 -13
Ver Arquivo
@@ -3,12 +3,12 @@
<TITLE>CUPS Software Users Manual</TITLE>
<META NAME="AUTHOR" CONTENT="Easy Software Products">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.1">
</HEAD>
<BODY>
<CENTER><A HREF=#contents><IMG SRC="images/cups-large.gif" BORDER=0><BR>
<H1>CUPS Software Users Manual</H1></A><BR>
CUPS-SUM-1.0.0<BR>
CUPS-SUM-1.0.1<BR>
Easy Software Products<BR>
Copyright 1997-1999, All Rights Reserved<BR>
</CENTER>
@@ -48,8 +48,9 @@ Copyright 1997-1999, All Rights Reserved<BR>
<LI><A HREF=#4_1_2>Setting the Orientation</A></LI>
<LI><A HREF=#4_1_3>Printing On Both Sides of the Paper</A></LI>
<LI><A HREF=#4_1_4>Selecting a Range of Pages</A></LI>
<LI><A HREF=#4_1_5>Setting the Brightness</A></LI>
<LI><A HREF=#4_1_6>Setting the Gamma Correction</A></LI>
<LI><A HREF=#4_1_5>N-Up Printing</A></LI>
<LI><A HREF=#4_1_6>Setting the Brightness</A></LI>
<LI><A HREF=#4_1_7>Setting the Gamma Correction</A></LI>
</UL>
<LI><A HREF=#4_2>Text Options</A></LI>
<UL>
@@ -69,7 +70,7 @@ Copyright 1997-1999, All Rights Reserved<BR>
<HR>
<H1 ALIGN=RIGHT><A NAME=1>Preface</A></H1>
This software users manual describes how to use the Common UNIX
Printing System (&quot;CUPS&quot;) Version 1.0.0.
Printing System (&quot;CUPS&quot;) Version 1.0.1.
<H2><A NAME=1_1>System Overview</A></H2>
The Common UNIX Printing System provides a portable printing layer for
UNIX&reg; operating systems. It has been developed by Easy Software
@@ -354,14 +355,15 @@ in landscape orientation: </P>
</PRE>
</UL>
<H3><A NAME=4_1_3>Printing On Both Sides of the Paper</A></H3>
<P>The &quot;-o sides=two-sided-short&quot; and &quot;-o sides=two-sided-long&quot; options
will enable duplexing on the printer (if the printer supports it.) The
&quot;two-sided-short&quot; option is suitable for landscape pages, while the
&quot;two-sided-long&quot; option is suitable for portrait pages: </P>
<P>The &quot;-o sides=two-sided-short-edge&quot; and &quot;-o
sides=two-sided-long-edge&quot; options will enable duplexing on the printer
(if the printer supports it.) The &quot;two-sided-short&quot; option is suitable
for landscape pages, while the &quot;two-sided-long&quot; option is suitable for
portrait pages: </P>
<UL>
<PRE>
% lp -o sides=two-sided-short filename ENTER
% lp -o sides=two-sided-long filename ENTER
% lp -o sides=two-sided-short-edge filename ENTER
% lp -o sides=two-sided-long-edge filename ENTER
</PRE>
</UL>
<H3><A NAME=4_1_4>Selecting a Range of Pages</A></H3>
@@ -385,7 +387,19 @@ of the order of the pages in the &quot;page-range&quot; option. </P>
% lp -o page-set=even filename ENTER
</PRE>
</UL>
<H3><A NAME=4_1_5>Setting the Brightness</A></H3>
<H3><A NAME=4_1_5>N-Up Printing</A></H3>
<P>The &quot;-o number-up=value&quot; option selects N-Up printing. N-Up
printing places multiple document pages on a single printed page. CUPS
supports 1-Up, 2-Up, and 4-Up formats: </P>
<UL>
<PRE>
% lp -o number-up=1 filename ENTER
% lp -o number-up=2 filename ENTER
% lp -o number-up=4 filename ENTER
</PRE>
</UL>
<P>The default format is 1-Up. </P>
<H3><A NAME=4_1_6>Setting the Brightness</A></H3>
<P>You can control the overall brightness of the printed output using
the &quot;-o brightness=percent&quot; option: </P>
<UL>
@@ -395,7 +409,7 @@ the &quot;-o brightness=percent&quot; option: </P>
</UL>
<P>Values greater than 100 will lighten the print, while values less
than 100 will darken it. </P>
<H3><A NAME=4_1_6>Setting the Gamma Correction</A></H3>
<H3><A NAME=4_1_7>Setting the Gamma Correction</A></H3>
<P>You can control the overall gamma correction of the printed output
using the &quot;-o gamma=value&quot; option: </P>
<UL>
+478 -472
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+23 -8
Ver Arquivo
@@ -2,7 +2,7 @@
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Users Manual">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.0">
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.0.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Users Manual</TITLE>
</HEAD>
@@ -11,7 +11,7 @@
<H1 ALIGN=RIGHT>Preface</H1>
This software users manual describes how to use the Common UNIX Printing
System ("CUPS") Version 1.0.0.
System ("CUPS") Version 1.0.1.
<H2>System Overview</H2>
@@ -359,14 +359,15 @@ landscape orientation:
<H3>Printing On Both Sides of the Paper</H3>
<P>The "-o sides=two-sided-short" and "-o sides=two-sided-long" options will
enable duplexing on the printer (if the printer supports it.) The "two-sided-short"
option is suitable for landscape pages, while the "two-sided-long" option is
suitable for portrait pages:
<P>The "-o sides=two-sided-short-edge" and "-o
sides=two-sided-long-edge" options will enable duplexing on the
printer (if the printer supports it.) The "two-sided-short"
option is suitable for landscape pages, while the
"two-sided-long" option is suitable for portrait pages:
<UL><PRE>
% lp -o sides=two-sided-short filename ENTER
% lp -o sides=two-sided-long filename ENTER
% lp -o sides=two-sided-short-edge filename ENTER
% lp -o sides=two-sided-long-edge filename ENTER
</PRE></UL>
<H3>Selecting a Range of Pages</H3>
@@ -391,6 +392,20 @@ the pages in the "page-range" option.
% lp -o page-set=even filename ENTER
</PRE></UL>
<H3>N-Up Printing</H3>
<P>The "-o number-up=value" option selects N-Up printing. N-Up
printing places multiple document pages on a single printed
page. CUPS supports 1-Up, 2-Up, and 4-Up formats:
<UL><PRE>
% lp -o number-up=1 filename ENTER
% lp -o number-up=2 filename ENTER
% lp -o number-up=4 filename ENTER
</PRE></UL>
<P>The default format is 1-Up.
<H3>Setting the Brightness</H3>
<P>You can control the overall brightness of the printed output using the
+2 -2
Ver Arquivo
@@ -237,10 +237,10 @@ SetCommonOptions(int num_options, /* I - Number of options */
}
if ((val = cupsGetOption("sides", num_options, options)) != NULL &&
strncmp(val, "two-", 4) == 0)
strncasecmp(val, "two-", 4) == 0)
Duplex = 1;
else if ((val = cupsGetOption("Duplex", num_options, options)) != NULL &&
strcmp(val, "DuplexNoTumble") == 0)
strncasecmp(val, "Duplex", 6) == 0)
Duplex = 1;
else if (ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") ||
ppdIsMarked(ppd, "Duplex", "DuplexTumble"))
+1 -1
Ver Arquivo
@@ -161,7 +161,7 @@ ParseCommand(FILE *fp, /* I - File to read from */
break;
case '\"' :
fscanf(fp, "%[^\"]\"", buf);
fscanf(fp, "%262143[^\"]\"", buf);
if (num_params < MAX_PARAMS)
{
p[num_params].type = PARAM_STRING;
+1 -1
Ver Arquivo
@@ -255,7 +255,7 @@ ImageSetMaxTiles(image_t *img, /* I - Image to set */
if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL)
{
switch (sscanf(cache_env, "%d%s", &max_size, cache_units))
switch (sscanf(cache_env, "%d%254s", &max_size, cache_units))
{
case 0 :
max_size = 32 * 1024 * 1024;
+2 -2
Ver Arquivo
@@ -132,11 +132,11 @@ main(int argc, /* I - Number of command-line arguments */
* separate-documents-collated-copies allows for uncollated copies.
*/
Collate = strcmp(val, "separate-documents-collated-copies") != 0;
Collate = strcasecmp(val, "separate-documents-collated-copies") != 0;
}
if ((val = cupsGetOption("Collate", num_options, options)) != NULL &&
strcmp(val, "True") == 0)
strcasecmp(val, "True") == 0)
Collate = 1;
if ((val = cupsGetOption("gamma", num_options, options)) != NULL)
+5 -5
Ver Arquivo
@@ -235,11 +235,11 @@ main(int argc, /* I - Number of command-line arguments */
* separate-documents-collated-copies allows for uncollated copies.
*/
Collate = strcmp(val, "separate-documents-collated-copies") != 0;
Collate = strcasecmp(val, "separate-documents-collated-copies") != 0;
}
if ((val = cupsGetOption("Collate", num_options, options)) != NULL &&
strcmp(val, "True") == 0)
strcasecmp(val, "True") == 0)
Collate = 1;
if ((val = cupsGetOption("gamma", num_options, options)) != NULL)
@@ -492,7 +492,7 @@ main(int argc, /* I - Number of command-line arguments */
yprint = yinches / ypages;
if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL &&
strcmp(choice->choice, "Custom") == 0)
strcasecmp(choice->choice, "Custom") == 0)
{
if (Orientation & 1)
{
@@ -950,9 +950,9 @@ exec_choice(cups_page_header_t *header, /* I - Page header */
else if (strcmp(name, "cupsMediaPosition") == 0)
header->MediaPosition = atoi(value);
else if (strcmp(name, "MediaType") == 0)
strcpy(header->MediaType, value);
strncpy(header->MediaType, value, sizeof(header->MediaType) - 1);
else if (strcmp(name, "OutputType") == 0)
strcpy(header->OutputType, value);
strncpy(header->OutputType, value, sizeof(header->OutputType) - 1);
}
}
+5 -5
Ver Arquivo
@@ -162,15 +162,15 @@ main(int argc, /* I - Number of command-line arguments */
* separate-documents-collated-copies allows for uncollated copies.
*/
Collate = strcmp(val, "separate-documents-collated-copies") != 0;
Collate = strcasecmp(val, "separate-documents-collated-copies") != 0;
}
if ((val = cupsGetOption("Collate", num_options, options)) != NULL &&
strcmp(val, "True") == 0)
strcasecmp(val, "True") == 0)
Collate = 1;
if ((val = cupsGetOption("OutputOrder", num_options, options)) != NULL &&
strcmp(val, "Reverse") == 0)
strcasecmp(val, "Reverse") == 0)
Order = 1;
if ((val = cupsGetOption("number-up", num_options, options)) != NULL)
@@ -536,9 +536,9 @@ check_range(int page) /* I - Page number */
* See if we only print even or odd pages...
*/
if (strcmp(PageSet, "even") == 0 && (page & 1))
if (strcasecmp(PageSet, "even") == 0 && (page & 1))
return (0);
if (strcmp(PageSet, "odd") == 0 && !(page & 1))
if (strcasecmp(PageSet, "odd") == 0 && !(page & 1))
return (0);
}
+2 -2
Ver Arquivo
@@ -188,7 +188,7 @@ WriteProlog(char *title, /* I - Title of job */
if ((fp = fopen(CUPS_DATADIR "/data/psglyphs", "r")) != NULL)
{
while (fscanf(fp, "%x%s", &unicode, glyph) == 2)
while (fscanf(fp, "%x%63s", &unicode, glyph) == 2)
Glyphs[unicode] = strdup(glyph);
fclose(fp);
@@ -198,7 +198,7 @@ WriteProlog(char *title, /* I - Title of job */
{
memset(chars, 0, sizeof(chars));
sprintf(filename, CUPS_DATADIR "/%s", charset + 4);
snprintf(filename, sizeof(filename), CUPS_DATADIR "/%s", charset + 4);
if ((fp = fopen(filename, "r")) != NULL)
{
+84 -84
Ver Arquivo
@@ -1,123 +1,123 @@
iso-8859-1
GIUSTO
Annullamento
Procedi
Annulla
Aiuto
Rinunciato
Vicino
Esci
Chiudi
No
Su
Fuori di
Risparmi
Scarto
Difetto
Attivo
Inattivo
Salva
Scarta
Standard
Opzioni
Più Info
Più Informazioni
Nero
Colore
Ciano
Fucsina
Colore giallo
Copyright 1993-1999 da di Easy Software Products, tutti radrizza riservato.
Generalità
Fucsia
Giallo
Copyright 1993-1999 di Easy Software Products, tutti i diritti riservati.
Generale
Stampante
Opzioni Di Immagine
Opzioni Di HP-GL/2
Supplemento
Opzioni per immagini
Opzioni per HP-GL/2
Extra
Documento
Altro
Pagine Della Stampa:
Stampa delle pagine:
Intero Documento
Gamma Di Pagina:
Ordine D'inversione:
Formato Della Pagina:
Stampa intervallo:
Ordine inverso:
Formato della pagina:
1-Up
2-Up
4-Up
Scaling Di Immagine:
Formato Naturale Di Immagine Di Uso
Zoom da Percent
Zoom da PPI
Immagine Dello Specchio:
Saturazione Di Colore:
Tonalità Di Colore:
Adattare per paginare:
Proteggendo:
Larghezza Della Penna:
Scaling dell'immagine:
Usa formato naturale dell'immagine
Zoom in percentuale
Zoom in PPI
Immagine riflessa:
Saturazione del colore:
Tonalità del colore:
Adatta alla pagina:
Ombreggiatura:
Larghezza della penna:
Correzione Gamma:
Luminosità:
Aggiungere
Cancellazione
Modificare
URI Della Stampante
Nome Della Stampante
Posizione Della Stampante
Stampante Info
Stampante fa e modella
Aggiungi
Cancella
Modifica
URI della stampante
Nome della stampante
Collocazione della stampante
Informazioni sulla stampante
Produttore e modello della stampante
URI Del Dispositivo
Pagina Di Formattazione
Stampando Pagina
D' Inizializzazione Stampante
Condizione Della Stampante
Accettando I Lavori
Non accettando I Lavori
Lavori Di Stampa
Preparazione della pagina
Stampa della Pagina
Inizializzazione Stampante
Condizione della stampante
Sto accettando le richieste di stampa
Non sto accettando le richieste di stampa
Richieste di stampa
Codice categoria
Locale
Periferico
Utilizzazione per due usi
Cucendo con punti metallici
Veloci Copie
Fascicolate Copie
Perforazione Del Foro
Covering
Legandosi
Remoto
Fronte-retro
Sto cucendo con punti metallici
Copie veloci
Copie fascicolate
Perforazione delle pagine (per fascicolatura)
Inserendo copertina
Applicando fascicolatura
Ordinando
Piccolo (fino a 9.5x1în)
Media (9.5x1în - 13x19in)
Medio (9.5x1în - 13x19in)
Grande (13x19in e più grande)
Su ordinazione Formato
Formato personalizzato
Idle
Elaborando
Arrestato
Tutto
Dispari
Anche Pagine
Pagine pari
Più Scuro Più Luminoso
Formato Di Media
Tipo Di Media
Sorgente Di Media
Formato del supporto
Tipo del supporto
Sorgente del supporto
Orientamento:
Portrait
Paesaggio
Verticale
Orizzontale
Job State
Job Name
User Name
Priority
Copies
File Size
Pending
Priorita'
Copie
Dimensioni del file
In attesa
Output Mode
Resolution
400 Il vostro browser ha trasmesso una richiesta che questo server non potrebbe capire.
Questo server non potrebbe verificare che siete autorizzati ad accedere alla risorsa.
Risoluzione
400 Il vostro browser ha trasmesso una richiesta che questo server non ha capito
Questo server non ha potuto verificare che siete autorizzati ad accedere alla risorsa.
Dovete pagare accedere a questo server.
Non avete permesso accedere alla risorsa su questo server.
Non avete il permesso di accedere alla risorsa richiesta su questo server.
La risorsa chiesta non è stata trovata su questo server.
Il metodo chiesto non è permesso con la risorsa.
Il metodo richiesto non è consentito con la risorsa desiderata.
Una rappresentazione adatta per la risorsa non è stata trovata su questo server.
Non avete permesso utilizzare questo server come calcolatore centrale di procura.
La richiesta ha preso troppo lungamente per completare ed è stata abbandonata.
Non avete il permesso utilizzare questo server come proxy.
La richiesta ha impiegato troppo tempo per essere completata ed è stata abbandonata.
La risorsa chiesta ha più di un valore.
La risorsa chiesta è andata e non è stata sostituita.
Il metodo chiesto richiede un Content-Length valido.
Il presupposto sulla richiesta ha valutato a falso.
La richiesta è troppo grande affinchè questo server elabori.
Il URI di richiesta è troppo grande affinchè questo server elabori.
Il formato di richiesta non è capito da questo server.
500 Il server ha rilevato un errore unrecoverable e non può elaborare la vostra richiesta.
Il metodo chiesto non è effettuato da questo server.
Il proxy server ha ricevuto una risposta non valida da un server verso l'alto.
La risorsa chiesta non e' piu' disponibile e non è stata ancora rimpiazzata.
Il metodo chiesto richiede un campo "Content-Length" valido.
I prerequisiti per la richiesta non sono soddisfatti.
La richiesta è troppo grande per essere elaborata da questo server.
L'URI della richiesta è troppo grande per essere elaborato da questo server.
Il formato della richiesta non è capito da questo server.
500 Il server ha rilevato un errore non recuperabile e non può elaborare la vostra richiesta.
Il metodo chiesto non è implementato da questo server.
Il proxy server ha ricevuto una risposta non valida da un server di livello superiore.
La risorsa chiesta è attualmente non disponibile su questo server.
Il proxy server ha preso troppo lungamente per rispondere a questo server.
Questo server non sostiene la versione del HTTP richiesta dal vostro browser.
Il proxy server ha impiegato troppo tempo per rispondere a questo server.
Questo server non supporta la versione HTTP richiesta dal vostro browser.
+1 -1
Ver Arquivo
@@ -86,7 +86,7 @@ gdev_prn_alloc(gx_device *pdev)
if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL)
{
switch (sscanf(cache_env, "%d%s", &cache_size, cache_units))
switch (sscanf(cache_env, "%d%254s", &cache_size, cache_units))
{
case 0 :
cache_size = 32 * 1024 * 1024;
+123 -13
Ver Arquivo
@@ -36,6 +36,7 @@
* IsAuthorized() - Check to see if the user is authorized...
* add_allow() - Add an allow mask to the location.
* add_deny() - Add a deny mask to the location.
* pam_func() - PAM conversation function.
*/
/*
@@ -51,6 +52,10 @@
#ifdef HAVE_CRYPT_H
# include <crypt.h>
#endif /* HAVE_CRYPT_H */
#ifdef HAVE_LIBPAM
# include <security/pam_appl.h>
#endif /* HAVE_LIBPAM */
/*
* Local functions...
@@ -60,6 +65,10 @@ static authmask_t *add_allow(location_t *loc);
static authmask_t *add_deny(location_t *loc);
static int check_auth(unsigned ip, char *name, int namelen,
int num_masks, authmask_t *masks);
#ifdef HAVE_LIBPAM
static int pam_func(int, const struct pam_message **,
struct pam_response **, void *);
#endif /* HAVE_LIBPAM */
/*
@@ -260,10 +269,15 @@ IsAuthorized(client_t *con) /* I - Connection */
int bestlen, /* Length of best match */
hostlen; /* Length of hostname */
struct passwd *pw; /* User password data */
struct group *grp; /* Group data */
#ifdef HAVE_SHADOW_H
struct spwd *spw; /* Shadow password data */
#endif /* HAVE_SHADOW_H */
struct group *grp; /* Group data */
#ifdef HAVE_LIBPAM
pam_handle_t *pamh; /* PAM authentication handle */
int pamerr; /* PAM error code */
struct pam_conv pamdata; /* PAM conversation data */
#endif /* HAVE_LIBPAM */
/*
@@ -348,7 +362,7 @@ IsAuthorized(client_t *con) /* I - Connection */
con->username, con->password));
if (con->username[0] == '\0' || con->password[0] == '\0')
return (HTTP_UNAUTHORIZED); /* Non-anonymous needed user/pass */
return (HTTP_UNAUTHORIZED); /* Non-anonymous needs user/pass */
/*
* Check the user's password...
@@ -364,36 +378,67 @@ IsAuthorized(client_t *con) /* I - Connection */
return (HTTP_UNAUTHORIZED);
}
if (pw->pw_passwd[0] == '\0') /* Don't allow blank passwords! */
#ifdef HAVE_LIBPAM
/*
* Only use PAM to do authentication. This allows MD5 passwords, among
* other things...
*/
pamdata.conv = pam_func;
pamdata.appdata_ptr = con;
pamerr = pam_start("passwd", con->username, &pamdata, &pamh);
if (pamerr != PAM_SUCCESS)
{
LogMessage(LOG_WARN, "IsAuthorized: Username \"%s\" has no password; access denied.",
con->username);
LogMessage(LOG_ERROR, "IsAuthorized: pam_start() returned %d!\n",
pamerr);
pam_end(pamh, 0);
return (HTTP_UNAUTHORIZED);
}
DEBUG_printf(("pw->pw_passwd = \"%s\"\n", pw->pw_passwd));
pamerr = pam_authenticate(pamh, PAM_SILENT);
if (pamerr != PAM_SUCCESS)
{
LogMessage(LOG_ERROR, "IsAuthorized: pam_authenticate() returned %d!\n",
pamerr);
pam_end(pamh, 0);
return (HTTP_UNAUTHORIZED);
}
#ifdef HAVE_SHADOW_H
pamerr = pam_acct_mgmt(pamh, PAM_SILENT);
if (pamerr != PAM_SUCCESS)
{
LogMessage(LOG_ERROR, "IsAuthorized: pam_acct_mgmt() returned %d!\n",
pamerr);
pam_end(pamh, 0);
return (HTTP_UNAUTHORIZED);
}
pam_end(pamh, PAM_SUCCESS);
#else
# ifdef HAVE_SHADOW_H
spw = getspnam(con->username);
endspent();
if (spw == NULL && strcmp(pw->pw_passwd, "x") == 0)
return (HTTP_UNAUTHORIZED); /* No such user or bad shadow file */
# ifdef DEBUG
# ifdef DEBUG
if (spw != NULL)
printf("spw->sp_pwdp = \"%s\"\n", spw->sp_pwdp);
else
puts("spw = NULL");
# endif /* DEBUG */
# endif /* DEBUG */
if (spw != NULL && spw->sp_pwdp[0] == '\0')
if (spw != NULL && spw->sp_pwdp[0] == '\0' && pw->pw_passwd[0] == '\0')
# else
if (pw->pw_passwd[0] == '\0') /* Don't allow blank passwords! */
# endif /* HAVE_SHADOW_H */
{ /* Don't allow blank passwords! */
LogMessage(LOG_WARN, "IsAuthorized: Username \"%s\" has no password; access denied.",
con->username);
return (HTTP_UNAUTHORIZED);
}
#endif /* HAVE_SHADOW_H */
/*
* OK, the password isn't blank, so compare with what came from the client...
@@ -404,7 +449,7 @@ IsAuthorized(client_t *con) /* I - Connection */
if (strcmp(pw->pw_passwd, crypt(con->password, pw->pw_passwd)) != 0)
{
#ifdef HAVE_SHADOW_H
# ifdef HAVE_SHADOW_H
if (spw != NULL)
{
DEBUG_printf(("IsAuthorized: sp_pwdp = %s, crypt = %s\n",
@@ -414,9 +459,10 @@ IsAuthorized(client_t *con) /* I - Connection */
return (HTTP_UNAUTHORIZED);
}
else
#endif /* HAVE_SHADOW_H */
# endif /* HAVE_SHADOW_H */
return (HTTP_UNAUTHORIZED);
}
#endif /* HAVE_LIBPAM */
/*
* OK, the password is good. See if we need normal user access, or group
@@ -597,6 +643,70 @@ check_auth(unsigned ip, /* I - Client address */
}
#ifdef HAVE_LIBPAM
/*
* 'pam_func()' - PAM conversation function.
*/
static int /* O - Success or failure */
pam_func(int num_msg, /* I - Number of messages */
const struct pam_message **msg, /* I - Messages */
struct pam_response **resp, /* O - Responses */
void *appdata_ptr) /* I - Pointer to connection */
{
int i; /* Looping var */
struct pam_response *replies; /* Replies */
client_t *client; /* Pointer client connection */
/*
* Allocate memory for the responses...
*/
if ((replies = malloc(sizeof(struct pam_response) * num_msg)) == NULL)
return (PAM_CONV_ERR);
/*
* Answer all of the messages...
*/
client = (client_t *)appdata_ptr;
for (i = 0; i < num_msg; i ++)
switch (msg[i]->msg_style)
{
case PAM_PROMPT_ECHO_ON:
replies[i].resp_retcode = PAM_SUCCESS;
replies[i].resp = strdup(client->username);
break;
case PAM_PROMPT_ECHO_OFF:
replies[i].resp_retcode = PAM_SUCCESS;
replies[i].resp = strdup(client->password);
break;
case PAM_TEXT_INFO:
case PAM_ERROR_MSG:
replies[i].resp_retcode = PAM_SUCCESS;
replies[i].resp = NULL;
break;
default:
free(replies);
return (PAM_CONV_ERR);
}
/*
* Return the responses back to PAM...
*/
*resp = replies;
return (PAM_SUCCESS);
}
#endif /* HAVE_LIBPAM */
/*
* End of "$Id$".
*/
+23 -22
Ver Arquivo
@@ -295,7 +295,7 @@ ReadClient(client_t *con) /* I - Client to read from */
* Grab the request line...
*/
switch (sscanf(line, "%63s%1023s%s", operation, con->uri, version))
switch (sscanf(line, "%63s%1023s%63s", operation, con->uri, version))
{
case 1 :
SendError(con, HTTP_BAD_REQUEST);
@@ -474,17 +474,17 @@ ReadClient(client_t *con) /* I - Client to read from */
if (strncmp(con->uri, "/printers", 9) == 0)
{
sprintf(command, "%s/cgi-bin/printers.cgi", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/printers.cgi", ServerRoot);
options = con->uri + 9;
}
else if (strncmp(con->uri, "/classes", 8) == 0)
{
sprintf(command, "%s/cgi-bin/classes.cgi", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/classes.cgi", ServerRoot);
options = con->uri + 8;
}
else
{
sprintf(command, "%s/cgi-bin/jobs.cgi", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/jobs.cgi", ServerRoot);
options = con->uri + 5;
}
@@ -585,17 +585,17 @@ ReadClient(client_t *con) /* I - Client to read from */
if (strncmp(con->uri, "/printers", 9) == 0)
{
sprintf(command, "%s/cgi-bin/printers", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/printers", ServerRoot);
options = con->uri + 9;
}
else if (strncmp(con->uri, "/classes", 8) == 0)
{
sprintf(command, "%s/cgi-bin/classes", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/classes", ServerRoot);
options = con->uri + 8;
}
else
{
sprintf(command, "%s/cgi-bin/jobs", ServerRoot);
snprintf(command, sizeof(command), "%s/cgi-bin/jobs", ServerRoot);
options = con->uri + 5;
}
@@ -640,7 +640,7 @@ ReadClient(client_t *con) /* I - Client to read from */
* Send PPD file...
*/
sprintf(command, "/ppd/%s", con->uri + 10);
snprintf(command, sizeof(command), "/ppd/%s", con->uri + 10);
strcpy(con->uri, command);
}
@@ -773,9 +773,9 @@ ReadClient(client_t *con) /* I - Client to read from */
* Create a file as needed for the request data...
*/
sprintf(con->filename, "%s/requests/XXXXXX", ServerRoot);
snprintf(con->filename, sizeof(con->filename), "%s/requests/XXXXXX", ServerRoot);
con->file = mkstemp(con->filename);
fchmod(con->file, 0644);
fchmod(con->file, 0640);
LogMessage(LOG_DEBUG, "ReadClient() %d REQUEST %s", con->http.fd,
con->filename);
@@ -966,11 +966,12 @@ SendError(client_t *con, /* I - Connection */
* Send a human-readable error message.
*/
sprintf(message, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>"
"<BODY><H1>%s</H1>%s</BODY></HTML>\n",
code, httpStatus(code), httpStatus(code),
con->language ? con->language->messages[code] :
httpStatus(code));
snprintf(message, sizeof(message),
"<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>"
"<BODY><H1>%s</H1>%s</BODY></HTML>\n",
code, httpStatus(code), httpStatus(code),
con->language ? con->language->messages[code] :
httpStatus(code));
if (httpPrintf(HTTP(con), "Content-Type: text/html\r\n") < 0)
return (0);
@@ -1238,7 +1239,7 @@ decode_basic_auth(client_t *con) /* I - Client to decode to */
httpDecode64(value, s);
sscanf(value, "%[^:]:%[^\n]", con->username, con->password);
sscanf(value, "%31[^:]:%31s", con->username, con->password);
LogMessage(LOG_DEBUG, "decode_basic_auth() %d username=\"%s\"",
con->http.fd, con->username);
@@ -1263,12 +1264,12 @@ get_file(client_t *con, /* I - Client connection */
*/
if (strncmp(con->uri, "/ppd/", 5) == 0)
sprintf(filename, "%s%s", ServerRoot, con->uri);
snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri);
else if (con->language != NULL)
sprintf(filename, "%s/%s%s", DocumentRoot, con->language->language,
snprintf(filename, sizeof(filename), "%s/%s%s", DocumentRoot, con->language->language,
con->uri);
else
sprintf(filename, "%s%s", DocumentRoot, con->uri);
snprintf(filename, sizeof(filename), "%s%s", DocumentRoot, con->uri);
if ((params = strchr(filename, '?')) != NULL)
*params = '\0';
@@ -1286,7 +1287,7 @@ get_file(client_t *con, /* I - Client connection */
if (strncmp(con->uri, "/ppd/", 5) != 0)
{
sprintf(filename, "%s%s", DocumentRoot, con->uri);
snprintf(filename, sizeof(filename), "%s%s", DocumentRoot, con->uri);
status = stat(filename, filestats);
}
@@ -1430,8 +1431,8 @@ pipe_command(client_t *con, /* I - Client connection */
else
{
sprintf(content_length, "CONTENT_LENGTH=%d", con->http.data_remaining);
sprintf(content_type, "CONTENT_TYPE=%s",
con->http.fields[HTTP_FIELD_CONTENT_TYPE]);
snprintf(content_type, sizeof(content_type), "CONTENT_TYPE=%s",
con->http.fields[HTTP_FIELD_CONTENT_TYPE]);
envp[12] = "REQUEST_METHOD=POST";
envp[13] = content_length;
+7 -3
Ver Arquivo
@@ -177,14 +177,18 @@ ReadConfiguration(void)
else if (strcmp(language, "C") == 0 || strcmp(language, "POSIX") == 0)
language = "en";
strcpy(DefaultLanguage, language);
strncpy(DefaultLanguage, language, sizeof(DefaultLanguage) - 1);
DefaultLanguage[sizeof(DefaultLanguage) - 1] = '\0';
strcpy(DefaultCharset, DEFAULT_CHARSET);
strcpy(RIPCache, "8m");
if (getenv("TMPDIR") == NULL)
strcpy(TempDir, "/var/tmp");
else
strcpy(TempDir, getenv("TMPDIR"));
{
strncpy(TempDir, getenv("TMPDIR"), sizeof(TempDir) - 1);
TempDir[sizeof(TempDir) - 1] = '\0';
}
/*
* Find the default system group: "sys", "system", or "root"...
@@ -837,7 +841,7 @@ get_address(char *value, /* I - Value string */
* Try to grab a hostname and port number...
*/
switch (sscanf(value, "%[^:]:%s", hostname, portname))
switch (sscanf(value, "%255[^:]:%255s", hostname, portname))
{
case 1 :
if (strchr(hostname, '.') == NULL)
+11 -5
Ver Arquivo
@@ -207,7 +207,7 @@ UpdateBrowseList(void)
packet[bytes] = '\0';
#endif /* DEBUG */
if (sscanf(packet, "%x%x%s", &type, &state, uri) != 3)
if (sscanf(packet, "%x%x%1023s", &type, &state, uri) != 3)
{
LogMessage(LOG_WARN, "UpdateBrowseList: Garbled browse packet - %s",
packet);
@@ -246,7 +246,7 @@ UpdateBrowseList(void)
*/
if (strncmp(resource, "/classes/", 9) == 0)
sprintf(name, "%s@%s", resource + 9, host);
snprintf(name, sizeof(name), "%s@%s", resource + 9, host);
else
return;
@@ -273,7 +273,10 @@ UpdateBrowseList(void)
}
}
else
strcpy(name, resource + 9);
{
strncpy(name, resource + 9, sizeof(name) - 1);
name[sizeof(name) - 1] = '\0';
}
if (p == NULL)
{
@@ -301,7 +304,7 @@ UpdateBrowseList(void)
*/
if (strncmp(resource, "/printers/", 10) == 0)
sprintf(name, "%s@%s", resource + 10, host);
snprintf(name, sizeof(name), "%s@%s", resource + 10, host);
else
return;
@@ -328,7 +331,10 @@ UpdateBrowseList(void)
}
}
else
strcpy(name, resource + 10);
{
strncpy(name, resource + 10, sizeof(name) - 1);
name[sizeof(name) - 1] = '\0';
}
if (p == NULL)
{
+135 -20
Ver Arquivo
@@ -478,11 +478,23 @@ add_class(client_t *con, /* I - Client connection */
*/
if ((attr = ippFindAttribute(con->request, "printer-location", IPP_TAG_TEXT)) != NULL)
strcpy(pclass->location, attr->values[0].string.text);
{
strncpy(pclass->location, attr->values[0].string.text, sizeof(pclass->location) - 1);
pclass->location[sizeof(pclass->location) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-info", IPP_TAG_TEXT)) != NULL)
strcpy(pclass->info, attr->values[0].string.text);
{
strncpy(pclass->info, attr->values[0].string.text, sizeof(pclass->info) - 1);
pclass->info[sizeof(pclass->info) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-more-info", IPP_TAG_URI)) != NULL)
strcpy(pclass->more_info, attr->values[0].string.text);
{
strncpy(pclass->more_info, attr->values[0].string.text, sizeof(pclass->more_info) - 1);
pclass->more_info[sizeof(pclass->more_info) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL)
{
LogMessage(LOG_INFO, "Setting %s printer-is-accepting-jobs to %d (was %d.)",
@@ -569,6 +581,7 @@ add_class(client_t *con, /* I - Client connection */
SetPrinterAttrs(pclass);
SaveAllClasses();
CheckJobs();
LogMessage(LOG_INFO, "New class \'%s\' added by \'%s\'.", pclass->name,
con->username);
@@ -690,18 +703,33 @@ add_printer(client_t *con, /* I - Client connection */
*/
if ((attr = ippFindAttribute(con->request, "printer-location", IPP_TAG_TEXT)) != NULL)
strcpy(printer->location, attr->values[0].string.text);
{
strncpy(printer->location, attr->values[0].string.text, sizeof(printer->location) - 1);
printer->location[sizeof(printer->location) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-info", IPP_TAG_TEXT)) != NULL)
strcpy(printer->info, attr->values[0].string.text);
{
strncpy(printer->info, attr->values[0].string.text, sizeof(printer->info) - 1);
printer->info[sizeof(printer->info) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-more-info", IPP_TAG_URI)) != NULL)
strcpy(printer->more_info, attr->values[0].string.text);
{
strncpy(printer->more_info, attr->values[0].string.text, sizeof(printer->more_info) - 1);
printer->more_info[sizeof(printer->more_info) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "device-uri", IPP_TAG_URI)) != NULL)
{
LogMessage(LOG_INFO, "Setting %s device-uri to \"%s\" (was \"%s\".)",
printer->name, attr->values[0].string.text, printer->device_uri);
strcpy(printer->device_uri, attr->values[0].string.text);
strncpy(printer->device_uri, attr->values[0].string.text,
sizeof(printer->device_uri) - 1);
printer->device_uri[sizeof(printer->device_uri) - 1] = '\0';
}
if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL)
{
LogMessage(LOG_INFO, "Setting %s printer-is-accepting-jobs to %d (was %d.)",
@@ -779,8 +807,15 @@ add_printer(client_t *con, /* I - Client connection */
* interfaces directory and make it executable...
*/
rename(con->filename, filename);
chmod(filename, 0755);
if (rename(con->filename, filename))
{
LogMessage(LOG_ERROR, "add_printer: Unable to rename interface script - %s!",
strerror(errno));
send_ipp_error(con, IPP_INTERNAL_ERROR);
return;
}
else
chmod(filename, 0755);
}
sprintf(filename, "%s/ppd/%s.ppd", ServerRoot, printer->name);
@@ -792,8 +827,15 @@ add_printer(client_t *con, /* I - Client connection */
* ppd directory and make it readable by all...
*/
rename(con->filename, filename);
chmod(filename, 0644);
if (rename(con->filename, filename))
{
LogMessage(LOG_ERROR, "add_printer: Unable to rename PPD file - %s!",
strerror(errno));
send_ipp_error(con, IPP_INTERNAL_ERROR);
return;
}
else
chmod(filename, 0644);
}
else
{
@@ -819,6 +861,7 @@ add_printer(client_t *con, /* I - Client connection */
SetPrinterAttrs(printer);
SaveAllPrinters();
CheckJobs();
LogMessage(LOG_INFO, "New printer \'%s\' added by \'%s\'.", printer->name,
con->username);
@@ -924,10 +967,25 @@ cancel_job(client_t *con, /* I - Client connection */
resource[HTTP_MAX_URI];
/* Resource portion of URI */
int port; /* Port portion of URI */
job_t *job; /* Job information */
DEBUG_printf(("cancel_job(%08x, %08x)\n", con, uri));
/*
* Verify that the POST operation was done to a valid URI.
*/
if (strncmp(con->uri, "/classes/", 9) != 0 &&
strncmp(con->uri, "/job/", 5) != 0 &&
strncmp(con->uri, "/printers/", 10) != 0)
{
LogMessage(LOG_ERROR, "cancel_job: cancel request on bad resource \'%s\'!",
resource);
send_ipp_error(con, IPP_NOT_AUTHORIZED);
return;
}
/*
* See if we have a job URI or a printer URI...
*/
@@ -974,17 +1032,39 @@ cancel_job(client_t *con, /* I - Client connection */
* See if the job exists...
*/
if (FindJob(jobid) == NULL)
if ((job = FindJob(jobid)) == NULL)
{
/*
* Nope - return a "not found" error...
*/
DEBUG_printf(("cancel_job: job #%d doesn't exist!\n", jobid));
LogMessage(LOG_ERROR, "cancel_job: job #%d doesn't exist!", jobid);
send_ipp_error(con, IPP_NOT_FOUND);
return;
}
/*
* See if the job is owned by the requesting user...
*/
if ((attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME)) != NULL)
{
strncpy(username, attr->values[0].string.text, sizeof(username) - 1);
username[sizeof(username) - 1] = '\0';
}
else if (con->username[0])
strcpy(username, con->username);
else
username[0] = '\0';
if (strcmp(username, job->username) != 0 && strcmp(username, "root") != 0)
{
LogMessage(LOG_ERROR, "cancel_job: \"%s\" not authorized to delete job id %d owned by \"%s\"!",
username, jobid, job->username);
send_ipp_error(con, IPP_FORBIDDEN);
return;
}
/*
* Cancel the job and return...
*/
@@ -1755,6 +1835,19 @@ print_job(client_t *con, /* I - Client connection */
DEBUG_printf(("print_job(%08x, %08x)\n", con, uri));
/*
* Verify that the POST operation was done to a valid URI.
*/
if (strncmp(con->uri, "/classes/", 9) != 0 &&
strncmp(con->uri, "/printers/", 10) != 0)
{
LogMessage(LOG_ERROR, "print_job: cancel request on bad resource \'%s\'!",
resource);
send_ipp_error(con, IPP_NOT_AUTHORIZED);
return;
}
/*
* OK, see if the client is sending the document compressed - CUPS
* doesn't support compression yet...
@@ -1764,7 +1857,7 @@ print_job(client_t *con, /* I - Client connection */
{
DEBUG_puts("print_job: Unsupported compression attribute!");
send_ipp_error(con, IPP_ATTRIBUTES);
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED, IPP_TAG_KEYWORD,
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD,
"compression", NULL, attr->values[0].string.text);
return;
}
@@ -1844,7 +1937,7 @@ print_job(client_t *con, /* I - Client connection */
DEBUG_printf(("print_job: Unsupported format \'%s\'!\n",
format->values[0].string.text));
send_ipp_error(con, IPP_DOCUMENT_FORMAT);
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED, IPP_TAG_MIMETYPE,
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, format->values[0].string.text);
return;
}
@@ -1915,7 +2008,8 @@ print_job(client_t *con, /* I - Client connection */
con->request = NULL;
strcpy(job->filename, con->filename);
strcpy(job->title, title);
strncpy(job->title, title, sizeof(job->title) - 1);
con->filename[0] = '\0';
strcpy(job->username, con->username);
@@ -2031,7 +2125,11 @@ reject_jobs(client_t *con, /* I - Client connection */
IPP_TAG_TEXT)) == NULL)
strcpy(printer->state_message, "Rejecting Jobs");
else
strcpy(printer->state_message, attr->values[0].string.text);
{
strncpy(printer->state_message, attr->values[0].string.text,
sizeof(printer->state_message) - 1);
printer->state_message[sizeof(printer->state_message) - 1] = '\0';
}
if (dtype == CUPS_PRINTER_CLASS)
LogMessage(LOG_INFO, "Class \'%s\' rejecting jobs (\'%s\').", name,
@@ -2301,7 +2399,11 @@ stop_printer(client_t *con, /* I - Client connection */
IPP_TAG_TEXT)) == NULL)
strcpy(printer->state_message, "Paused");
else
strcpy(printer->state_message, attr->values[0].string.text);
{
strncpy(printer->state_message, attr->values[0].string.text,
sizeof(printer->state_message) - 1);
printer->state_message[sizeof(printer->state_message) - 1] = '\0';
}
if (dtype == CUPS_PRINTER_CLASS)
LogMessage(LOG_INFO, "Class \'%s\' stopped by \'%s\'.", name,
@@ -2390,6 +2492,19 @@ validate_job(client_t *con, /* I - Client connection */
DEBUG_printf(("validate_job(%08x, %08x)\n", con, uri));
/*
* Verify that the POST operation was done to a valid URI.
*/
if (strncmp(con->uri, "/classes/", 9) != 0 &&
strncmp(con->uri, "/printers/", 10) != 0)
{
LogMessage(LOG_ERROR, "validate_job: request on bad resource \'%s\'!",
resource);
send_ipp_error(con, IPP_NOT_AUTHORIZED);
return;
}
/*
* OK, see if the client is sending the document compressed - CUPS
* doesn't support compression yet...
@@ -2399,7 +2514,7 @@ validate_job(client_t *con, /* I - Client connection */
{
DEBUG_puts("validate_job: Unsupported compression attribute!");
send_ipp_error(con, IPP_ATTRIBUTES);
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED, IPP_TAG_KEYWORD,
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD,
"compression", NULL, attr->values[0].string.text);
return;
}
@@ -2430,7 +2545,7 @@ validate_job(client_t *con, /* I - Client connection */
DEBUG_printf(("validate_job: Unsupported format \'%s\'!\n",
format->values[0].string.text));
send_ipp_error(con, IPP_DOCUMENT_FORMAT);
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED, IPP_TAG_MIMETYPE,
attr = ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, format->values[0].string.text);
return;
}
+2 -3
Ver Arquivo
@@ -404,8 +404,7 @@ StartJob(int id, /* I - Job ID */
(attr->value_tag == IPP_TAG_NAME ||
attr->value_tag == IPP_TAG_NAMELANG))
strcpy(title, attr->values[0].string.text);
else if ((attr->group_tag == IPP_TAG_JOB ||
attr->group_tag == IPP_TAG_EXTENSION) &&
else if (attr->group_tag == IPP_TAG_JOB &&
(optptr - options) < (sizeof(options) - 128))
{
if (attr->value_tag == IPP_TAG_MIMETYPE ||
@@ -662,7 +661,7 @@ StartJob(int id, /* I - Job ID */
if (strncmp(printer->device_uri, "file:", 5) != 0)
{
sscanf(printer->device_uri, "%[^:]", method);
sscanf(printer->device_uri, "%254[^:]", method);
sprintf(command, "%s/backend/%s", ServerRoot, method);
argv[0] = printer->device_uri;
+6 -5
Ver Arquivo
@@ -23,9 +23,10 @@
*
* Contents:
*
* LogMessage() - Log a message to the error log file.
* LogPage() - Log a page to the page log file.
* LogRequest() - Log an HTTP request in Common Log Format.
* LogMessage() - Log a message to the error log file.
* LogPage() - Log a page to the page log file.
* LogRequest() - Log an HTTP request in Common Log Format.
* get_datetime() - Returns a pointer to a date/time string.
*/
/*
@@ -356,11 +357,11 @@ get_datetime(time_t t) /* I - Time value */
sprintf(s, "[%02d/%s/%04d:%02d:%02d:%02d %+02d%02d]",
date->tm_mday, months[date->tm_mon], 1900 + date->tm_year,
date->tm_hour, date->tm_min, date->tm_sec,
#ifdef BSD
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
date->tm_gmtoff / 3600, (date->tm_gmtoff / 60) % 60);
#else
timezone / 3600, (timezone / 60) % 60);
#endif
#endif /* __*BSD__ */
return (s);
}
+6 -6
Ver Arquivo
@@ -151,7 +151,7 @@ AddPrinterFilter(printer_t *p, /* I - Printer to add to */
* super/type cost program
*/
if (sscanf(filter, "%[^/]/%s%d%s", super, type, &cost, program) != 4)
if (sscanf(filter, "%15[^/]/%31s%d%1023s", super, type, &cost, program) != 4)
{
LogMessage(LOG_ERROR, "AddPrinterFilter: Invalid filter string \"%s\"!",
filter);
@@ -816,9 +816,9 @@ SetPrinterAttrs(printer_t *p) /* I - Printer to setup */
httpSeparate(p->device_uri, method, username, host, &port, resource);
if (port)
sprintf(uri, "%s://%s:%d/%s", method, host, port, resource);
sprintf(uri, "%s://%s:%d%s", method, host, port, resource);
else
sprintf(uri, "%s://%s/%s", method, host, resource);
sprintf(uri, "%s://%s%s", method, host, resource);
}
else
{
@@ -967,11 +967,11 @@ SetPrinterAttrs(printer_t *p) /* I - Printer to setup */
else
{
/*
* Otherwise we have neither - treat this as a "generic" PostScript
* printer with no PPD file...
* Otherwise we have neither - treat this as a "dumb" printer
* with no PPD file...
*/
AddPrinterFilter(p, "application/vnd.cups-postscript 0 -");
AddPrinterFilter(p, "*/* 0 -");
}
}
+2 -2
Ver Arquivo
@@ -143,7 +143,7 @@ main(int argc, /* I - Number of command-line arguments */
* Accept/disable/enable/reject a destination...
*/
if (sscanf(argv[i], "%[^@]@%s", printer, hostname) == 1)
if (sscanf(argv[i], "%1023[^@]@%1023s", printer, hostname) == 1)
strcpy(hostname, "localhost");
if (http != NULL && strcasecmp(http->hostname, hostname) != 0)
@@ -185,7 +185,7 @@ main(int argc, /* I - Number of command-line arguments */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
sprintf(uri, "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
snprintf(uri, sizeof(uri), "ipp://%s:%d/printers/%s", hostname, ippPort(), printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
+38 -18
Ver Arquivo
@@ -66,16 +66,7 @@ main(int argc, /* I - Number of command-line arguments */
op = IPP_CANCEL_JOB;
job_id = 0;
dest = NULL;
/*
* Open a connection to the server...
*/
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
{
fputs("cancel: Unable to contact server!\n", stderr);
return (1);
}
http = NULL;
/*
* Process command-line arguments...
@@ -90,7 +81,8 @@ main(int argc, /* I - Number of command-line arguments */
break;
case 'h' : /* Connect to host */
httpClose(http);
if (http != NULL)
httpClose(http);
if (argv[i][2] != '\0')
http = httpConnect(argv[i] + 2, ippPort());
@@ -134,7 +126,7 @@ main(int argc, /* I - Number of command-line arguments */
{
dest = name;
job_id = 0;
sscanf(argv[i], "%[^-]-%d", name, &job_id);
sscanf(argv[i], "%254[^-]-%d", name, &job_id);
if (job_id)
op = IPP_CANCEL_JOB;
@@ -144,7 +136,8 @@ main(int argc, /* I - Number of command-line arguments */
* Reconnect to the named host...
*/
httpClose(http);
if (http != NULL)
httpClose(http);
*host++ = '\0';
@@ -156,6 +149,17 @@ main(int argc, /* I - Number of command-line arguments */
}
}
/*
* Open a connection to the server...
*/
if (http == NULL)
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
{
fputs("cancel: Unable to contact server!\n", stderr);
return (1);
}
/*
* Build an IPP request, which requires the following
* attributes:
@@ -163,6 +167,7 @@ main(int argc, /* I - Number of command-line arguments */
* attributes-charset
* attributes-natural-language
* printer-uri + job-id *or* job-uri
* [requesting-user-name]
*/
request = ippNew();
@@ -180,7 +185,7 @@ main(int argc, /* I - Number of command-line arguments */
if (dest)
{
sprintf(uri, "ipp://localhost/printers/%s", dest);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
@@ -193,6 +198,9 @@ main(int argc, /* I - Number of command-line arguments */
uri);
}
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
/*
* Do the request and get back a response...
*/
@@ -204,10 +212,22 @@ main(int argc, /* I - Number of command-line arguments */
if (response != NULL)
{
if (response->request.status.status_code == IPP_NOT_FOUND)
fputs("cancel: Job or printer not found!\n", stderr);
else if (response->request.status.status_code > IPP_OK_CONFLICT)
fputs("cancel: Unable to cancel job(s)!\n", stderr);
switch (response->request.status.status_code)
{
case IPP_NOT_FOUND :
fputs("cancel: Job or printer not found!\n", stderr);
break;
case IPP_NOT_AUTHORIZED :
fputs("cancel: Not authorized to cancel job(s)!\n", stderr);
break;
case IPP_FORBIDDEN :
fprintf(stderr, "cancel: You don't own job ID %d!\n", job_id);
break;
default :
if (response->request.status.status_code > IPP_OK_CONFLICT)
fputs("cancel: Unable to cancel job(s)!\n", stderr);
break;
}
ippDelete(response);
}
+46 -4
Ver Arquivo
@@ -23,7 +23,8 @@
*
* Contents:
*
* main() - Parse options and send files for printing.
* main() - Parse options and send files for printing.
* sighandler() - Signal catcher for when we print from stdin...
*/
/*
@@ -35,6 +36,25 @@
#include <cups/cups.h>
#ifndef WIN32
# include <signal.h>
/*
* Local functions.
*/
void sighandler(void);
#endif /* !WIN32 */
/*
* Globals...
*/
char tempfile[1024]; /* Temporary file for printing from stdin */
/*
* 'main()' - Parse options and send files for printing.
*/
@@ -53,7 +73,6 @@ main(int argc, /* I - Number of command-line arguments */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
int silent; /* Silent or verbose output? */
char tempfile[1024]; /* Temporary file for printing from stdin */
char buffer[8192]; /* Copy buffer */
FILE *temp; /* Temporary file pointer */
@@ -182,7 +201,8 @@ main(int argc, /* I - Number of command-line arguments */
if (job_id < 1)
{
fprintf(stderr, "lp: unable to print file \'%s\'.\n", argv[i]);
fprintf(stderr, "lp: unable to print file \'%s\' - error code %x.\n",
argv[i], cupsLastError());
return (1);
}
else if (!silent)
@@ -201,6 +221,10 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
#ifndef WIN32
signal(SIGTERM, sighandler);
#endif /* !WIN32 */
temp = fopen(cupsTempFile(tempfile, sizeof(tempfile)), "w");
if (temp == NULL)
@@ -230,7 +254,8 @@ main(int argc, /* I - Number of command-line arguments */
if (job_id < 1)
{
fputs("lp: unable to print stdin.\n", stderr);
fprintf(stderr, "lp: unable to print stdin - error code %x.\n",
cupsLastError());
return (1);
}
else if (!silent)
@@ -241,6 +266,23 @@ main(int argc, /* I - Number of command-line arguments */
}
#ifndef WIN32
/*
* 'sighandler()' - Signal catcher for when we print from stdin...
*/
void
sighandler(void)
{
/*
* Remove the temporary file we're using to print from stdin...
*/
unlink(tempfile);
}
#endif /* !WIN32 */
/*
* End of "$Id$".
*/
+13 -13
Ver Arquivo
@@ -185,11 +185,11 @@ main(int argc, /* I - Number of command-line arguments */
}
if (argv[i][2])
sprintf(filename, CUPS_DATADIR "/model/%s", argv[i] + 2);
snprintf(filename, sizeof(filename), CUPS_DATADIR "/model/%s", argv[i] + 2);
else
{
i ++;
sprintf(filename, CUPS_DATADIR "/model/%s", argv[i]);
snprintf(filename, sizeof(filename), CUPS_DATADIR "/model/%s", argv[i]);
}
set_printer_file(http, printer, filename);
@@ -393,7 +393,7 @@ add_printer_to_class(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/classes/%s", pclass);
snprintf(uri, sizeof(uri), "ipp://localhost/classes/%s", pclass);
request = ippNew();
@@ -463,7 +463,7 @@ add_printer_to_class(http_t *http, /* I - Server connection */
* OK, the printer isn't part of the class, so add it...
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
if (response != NULL &&
(members = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
@@ -520,7 +520,7 @@ default_printer(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -579,7 +579,7 @@ delete_printer(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -643,7 +643,7 @@ delete_printer_from_class(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/classes/%s", pclass);
snprintf(uri, sizeof(uri), "ipp://localhost/classes/%s", pclass);
request = ippNew();
@@ -804,7 +804,7 @@ enable_printer(http_t *http, /* I - Server connection */
* printer-is-accepting-jobs
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -870,7 +870,7 @@ set_printer_device(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -898,7 +898,7 @@ set_printer_device(http_t *http, /* I - Server connection */
* Convert filename to URI...
*/
sprintf(uri, "file:%s", device);
snprintf(uri, sizeof(uri), "file:%s", device);
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL,
uri);
}
@@ -985,7 +985,7 @@ set_printer_file(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -1050,7 +1050,7 @@ set_printer_info(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();
@@ -1113,7 +1113,7 @@ set_printer_location(http_t *http, /* I - Server connection */
* printer-uri
*/
sprintf(uri, "ipp://localhost/printers/%s", printer);
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
request = ippNew();