diff options
author | Łukasz Stelmach <l.stelmach@samsung.com> | 2013-10-04 13:55:11 +0200 |
---|---|---|
committer | Łukasz Stelmach <l.stelmach@samsung.com> | 2013-10-04 13:55:11 +0200 |
commit | 4daab3758f62250691d3994850ddd3a7faf80d5e (patch) | |
tree | 895f25ab9018c6f343a261f0c1e5e3ae0bdd9362 /cgi-bin | |
parent | 4c8dd44ec57d63e728bda99034c043b8941419df (diff) | |
download | cups-4daab3758f62250691d3994850ddd3a7faf80d5e.tar.gz cups-4daab3758f62250691d3994850ddd3a7faf80d5e.tar.bz2 cups-4daab3758f62250691d3994850ddd3a7faf80d5e.zip |
Imported Upstream version 1.6.4upstream/1.6.4
Diffstat (limited to 'cgi-bin')
-rw-r--r-- | cgi-bin/Dependencies | 157 | ||||
-rw-r--r-- | cgi-bin/Makefile | 8 | ||||
-rw-r--r-- | cgi-bin/admin.c | 261 | ||||
-rw-r--r-- | cgi-bin/cgi-private.h | 7 | ||||
-rw-r--r-- | cgi-bin/cgi.h | 4 | ||||
-rw-r--r-- | cgi-bin/classes.c | 14 | ||||
-rw-r--r-- | cgi-bin/help-index.c | 61 | ||||
-rw-r--r-- | cgi-bin/help-index.h | 4 | ||||
-rw-r--r-- | cgi-bin/help.c | 4 | ||||
-rw-r--r-- | cgi-bin/html.c | 4 | ||||
-rw-r--r-- | cgi-bin/ipp-var.c | 21 | ||||
-rw-r--r-- | cgi-bin/jobs.c | 8 | ||||
-rw-r--r-- | cgi-bin/makedocset.c | 8 | ||||
-rw-r--r-- | cgi-bin/printers.c | 14 | ||||
-rw-r--r-- | cgi-bin/search.c | 4 | ||||
-rw-r--r-- | cgi-bin/template.c | 4 | ||||
-rw-r--r-- | cgi-bin/testcgi.c | 4 | ||||
-rw-r--r-- | cgi-bin/testhi.c | 4 | ||||
-rw-r--r-- | cgi-bin/testtemplate.c | 4 | ||||
-rw-r--r-- | cgi-bin/var.c | 4 | ||||
-rw-r--r-- | cgi-bin/websearch.c | 4 |
21 files changed, 236 insertions, 367 deletions
diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index 9b7f87e..ff16e48 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -1,84 +1,73 @@ -# DO NOT DELETE - -help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -help-index.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -help-index.o: ../cups/array.h ../cups/language.h ../cups/array.h help-index.h -help-index.o: ../cups/debug-private.h ../cups/versioning.h -help-index.o: ../cups/language-private.h ../cups/transcode.h -help-index.o: ../cups/string-private.h ../config.h ../cups/dir.h -html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -html.o: ../cups/language.h ../cups/array.h help-index.h -html.o: ../cups/debug-private.h ../cups/versioning.h -html.o: ../cups/language-private.h ../cups/transcode.h -html.o: ../cups/string-private.h ../config.h -ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -ipp-var.o: ../cups/language.h ../cups/array.h help-index.h -ipp-var.o: ../cups/debug-private.h ../cups/versioning.h -ipp-var.o: ../cups/language-private.h ../cups/transcode.h -ipp-var.o: ../cups/string-private.h ../config.h -search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -search.o: ../cups/language.h ../cups/array.h help-index.h -search.o: ../cups/debug-private.h ../cups/versioning.h -search.o: ../cups/language-private.h ../cups/transcode.h -search.o: ../cups/string-private.h ../config.h -template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -template.o: ../cups/language.h ../cups/array.h help-index.h -template.o: ../cups/debug-private.h ../cups/versioning.h -template.o: ../cups/language-private.h ../cups/transcode.h -template.o: ../cups/string-private.h ../config.h -var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -var.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h -var.o: ../cups/array.h help-index.h ../cups/debug-private.h -var.o: ../cups/versioning.h ../cups/language-private.h ../cups/transcode.h -var.o: ../cups/string-private.h ../config.h ../cups/http.h -var.o: ../cups/md5-private.h -admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -admin.o: ../cups/language.h ../cups/array.h help-index.h -admin.o: ../cups/debug-private.h ../cups/versioning.h -admin.o: ../cups/language-private.h ../cups/transcode.h -admin.o: ../cups/string-private.h ../config.h ../cups/adminutil.h -admin.o: ../cups/cups.h ../cups/ppd.h -classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -classes.o: ../cups/language.h ../cups/array.h help-index.h -classes.o: ../cups/debug-private.h ../cups/versioning.h -classes.o: ../cups/language-private.h ../cups/transcode.h -classes.o: ../cups/string-private.h ../config.h -help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -help.o: ../cups/language.h ../cups/array.h help-index.h -help.o: ../cups/debug-private.h ../cups/versioning.h -help.o: ../cups/language-private.h ../cups/transcode.h -help.o: ../cups/string-private.h ../config.h -jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -jobs.o: ../cups/language.h ../cups/array.h help-index.h -jobs.o: ../cups/debug-private.h ../cups/versioning.h -jobs.o: ../cups/language-private.h ../cups/transcode.h -jobs.o: ../cups/string-private.h ../config.h -makedocset.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h -makedocset.o: ../cups/array.h help-index.h -printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h -printers.o: ../cups/language.h ../cups/array.h help-index.h -printers.o: ../cups/debug-private.h ../cups/versioning.h -printers.o: ../cups/language-private.h ../cups/transcode.h -printers.o: ../cups/string-private.h ../config.h -testcgi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h -testcgi.o: ../cups/array.h help-index.h -testhi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testhi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h -testhi.o: ../cups/array.h help-index.h -testtemplate.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/array.h -testtemplate.o: ../cups/language.h ../cups/array.h help-index.h -websearch.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -websearch.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h -websearch.o: ../cups/array.h help-index.h +help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \ + ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \ + ../cups/array.h ../cups/language.h help-index.h \ + ../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h \ + ../cups/dir.h +html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h \ + ../cups/md5-private.h +admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h \ + ../cups/adminutil.h ../cups/ppd.h +classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +makedocset.o: makedocset.c cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h +printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h ../cups/debug-private.h \ + ../cups/language-private.h ../cups/transcode.h \ + ../cups/string-private.h ../config.h ../cups/ipp-private.h +testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h +testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h +testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h +websearch.o: websearch.c cgi.h ../cups/cups.h ../cups/file.h \ + ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ + ../cups/language.h help-index.h diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile index 9f20ff6..a3d5265 100644 --- a/cgi-bin/Makefile +++ b/cgi-bin/Makefile @@ -1,9 +1,9 @@ # -# "$Id: Makefile 8983 2010-02-13 02:20:23Z mike $" +# "$Id: Makefile 11173 2013-07-23 12:31:34Z msweet $" # # CGI makefile for CUPS. # -# Copyright 2007-2010 by Apple Inc. +# Copyright 2007-2012 by Apple Inc. # Copyright 1997-2006 by Easy Software Products. # # These coded instructions, statements, and computer programs are the @@ -90,7 +90,7 @@ clean: # depend: - makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1 + $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies # @@ -378,5 +378,5 @@ include Dependencies # -# End of "$Id: Makefile 8983 2010-02-13 02:20:23Z mike $". +# End of "$Id: Makefile 11173 2013-07-23 12:31:34Z msweet $". # diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index a695c61..c30b590 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,9 +1,9 @@ /* - * "$Id: admin.c 9901 2011-08-17 21:01:53Z mike $" + * "$Id: admin.c 11173 2013-07-23 12:31:34Z msweet $" * * Administration CGI for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -523,7 +523,7 @@ do_add_rss_subscription(http_t *http) /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(_("Add RSS Subscription")); - cgiShowIPPError(_("Unable to add RSS subscription:")); + cgiShowIPPError(_("Unable to add RSS subscription")); } else { @@ -586,8 +586,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type", CUPS_PRINTER_LOCAL); ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask", - CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE | - CUPS_PRINTER_IMPLICIT); + CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE); /* * Do the request and get back a response... @@ -811,8 +810,8 @@ do_am_class(http_t *http, /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(modify ? _("Unable to modify class:") : - _("Unable to add class:")); + cgiShowIPPError(modify ? _("Unable to modify class") : + _("Unable to add class")); } else { @@ -1056,8 +1055,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ else { cgiStartHTML(title); - cgiShowIPPError(modify ? _("Unable to modify printer:") : - _("Unable to add printer:")); + cgiShowIPPError(modify ? _("Unable to modify printer") : + _("Unable to add printer")); cgiEndHTML(); return; } @@ -1318,7 +1317,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ else { cgiStartHTML(title); - cgiShowIPPError(_("Unable to get list of printer drivers:")); + cgiShowIPPError(_("Unable to get list of printer drivers")); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); } @@ -1416,8 +1415,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(modify ? _("Unable to modify printer:") : - _("Unable to add printer:")); + cgiShowIPPError(modify ? _("Unable to modify printer") : + _("Unable to add printer")); } else if (modify) { @@ -1523,7 +1522,7 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(_("Cancel RSS Subscription")); - cgiShowIPPError(_("Unable to cancel RSS subscription:")); + cgiShowIPPError(_("Unable to cancel RSS subscription")); } else { @@ -1558,10 +1557,10 @@ do_config_server(http_t *http) /* I - HTTP connection */ int advanced, /* Advanced settings shown? */ changed; /* Have settings changed? */ const char *debug_logging, /* DEBUG_LOGGING value */ + *preserve_jobs = NULL, + /* PRESERVE_JOBS value */ *remote_admin, /* REMOTE_ADMIN value */ *remote_any, /* REMOTE_ANY value */ - *remote_printers, - /* REMOTE_PRINTERS value */ *share_printers,/* SHARE_PRINTERS value */ *user_cancel_any, /* USER_CANCEL_ANY value */ @@ -1577,10 +1576,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ /* MaxJobs value */ *max_log_size = NULL; /* MaxLogSize value */ - char local_protocols[255], - /* BrowseLocalProtocols */ - remote_protocols[255]; - /* BrowseRemoteProtocols */ const char *current_browse_web_if, /* BrowseWebIF value */ *current_preserve_job_history, @@ -1591,12 +1586,8 @@ do_config_server(http_t *http) /* I - HTTP connection */ /* MaxClients value */ *current_max_jobs, /* MaxJobs value */ - *current_max_log_size, + *current_max_log_size; /* MaxLogSize value */ - *current_local_protocols, - /* BrowseLocalProtocols */ - *current_remote_protocols; - /* BrowseRemoteProtocols */ #ifdef HAVE_GSSAPI char default_auth_type[255]; /* DefaultAuthType value */ @@ -1611,7 +1602,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ debug_logging = cgiGetVariable("DEBUG_LOGGING") ? "1" : "0"; remote_admin = cgiGetVariable("REMOTE_ADMIN") ? "1" : "0"; remote_any = cgiGetVariable("REMOTE_ANY") ? "1" : "0"; - remote_printers = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0"; share_printers = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0"; user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0"; @@ -1623,80 +1613,37 @@ do_config_server(http_t *http) /* I - HTTP connection */ */ browse_web_if = cgiGetVariable("BROWSE_WEB_IF") ? "Yes" : "No"; - preserve_job_history = cgiGetVariable("PRESERVE_JOB_HISTORY") ? "Yes" : "No"; - preserve_job_files = cgiGetVariable("PRESERVE_JOB_FILES") ? "Yes" : "No"; max_clients = cgiGetVariable("MAX_CLIENTS"); - max_jobs = cgiGetVariable("MAX_JOBS"); max_log_size = cgiGetVariable("MAX_LOG_SIZE"); + preserve_jobs = cgiGetVariable("PRESERVE_JOBS"); - if (!max_clients || atoi(max_clients) <= 0) - max_clients = "100"; - - if (!max_jobs || atoi(max_jobs) <= 0) - max_jobs = "500"; - - if (!max_log_size || atof(max_log_size) <= 0.0) - max_log_size = "1m"; - - if (cgiGetVariable("BROWSE_LOCAL_CUPS")) - strcpy(local_protocols, "cups"); - else - local_protocols[0] = '\0'; - -#ifdef HAVE_DNSSD - if (cgiGetVariable("BROWSE_LOCAL_DNSSD")) + if (preserve_jobs) { - if (local_protocols[0]) - strcat(local_protocols, " dnssd"); - else - strcat(local_protocols, "dnssd"); - } -#endif /* HAVE_DNSSD */ + max_jobs = cgiGetVariable("MAX_JOBS"); + preserve_job_history = cgiGetVariable("PRESERVE_JOB_HISTORY"); + preserve_job_files = cgiGetVariable("PRESERVE_JOB_FILES"); -#ifdef HAVE_LDAP - if (cgiGetVariable("BROWSE_LOCAL_LDAP")) - { - if (local_protocols[0]) - strcat(local_protocols, " ldap"); - else - strcat(local_protocols, "ldap"); - } -#endif /* HAVE_LDAP */ + if (!max_jobs || atoi(max_jobs) < 0) + max_jobs = "500"; -#ifdef HAVE_LIBSLP - if (cgiGetVariable("BROWSE_LOCAL_SLP")) - { - if (local_protocols[0]) - strcat(local_protocols, " slp"); - else - strcat(local_protocols, "slp"); - } -#endif /* HAVE_SLP */ + if (!preserve_job_history) + preserve_job_history = "On"; - if (cgiGetVariable("BROWSE_REMOTE_CUPS")) - strcpy(remote_protocols, "cups"); + if (!preserve_job_files) + preserve_job_files = "1d"; + } else - remote_protocols[0] = '\0'; - -#ifdef HAVE_LDAP - if (cgiGetVariable("BROWSE_REMOTE_LDAP")) { - if (remote_protocols[0]) - strcat(remote_protocols, " ldap"); - else - strcat(remote_protocols, "ldap"); + max_jobs = "0"; + preserve_job_history = "No"; + preserve_job_files = "No"; } -#endif /* HAVE_LDAP */ -#ifdef HAVE_LIBSLP - if (cgiGetVariable("BROWSE_REMOTE_SLP")) - { - if (remote_protocols[0]) - strcat(remote_protocols, " slp"); - else - strcat(remote_protocols, "slp"); - } -#endif /* HAVE_SLP */ + if (!max_clients || atoi(max_clients) <= 0) + max_clients = "100"; + + if (!max_log_size || atoi(max_log_size) <= 0.0) + max_log_size = "1m"; } /* @@ -1707,7 +1654,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ { cgiStartHTML(cgiText(_("Change Settings"))); cgiSetVariable("MESSAGE", - cgiText(_("Unable to change server settings:"))); + cgiText(_("Unable to change server settings"))); cgiSetVariable("ERROR", cupsLastErrorString()); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -1746,7 +1693,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ if ((current_preserve_job_files = cupsGetOption("PreserveJobFiles", num_settings, settings)) == NULL) - current_preserve_job_files = "No"; + current_preserve_job_files = "1d"; if ((current_max_clients = cupsGetOption("MaxClients", num_settings, settings)) == NULL) @@ -1760,16 +1707,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ settings)) == NULL) current_max_log_size = "1m"; - if ((current_local_protocols = cupsGetOption("BrowseLocalProtocols", - num_settings, - settings)) == NULL) - current_local_protocols = CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS; - - if ((current_remote_protocols = cupsGetOption("BrowseRemoteProtocols", - num_settings, - settings)) == NULL) - current_remote_protocols = CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS; - /* * See if the settings have changed... */ @@ -1780,8 +1717,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ num_settings, settings)) || strcmp(remote_any, cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings, settings)) || - strcmp(remote_printers, cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, - num_settings, settings)) || strcmp(share_printers, cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings, settings)) || #ifdef HAVE_GSSAPI @@ -1793,9 +1728,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ num_settings, settings)); if (advanced && !changed) - changed = _cups_strcasecmp(local_protocols, current_local_protocols) || - _cups_strcasecmp(remote_protocols, current_remote_protocols) || - _cups_strcasecmp(browse_web_if, current_browse_web_if) || + changed = _cups_strcasecmp(browse_web_if, current_browse_web_if) || _cups_strcasecmp(preserve_job_history, current_preserve_job_history) || _cups_strcasecmp(preserve_job_files, current_preserve_job_files) || _cups_strcasecmp(max_clients, current_max_clients) || @@ -1817,8 +1750,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ remote_admin, num_settings, &settings); num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY, remote_any, num_settings, &settings); - num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS, - remote_printers, num_settings, &settings); num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, share_printers, num_settings, &settings); num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, @@ -1834,12 +1765,6 @@ do_config_server(http_t *http) /* I - HTTP connection */ * Add advanced settings... */ - if (_cups_strcasecmp(local_protocols, current_local_protocols)) - num_settings = cupsAddOption("BrowseLocalProtocols", local_protocols, - num_settings, &settings); - if (_cups_strcasecmp(remote_protocols, current_remote_protocols)) - num_settings = cupsAddOption("BrowseRemoteProtocols", remote_protocols, - num_settings, &settings); if (_cups_strcasecmp(browse_web_if, current_browse_web_if)) num_settings = cupsAddOption("BrowseWebIF", browse_web_if, num_settings, &settings); @@ -1871,14 +1796,15 @@ do_config_server(http_t *http) /* I - HTTP connection */ cgiStartHTML(cgiText(_("Change Settings"))); cgiSetVariable("MESSAGE", - cgiText(_("Unable to change server settings:"))); + cgiText(_("Unable to change server settings"))); cgiSetVariable("ERROR", cupsLastErrorString()); cgiCopyTemplateLang("error.tmpl"); } else { if (advanced) - cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect&URL=/admin/?ADVANCEDSETTINGS=YES"); + cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect&" + "URL=/admin/?ADVANCEDSETTINGS=YES"); else cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect"); cgiStartHTML(cgiText(_("Change Settings"))); @@ -1921,7 +1847,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { cgiStartHTML(cgiText(_("Edit Configuration File"))); - cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file:"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -1933,7 +1859,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ if ((temp = cupsFileOpenFd(tempfd, "w")) == NULL) { cgiStartHTML(cgiText(_("Edit Configuration File"))); - cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file:"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -1983,7 +1909,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ else if (status != HTTP_CREATED) { cgiSetVariable("MESSAGE", - cgiText(_("Unable to upload cupsd.conf file:"))); + cgiText(_("Unable to upload cupsd.conf file"))); cgiSetVariable("ERROR", httpStatus(status)); cgiStartHTML(cgiText(_("Edit Configuration File"))); @@ -2030,7 +1956,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ { cgiStartHTML(cgiText(_("Edit Configuration File"))); cgiSetVariable("MESSAGE", - cgiText(_("Unable to access cupsd.conf file:"))); + cgiText(_("Unable to access cupsd.conf file"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2043,7 +1969,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ { cgiStartHTML(cgiText(_("Edit Configuration File"))); cgiSetVariable("MESSAGE", - cgiText(_("Unable to access cupsd.conf file:"))); + cgiText(_("Unable to access cupsd.conf file"))); cgiSetVariable("ERROR", cgiText(_("Unable to edit cupsd.conf files larger than " "1MB"))); @@ -2067,7 +1993,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ cgiStartHTML(cgiText(_("Edit Configuration File"))); cgiSetVariable("MESSAGE", - cgiText(_("Unable to access cupsd.conf file:"))); + cgiText(_("Unable to access cupsd.conf file"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2224,7 +2150,7 @@ do_delete_class(http_t *http) /* I - HTTP connection */ cgiStartHTML(cgiText(_("Delete Class"))); if (cupsLastError() > IPP_OK_CONFLICT) - cgiShowIPPError(_("Unable to delete class:")); + cgiShowIPPError(_("Unable to delete class")); else cgiCopyTemplateLang("class-deleted.tmpl"); @@ -2309,7 +2235,7 @@ do_delete_printer(http_t *http) /* I - HTTP connection */ cgiStartHTML(cgiText(_("Delete Printer"))); if (cupsLastError() > IPP_OK_CONFLICT) - cgiShowIPPError(_("Unable to delete printer:")); + cgiShowIPPError(_("Unable to delete printer")); else cgiCopyTemplateLang("printer-deleted.tmpl"); @@ -2359,8 +2285,7 @@ do_export(http_t *http) /* I - HTTP connection */ "printer-type", 0); ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, - "printer-type-mask", CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE | - CUPS_PRINTER_IMPLICIT); + "printer-type-mask", CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "printer-name"); @@ -2696,10 +2621,6 @@ do_menu(http_t *http) /* I - HTTP connection */ settings)) != NULL && atoi(val)) cgiSetVariable("REMOTE_ANY", "CHECKED"); - if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings, - settings)) != NULL && atoi(val)) - cgiSetVariable("REMOTE_PRINTERS", "CHECKED"); - if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings, settings)) != NULL && atoi(val)) cgiSetVariable("SHARE_PRINTERS", "CHECKED"); @@ -2718,53 +2639,6 @@ do_menu(http_t *http) /* I - HTTP connection */ #endif /* HAVE_GSSAPI */ cgiSetVariable("KERBEROS", ""); -#ifdef HAVE_DNSSD - cgiSetVariable("HAVE_DNSSD", "1"); -#endif /* HAVE_DNSSD */ - -#ifdef HAVE_LDAP - cgiSetVariable("HAVE_LDAP", "1"); -#endif /* HAVE_LDAP */ - -#ifdef HAVE_LIBSLP - cgiSetVariable("HAVE_LIBSLP", "1"); -#endif /* HAVE_LIBSLP */ - - if ((val = cupsGetOption("BrowseRemoteProtocols", num_settings, - settings)) == NULL) - if ((val = cupsGetOption("BrowseProtocols", num_settings, - settings)) == NULL) - val = CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS; - - if (strstr(val, "cups") || strstr(val, "CUPS")) - cgiSetVariable("BROWSE_REMOTE_CUPS", "CHECKED"); - - if (strstr(val, "ldap") || strstr(val, "LDAP")) - cgiSetVariable("BROWSE_REMOTE_LDAP", "CHECKED"); - - if (strstr(val, "slp") || strstr(val, "SLP")) - cgiSetVariable("BROWSE_REMOTE_SLP", "CHECKED"); - - if ((val = cupsGetOption("BrowseLocalProtocols", num_settings, - settings)) == NULL) - if ((val = cupsGetOption("BrowseProtocols", num_settings, - settings)) == NULL) - val = CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS; - - if (strstr(val, "cups") || strstr(val, "CUPS")) - cgiSetVariable("BROWSE_LOCAL_CUPS", "CHECKED"); - - if (strstr(val, "dnssd") || strstr(val, "DNSSD") || - strstr(val, "dns-sd") || strstr(val, "DNS-SD") || - strstr(val, "bonjour") || strstr(val, "BONJOUR")) - cgiSetVariable("BROWSE_LOCAL_DNSSD", "CHECKED"); - - if (strstr(val, "ldap") || strstr(val, "LDAP")) - cgiSetVariable("BROWSE_LOCAL_LDAP", "CHECKED"); - - if (strstr(val, "slp") || strstr(val, "SLP")) - cgiSetVariable("BROWSE_LOCAL_SLP", "CHECKED"); - if ((val = cupsGetOption("BrowseWebIF", num_settings, settings)) == NULL) val = "No"; @@ -2777,18 +2651,25 @@ do_menu(http_t *http) /* I - HTTP connection */ settings)) == NULL) val = "Yes"; - if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") || - !_cups_strcasecmp(val, "true")) + if (val && + (!_cups_strcasecmp(val, "0") || !_cups_strcasecmp(val, "no") || + !_cups_strcasecmp(val, "off") || !_cups_strcasecmp(val, "false") || + !_cups_strcasecmp(val, "disabled"))) + { + cgiSetVariable("PRESERVE_JOB_HISTORY", "0"); + cgiSetVariable("PRESERVE_JOB_FILES", "0"); + } + else { - cgiSetVariable("PRESERVE_JOB_HISTORY", "CHECKED"); + cgiSetVariable("PRESERVE_JOBS", "CHECKED"); + cgiSetVariable("PRESERVE_JOB_HISTORY", val); if ((val = cupsGetOption("PreserveJobFiles", num_settings, settings)) == NULL) - val = "No"; + val = "1d"; + + cgiSetVariable("PRESERVE_JOB_FILES", val); - if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") || - !_cups_strcasecmp(val, "true")) - cgiSetVariable("PRESERVE_JOB_FILES", "CHECKED"); } if ((val = cupsGetOption("MaxClients", num_settings, settings)) == NULL) @@ -2956,7 +2837,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */ exit(0); } else if (cupsLastError() > IPP_OK_CONFLICT) - cgiShowIPPError(_("Unable to get printer attributes:")); + cgiShowIPPError(_("Unable to get printer attributes")); else cgiCopyTemplateLang("users.tmpl"); @@ -3106,7 +2987,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(cgiText(_("Set Allowed Users"))); - cgiShowIPPError(_("Unable to change printer:")); + cgiShowIPPError(_("Unable to change printer")); } else { @@ -3193,7 +3074,7 @@ do_set_default(http_t *http) /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(_("Unable to set server default:")); + cgiShowIPPError(_("Unable to set server default")); } else { @@ -3302,7 +3183,7 @@ do_set_options(http_t *http, /* I - HTTP connection */ if ((ppd = ppdOpenFile(filename)) == NULL) { cgiSetVariable("ERROR", ppdErrorString(ppdLastError(&i))); - cgiSetVariable("MESSAGE", cgiText(_("Unable to open PPD file:"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to open PPD file"))); cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -3923,7 +3804,7 @@ do_set_options(http_t *http, /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(_("Unable to set options:")); + cgiShowIPPError(_("Unable to set options")); } else { @@ -4022,7 +3903,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(cgiText(_("Set Publishing"))); - cgiShowIPPError(_("Unable to change printer-is-shared attribute:")); + cgiShowIPPError(_("Unable to change printer-is-shared attribute")); } else { @@ -4337,5 +4218,5 @@ get_points(double number, /* I - Original number */ /* - * End of "$Id: admin.c 9901 2011-08-17 21:01:53Z mike $". + * End of "$Id: admin.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/cgi-private.h b/cgi-bin/cgi-private.h index 73d80c0..348da08 100644 --- a/cgi-bin/cgi-private.h +++ b/cgi-bin/cgi-private.h @@ -1,9 +1,9 @@ /* - * "$Id: cgi-private.h 9042 2010-03-24 00:45:34Z mike $" + * "$Id: cgi-private.h 11173 2013-07-23 12:31:34Z msweet $" * * Private CGI definitions for CUPS. * - * Copyright 2007-2010 by Apple Inc. + * Copyright 2007-2011 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -21,6 +21,7 @@ #include <cups/debug-private.h> #include <cups/language-private.h> #include <cups/string-private.h> +#include <cups/ipp-private.h> /* TODO: Update so we don't need this */ /* @@ -31,5 +32,5 @@ /* - * End of "$Id: cgi-private.h 9042 2010-03-24 00:45:34Z mike $". + * End of "$Id: cgi-private.h 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/cgi.h b/cgi-bin/cgi.h index c6562ab..4d76a02 100644 --- a/cgi-bin/cgi.h +++ b/cgi-bin/cgi.h @@ -1,5 +1,5 @@ /* - * "$Id: cgi.h 8976 2010-02-02 07:12:05Z mike $" + * "$Id: cgi.h 11173 2013-07-23 12:31:34Z msweet $" * * CGI support library definitions for CUPS. * @@ -115,5 +115,5 @@ extern const char *cgiText(const char *message); #endif /* !_CUPS_CGI_H_ */ /* - * End of "$Id: cgi.h 8976 2010-02-02 07:12:05Z mike $". + * End of "$Id: cgi.h 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/classes.c b/cgi-bin/classes.c index b8f5e7c..47bcedf 100644 --- a/cgi-bin/classes.c +++ b/cgi-bin/classes.c @@ -1,9 +1,9 @@ /* - * "$Id: classes.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: classes.c 11173 2013-07-23 12:31:34Z msweet $" * * Class status CGI for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -257,7 +257,7 @@ do_class_op(http_t *http, /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(_("Unable to do maintenance command:")); + cgiShowIPPError(_("Unable to do maintenance command")); } else { @@ -380,7 +380,7 @@ show_all_classes(http_t *http, /* I - Connection to server */ sprintf(val, "%d", count); cgiSetVariable("TOTAL", val); - if ((var = cgiGetVariable("ORDER")) != NULL) + if ((var = cgiGetVariable("ORDER")) != NULL && *var) ascending = !_cups_strcasecmp(var, "asc"); else ascending = 1; @@ -447,7 +447,7 @@ show_all_classes(http_t *http, /* I - Connection to server */ * Show the error... */ - cgiShowIPPError(_("Unable to get class list:")); + cgiShowIPPError(_("Unable to get class list")); } cgiEndHTML(); @@ -546,7 +546,7 @@ show_class(http_t *http, /* I - Connection to server */ */ cgiStartHTML(pclass); - cgiShowIPPError(_("Unable to get class status:")); + cgiShowIPPError(_("Unable to get class status")); } cgiEndHTML(); @@ -554,5 +554,5 @@ show_class(http_t *http, /* I - Connection to server */ /* - * End of "$Id: classes.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: classes.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index ce97be3..195c1f6 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -1,5 +1,5 @@ /* - * "$Id: help-index.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: help-index.c 11173 2013-07-23 12:31:34Z msweet $" * * Online help index routines for CUPS. * @@ -161,7 +161,8 @@ static int help_load_file(help_index_t *hi, static help_node_t *help_new_node(const char *filename, const char *anchor, const char *section, const char *text, time_t mtime, off_t offset, - size_t length); + size_t length) + __attribute__((nonnull(1,3,4))); static int help_sort_by_name(help_node_t *p1, help_node_t *p2); static int help_sort_by_score(help_node_t *p1, help_node_t *p2); static int help_sort_words(help_word_t *w1, help_word_t *w2); @@ -177,7 +178,7 @@ helpDeleteIndex(help_index_t *hi) /* I - Help index */ help_node_t *node; /* Current node */ - DEBUG_printf(("helpDeleteIndex(hi=%p)\n", hi)); + DEBUG_printf(("helpDeleteIndex(hi=%p)", hi)); if (!hi) return; @@ -209,8 +210,8 @@ helpFindNode(help_index_t *hi, /* I - Index */ help_node_t key; /* Search key */ - DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")\n", - hi, filename ? filename : "(nil)", anchor ? anchor : "(nil)")); + DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")", + hi, filename, anchor)); /* * Range check input... @@ -259,7 +260,7 @@ helpLoadIndex(const char *hifile, /* I - Index filename */ help_word_t *word; /* Current word */ - DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")\n", + DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")", hifile, directory)); /* @@ -464,7 +465,7 @@ helpSaveIndex(help_index_t *hi, /* I - Index */ help_word_t *word; /* Current word */ - DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")\n", hi, hifile)); + DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")", hi, hifile)); /* * Try creating a new index file... @@ -545,9 +546,8 @@ helpSearchIndex(help_index_t *hi, /* I - Index */ int matches; /* Number of matches */ - DEBUG_printf(("helpSearchIndex(hi=%p, query=\"%s\", filename=\"%s\")\n", - hi, query ? query : "(nil)", - filename ? filename : "(nil)")); + DEBUG_printf(("helpSearchIndex(hi=%p, query=\"%s\", filename=\"%s\")", + hi, query, filename)); /* * Range check... @@ -670,7 +670,7 @@ help_add_word(help_node_t *n, /* I - Node */ key; /* Search key */ - DEBUG_printf(("help_add_word(n=%p, text=\"%s\")\n", n, text)); + DEBUG_printf(("2help_add_word(n=%p, text=\"%s\")", n, text)); /* * Create the words array as needed... @@ -723,7 +723,7 @@ help_delete_node(help_node_t *n) /* I - Node */ help_word_t *w; /* Current word */ - DEBUG_printf(("help_delete_node(n=%p)\n", n)); + DEBUG_printf(("2help_delete_node(n=%p)", n)); if (!n) return; @@ -758,7 +758,7 @@ help_delete_node(help_node_t *n) /* I - Node */ static void help_delete_word(help_word_t *w) /* I - Word */ { - DEBUG_printf(("help_delete_word(w=%p)\n", w)); + DEBUG_printf(("2help_delete_word(w=%p)", w)); if (!w) return; @@ -789,8 +789,8 @@ help_load_directory( help_node_t *node; /* Current node */ - DEBUG_printf(("help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")\n", - hi, directory ? directory : "(nil)", relative ? relative : "(nil)")); + DEBUG_printf(("2help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")", + hi, directory, relative)); /* * Open the directory and scan it... @@ -901,9 +901,8 @@ help_load_file( int wordlen; /* Length of word */ - DEBUG_printf(("help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", mtime=%ld)\n", - hi, filename ? filename : "(nil)", - relative ? relative : "(nil)", mtime)); + DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", " + "mtime=%ld)", hi, filename, relative, mtime)); if ((fp = cupsFileOpen(filename, "r")) == NULL) return (-1); @@ -1229,11 +1228,9 @@ help_new_node(const char *filename, /* I - Filename */ help_node_t *n; /* Node */ - DEBUG_printf(("help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", " - "mtime=%ld, offset=%ld, length=%ld)\n", - filename ? filename : "(nil)", anchor ? anchor : "(nil)", - text ? text : "(nil)", (long)mtime, (long)offset, - (long)length)); + DEBUG_printf(("2help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", " + "mtime=%ld, offset=%ld, length=%ld)", filename, anchor, text, + (long)mtime, (long)offset, (long)length)); n = (help_node_t *)calloc(1, sizeof(help_node_t)); if (!n) @@ -1262,9 +1259,9 @@ help_sort_by_name(help_node_t *n1, /* I - First node */ int diff; /* Difference */ - DEBUG_printf(("help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)\n", - n1, n1->filename, n1->anchor ? n1->anchor : "", - n2, n2->filename, n2->anchor ? n2->anchor : "")); + DEBUG_printf(("2help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)", + n1, n1->filename, n1->anchor, + n2, n2->filename, n2->anchor)); if ((diff = strcmp(n1->filename, n2->filename)) != 0) return (diff); @@ -1291,10 +1288,10 @@ help_sort_by_score(help_node_t *n1, /* I - First node */ int diff; /* Difference */ - DEBUG_printf(("help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), " - "n2=%p(%d \"%s\" \"%s\")\n", - n1, n1->score, n1->section ? n1->section : "", n1->text, - n2, n2->score, n2->section ? n2->section : "", n2->text)); + DEBUG_printf(("2help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), " + "n2=%p(%d \"%s\" \"%s\")", + n1, n1->score, n1->section, n1->text, + n2, n2->score, n2->section, n2->text)); if (n1->score != n2->score) return (n2->score - n1->score); @@ -1319,7 +1316,7 @@ static int /* O - Difference */ help_sort_words(help_word_t *w1, /* I - Second word */ help_word_t *w2) /* I - Second word */ { - DEBUG_printf(("help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))\n", + DEBUG_printf(("2help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))", w1, w1->text, w2, w2->text)); return (_cups_strcasecmp(w1->text, w2->text)); @@ -1327,5 +1324,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */ /* - * End of "$Id: help-index.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: help-index.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/help-index.h b/cgi-bin/help-index.h index 253b587..4b03969 100644 --- a/cgi-bin/help-index.h +++ b/cgi-bin/help-index.h @@ -1,5 +1,5 @@ /* - * "$Id: help-index.h 9771 2011-05-12 05:21:56Z mike $" + * "$Id: help-index.h 11173 2013-07-23 12:31:34Z msweet $" * * Online help index definitions for CUPS. * @@ -83,5 +83,5 @@ extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query, #endif /* !_CUPS_HELP_INDEX_H_ */ /* - * End of "$Id: help-index.h 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: help-index.h 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/help.c b/cgi-bin/help.c index 215c98b..c8fc66e 100644 --- a/cgi-bin/help.c +++ b/cgi-bin/help.c @@ -1,5 +1,5 @@ /* - * "$Id$" + * "$Id: help.c 11173 2013-07-23 12:31:34Z msweet $" * * Online help CGI for CUPS. * @@ -393,5 +393,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id$". + * End of "$Id: help.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/html.c b/cgi-bin/html.c index 9893298..b721ee3 100644 --- a/cgi-bin/html.c +++ b/cgi-bin/html.c @@ -1,5 +1,5 @@ /* - * "$Id: html.c 9449 2011-01-08 00:56:50Z mike $" + * "$Id: html.c 11173 2013-07-23 12:31:34Z msweet $" * * HTML support functions for CUPS. * @@ -235,5 +235,5 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */ /* - * End of "$Id: html.c 9449 2011-01-08 00:56:50Z mike $". + * End of "$Id: html.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c index 8f13c27..a1d7f38 100644 --- a/cgi-bin/ipp-var.c +++ b/cgi-bin/ipp-var.c @@ -1,9 +1,9 @@ /* - * "$Id: ipp-var.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: ipp-var.c 11173 2013-07-23 12:31:34Z msweet $" * * CGI <-> IPP variable routines for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -554,8 +554,8 @@ cgiPrintCommand(http_t *http, /* I - Connection to server */ ipp_t *request, /* Get-Job-Attributes request */ *response; /* Get-Job-Attributes response */ ipp_attribute_t *attr; /* Current job attribute */ - static const char const *job_attrs[] =/* Job attributes we want */ - { + static const char * const job_attrs[] = + { /* Job attributes we want */ "job-state", "job-printer-state-message" }; @@ -792,7 +792,7 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */ cgiStartHTML(cgiText(_("Print Test Page"))); if (cupsLastError() > IPP_OK_CONFLICT) - cgiShowIPPError(_("Unable to print test page:")); + cgiShowIPPError(_("Unable to print test page")); else { cgiSetVariable("PRINTER_NAME", dest); @@ -1219,7 +1219,7 @@ cgiSetIPPObjectVars( "%dx%d%s", attr->values[i].resolution.xres, attr->values[i].resolution.yres, attr->values[i].resolution.units == IPP_RES_PER_INCH ? - "dpi" : "dpc"); + "dpi" : "dpcm"); break; case IPP_TAG_URI : @@ -1432,7 +1432,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/"); - if ((which_jobs = cgiGetVariable("which_jobs")) != NULL) + if ((which_jobs = cgiGetVariable("which_jobs")) != NULL && *which_jobs) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs", NULL, which_jobs); @@ -1480,10 +1480,11 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ if (first < 0) first = 0; - if ((var = cgiGetVariable("ORDER")) != NULL) + if ((var = cgiGetVariable("ORDER")) != NULL && *var) ascending = !_cups_strcasecmp(var, "asc"); else - ascending = !which_jobs || !_cups_strcasecmp(which_jobs, "not-completed"); + ascending = !which_jobs || !*which_jobs || + !_cups_strcasecmp(which_jobs, "not-completed"); section = cgiGetVariable("SECTION"); @@ -1588,5 +1589,5 @@ cgiText(const char *message) /* I - Message */ /* - * End of "$Id: ipp-var.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: ipp-var.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/jobs.c b/cgi-bin/jobs.c index 6863505..95c8d1d 100644 --- a/cgi-bin/jobs.c +++ b/cgi-bin/jobs.c @@ -1,9 +1,9 @@ /* - * "$Id: jobs.c 9771 2011-05-12 05:21:56Z mike $" + * "$Id: jobs.c 11173 2013-07-23 12:31:34Z msweet $" * * Job status CGI for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -195,7 +195,7 @@ do_job_op(http_t *http, /* I - HTTP connection */ cgiStartHTML(cgiText(_("Jobs"))); if (cupsLastError() > IPP_OK_CONFLICT) - cgiShowIPPError(_("Job operation failed:")); + cgiShowIPPError(_("Job operation failed")); else if (op == IPP_CANCEL_JOB) cgiCopyTemplateLang("job-cancel.tmpl"); else if (op == IPP_HOLD_JOB) @@ -210,5 +210,5 @@ do_job_op(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: jobs.c 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: jobs.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/makedocset.c b/cgi-bin/makedocset.c index a87f9ce..079c59f 100644 --- a/cgi-bin/makedocset.c +++ b/cgi-bin/makedocset.c @@ -1,9 +1,9 @@ /* - * "$Id: makedocset.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: makedocset.c 11173 2013-07-23 12:31:34Z msweet $" * * Xcode documentation set generator. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -31,7 +31,7 @@ * Include necessary headers... */ -#include "cgi.h" +#include "cgi-private.h" #include <errno.h> @@ -482,5 +482,5 @@ write_nodes(const char *path, /* I - File to write */ /* - * End of "$Id: makedocset.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: makedocset.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/printers.c b/cgi-bin/printers.c index 89f2a1b..f61d407 100644 --- a/cgi-bin/printers.c +++ b/cgi-bin/printers.c @@ -1,9 +1,9 @@ /* - * "$Id: printers.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: printers.c 11173 2013-07-23 12:31:34Z msweet $" * * Printer status CGI for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -266,7 +266,7 @@ do_printer_op(http_t *http, /* I - HTTP connection */ else if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiShowIPPError(_("Unable to do maintenance command:")); + cgiShowIPPError(_("Unable to do maintenance command")); } else { @@ -397,7 +397,7 @@ show_all_printers(http_t *http, /* I - Connection to server */ sprintf(val, "%d", count); cgiSetVariable("TOTAL", val); - if ((var = cgiGetVariable("ORDER")) != NULL) + if ((var = cgiGetVariable("ORDER")) != NULL && *var) ascending = !_cups_strcasecmp(var, "asc"); else ascending = 1; @@ -464,7 +464,7 @@ show_all_printers(http_t *http, /* I - Connection to server */ * Show the error... */ - cgiShowIPPError(_("Unable to get printer list:")); + cgiShowIPPError(_("Unable to get printer list")); } cgiEndHTML(); @@ -566,7 +566,7 @@ show_printer(http_t *http, /* I - Connection to server */ */ cgiStartHTML(printer); - cgiShowIPPError(_("Unable to get printer status:")); + cgiShowIPPError(_("Unable to get printer status")); } cgiEndHTML(); @@ -574,5 +574,5 @@ show_printer(http_t *http, /* I - Connection to server */ /* - * End of "$Id: printers.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: printers.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/search.c b/cgi-bin/search.c index 75c47bd..8fd8221 100644 --- a/cgi-bin/search.c +++ b/cgi-bin/search.c @@ -1,5 +1,5 @@ /* - * "$Id: search.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: search.c 11173 2013-07-23 12:31:34Z msweet $" * * Search routines for CUPS. * @@ -377,5 +377,5 @@ cgiFreeSearch(void *search) /* I - Search context */ /* - * End of "$Id: search.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: search.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/template.c b/cgi-bin/template.c index 8fb8b3f..7c36c67 100644 --- a/cgi-bin/template.c +++ b/cgi-bin/template.c @@ -1,5 +1,5 @@ /* - * "$Id: template.c 9793 2011-05-20 03:49:49Z mike $" + * "$Id: template.c 11173 2013-07-23 12:31:34Z msweet $" * * CGI template function. * @@ -729,5 +729,5 @@ cgi_puturi(const char *s, /* I - String to output */ /* - * End of "$Id: template.c 9793 2011-05-20 03:49:49Z mike $". + * End of "$Id: template.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/testcgi.c b/cgi-bin/testcgi.c index 0ed1269..e59986a 100644 --- a/cgi-bin/testcgi.c +++ b/cgi-bin/testcgi.c @@ -1,5 +1,5 @@ /* - * "$Id: testcgi.c 9771 2011-05-12 05:21:56Z mike $" + * "$Id: testcgi.c 11173 2013-07-23 12:31:34Z msweet $" * * CGI test program for CUPS. * @@ -71,5 +71,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: testcgi.c 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: testcgi.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/testhi.c b/cgi-bin/testhi.c index 93f1f63..a257b70 100644 --- a/cgi-bin/testhi.c +++ b/cgi-bin/testhi.c @@ -1,5 +1,5 @@ /* - * "$Id: testhi.c 9771 2011-05-12 05:21:56Z mike $" + * "$Id: testhi.c 11173 2013-07-23 12:31:34Z msweet $" * * Help index test program for CUPS. * @@ -109,5 +109,5 @@ list_nodes(const char *title, /* I - Title string */ /* - * End of "$Id: testhi.c 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: testhi.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/testtemplate.c b/cgi-bin/testtemplate.c index 6ced30c..979296e 100644 --- a/cgi-bin/testtemplate.c +++ b/cgi-bin/testtemplate.c @@ -1,5 +1,5 @@ /* - * "$Id: testtemplate.c 9771 2011-05-12 05:21:56Z mike $" + * "$Id: testtemplate.c 11173 2013-07-23 12:31:34Z msweet $" * * CGI template test program for CUPS. * @@ -99,5 +99,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: testtemplate.c 9771 2011-05-12 05:21:56Z mike $". + * End of "$Id: testtemplate.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/var.c b/cgi-bin/var.c index 90fbc83..c124778 100644 --- a/cgi-bin/var.c +++ b/cgi-bin/var.c @@ -1,5 +1,5 @@ /* - * "$Id: var.c 10367 2012-03-21 04:09:04Z mike $" + * "$Id: var.c 11173 2013-07-23 12:31:34Z msweet $" * * CGI form variable and array functions for CUPS. * @@ -1307,5 +1307,5 @@ cgi_unlink_file(void) /* - * End of "$Id: var.c 10367 2012-03-21 04:09:04Z mike $". + * End of "$Id: var.c 11173 2013-07-23 12:31:34Z msweet $". */ diff --git a/cgi-bin/websearch.c b/cgi-bin/websearch.c index f096ba2..91ed4b1 100644 --- a/cgi-bin/websearch.c +++ b/cgi-bin/websearch.c @@ -1,5 +1,5 @@ /* - * "$Id: websearch.c 8668 2009-05-21 00:21:27Z mike $" + * "$Id: websearch.c 11173 2013-07-23 12:31:34Z msweet $" * * Web search program for www.cups.org. * @@ -112,5 +112,5 @@ list_nodes(help_index_t *hi, /* I - Help index */ /* - * End of "$Id: websearch.c 8668 2009-05-21 00:21:27Z mike $". + * End of "$Id: websearch.c 11173 2013-07-23 12:31:34Z msweet $". */ |