From: Michael R Sweet Date: Mon, 18 Sep 2023 14:58:45 +0000 (-0400) Subject: Get rid of some obsolete defines: HAVE_CRYPT_H, HAVE_DNSSD, HAVE_SHADOW_H, and X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee9f25aa9c68f470832ee4fe0a8c17ea0d420505;p=thirdparty%2Fcups.git Get rid of some obsolete defines: HAVE_CRYPT_H, HAVE_DNSSD, HAVE_SHADOW_H, and HAVE_RRESVPORT_AF. --- diff --git a/backend/dnssd.c b/backend/dnssd.c index fb978abcf3..ba98826757 100644 --- a/backend/dnssd.c +++ b/backend/dnssd.c @@ -942,8 +942,7 @@ poll_callback( #endif /* HAVE_AVAHI */ -#ifdef HAVE_DNSSD -# ifdef HAVE_MDNSRESPONDER +#ifdef HAVE_MDNSRESPONDER /* * 'query_callback()' - Process query data. */ @@ -1234,7 +1233,6 @@ query_callback( else device->make_and_model = strdup(model); } -#endif /* HAVE_DNSSD */ /* diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 12fa7de263..d2a038fc04 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -126,10 +126,8 @@ AS_IF([test x$enable_libpaper = xyes], [ AC_SUBST([LIBPAPER]) dnl Checks for header files. -AC_CHECK_HEADER([crypt.h], AC_DEFINE([HAVE_CRYPT_H], [1], [Have header?])) AC_CHECK_HEADER([langinfo.h], AC_DEFINE([HAVE_LANGINFO_H], [1], [Have header?])) AC_CHECK_HEADER([malloc.h], AC_DEFINE([HAVE_MALLOC_H], [1], [Have header?])) -AC_CHECK_HEADER([shadow.h], AC_DEFINE([HAVE_SHADOW_H], [1], [Have header?])) AC_CHECK_HEADER([stdint.h], AC_DEFINE([HAVE_STDINT_H], [1], [Have header?])) AC_CHECK_HEADER([sys/ioctl.h], AC_DEFINE([HAVE_SYS_IOCTL_H], [1], [Have header?])) AC_CHECK_HEADER([sys/param.h], AC_DEFINE([HAVE_SYS_PARAM_H], [1], [Have header?])) diff --git a/config-scripts/cups-dnssd.m4 b/config-scripts/cups-dnssd.m4 index 0ae7225375..f27c6fea22 100644 --- a/config-scripts/cups-dnssd.m4 +++ b/config-scripts/cups-dnssd.m4 @@ -34,7 +34,6 @@ AS_IF([test $with_dnssd = yes -o $with_dnssd = mdnsresponder], [ AS_CASE(["$host_os_name"], [darwin*], [ # Darwin and macOS... with_dnssd="mdnsresponder" - AC_DEFINE([HAVE_DNSSD], [1], [Have DNS-SD support?]) AC_DEFINE([HAVE_MDNSRESPONDER], [1], [Have mDNSResponder library?]) DNSSD_BACKEND="dnssd" IPPFIND_BIN="ippfind" @@ -54,7 +53,6 @@ AS_IF([test $with_dnssd = yes -o $with_dnssd = mdnsresponder], [ ], [ AC_MSG_RESULT([yes]) with_dnssd="mdnsresponder" - AC_DEFINE([HAVE_DNSSD], [1], [Have DNS-SD support?]) AC_DEFINE([HAVE_MDNSRESPONDER], [1], [Have mDNSResponder library?]) DNSSDLIBS="-ldns_sd" DNSSD_BACKEND="dnssd" @@ -89,7 +87,6 @@ AS_IF([test $with_dnssd = avahi -o $with_dnssd = yes], [ IPPFIND_MAN="ippfind.1" PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES avahi-client" AC_DEFINE([HAVE_AVAHI], [1], [Have Avahi client library?]) - AC_DEFINE([HAVE_DNSSD], [1], [Have DNS-SD support?]) ], [ AC_MSG_RESULT([no]) AS_IF([test $with_dnssd = avahi], [ diff --git a/config-scripts/cups-network.m4 b/config-scripts/cups-network.m4 index 695d0ae102..b694643ed7 100644 --- a/config-scripts/cups-network.m4 +++ b/config-scripts/cups-network.m4 @@ -27,9 +27,6 @@ AC_SEARCH_LIBS([getifaddrs], [nsl], [ AC_SEARCH_LIBS([hstrerror], [nsl socket resolv], [ AC_DEFINE([HAVE_HSTRERROR], [1], [Have the hstrerror function?]) ]) -AC_SEARCH_LIBS([rresvport_af], [nsl], [ - AC_DEFINE([HAVE_RRESVPORT_AF], [1], [Have the rresvport_af function?]) -]) AC_SEARCH_LIBS([__res_init], [resolv bind], [ AC_DEFINE([HAVE_RES_INIT], [1], [Have res_init function?]) ], [ diff --git a/config.h.in b/config.h.in index 487193177f..5a0e05b7a5 100644 --- a/config.h.in +++ b/config.h.in @@ -144,20 +144,6 @@ #undef HAVE_PAM_SETCRED -/* - * Do we have ? - */ - -#undef HAVE_SHADOW_H - - -/* - * Do we have ? - */ - -#undef HAVE_CRYPT_H - - /* * Use ? */ @@ -312,13 +298,6 @@ #undef HAVE_LIBPAPER -/* - * Do we have DNS Service Discovery (aka Bonjour) support? - */ - -#undef HAVE_DNSSD - - /* * Do we have mDNSResponder for DNS-SD? */ @@ -354,13 +333,6 @@ #undef HAVE_TM_GMTOFF -/* - * Do we have rresvport_af()? - */ - -#undef HAVE_RRESVPORT_AF - - /* * Do we have getifaddrs()? */ diff --git a/configure b/configure index f07723300c..4560943f7c 100755 --- a/configure +++ b/configure @@ -6001,14 +6001,6 @@ then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" -if test "x$ac_cv_header_crypt_h" = xyes -then : - -printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h - -fi - ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes then : @@ -6025,14 +6017,6 @@ printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default" -if test "x$ac_cv_header_shadow_h" = xyes -then : - -printf "%s\n" "#define HAVE_SHADOW_H 1" >>confdefs.h - -fi - ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes then : @@ -8578,69 +8562,6 @@ then : printf "%s\n" "#define HAVE_HSTRERROR 1" >>confdefs.h -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing rresvport_af" >&5 -printf %s "checking for library containing rresvport_af... " >&6; } -if test ${ac_cv_search_rresvport_af+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char rresvport_af (); -int -main (void) -{ -return rresvport_af (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_rresvport_af=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_rresvport_af+y} -then : - break -fi -done -if test ${ac_cv_search_rresvport_af+y} -then : - -else $as_nop - ac_cv_search_rresvport_af=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_rresvport_af" >&5 -printf "%s\n" "$ac_cv_search_rresvport_af" >&6; } -ac_res=$ac_cv_search_rresvport_af -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - -printf "%s\n" "#define HAVE_RRESVPORT_AF 1" >>confdefs.h - - fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing __res_init" >&5 @@ -10488,9 +10409,6 @@ then : # Darwin and macOS... with_dnssd="mdnsresponder" -printf "%s\n" "#define HAVE_DNSSD 1" >>confdefs.h - - printf "%s\n" "#define HAVE_MDNSRESPONDER 1" >>confdefs.h DNSSD_BACKEND="dnssd" @@ -10529,9 +10447,6 @@ then : printf "%s\n" "yes" >&6; } with_dnssd="mdnsresponder" -printf "%s\n" "#define HAVE_DNSSD 1" >>confdefs.h - - printf "%s\n" "#define HAVE_MDNSRESPONDER 1" >>confdefs.h DNSSDLIBS="-ldns_sd" @@ -10596,9 +10511,6 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_AVAHI 1" >>confdefs.h -printf "%s\n" "#define HAVE_DNSSD 1" >>confdefs.h - - else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 diff --git a/scheduler/auth.c b/scheduler/auth.c index 6ba5782275..80cf59fc99 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -18,12 +18,6 @@ #include "cupsd.h" #include -#ifdef HAVE_SHADOW_H -# include -#endif /* HAVE_SHADOW_H */ -#ifdef HAVE_CRYPT_H -# include -#endif /* HAVE_CRYPT_H */ #if HAVE_LIBPAM # ifdef HAVE_PAM_PAM_APPL_H # include @@ -628,86 +622,9 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */ } pam_end(pamh, PAM_SUCCESS); - #else - /* - * Use normal UNIX password file-based authentication... - */ - - char *pass; /* Encrypted password */ - struct passwd *pw; /* User password data */ -# ifdef HAVE_SHADOW_H - struct spwd *spw; /* Shadow password data */ -# endif /* HAVE_SHADOW_H */ - - - pw = getpwnam(username); /* Get the current password */ - endpwent(); /* Close the password file */ - - if (!pw) - { - /* - * No such user... - */ - - cupsdLogClient(con, CUPSD_LOG_ERROR, "Unknown username \"%s\".", username); - return; - } - -# ifdef HAVE_SHADOW_H - spw = getspnam(username); - endspent(); - - if (!spw && !strcmp(pw->pw_passwd, "x")) - { - /* - * Don't allow blank passwords! - */ - - cupsdLogClient(con, CUPSD_LOG_ERROR, "Username \"%s\" has no shadow password.", username); - return; - } - - if (spw && !spw->sp_pwdp[0] && !pw->pw_passwd[0]) -# else - if (!pw->pw_passwd[0]) -# endif /* HAVE_SHADOW_H */ - { - /* - * Don't allow blank passwords! - */ - - cupsdLogClient(con, CUPSD_LOG_ERROR, "Username \"%s\" has no password.", username); - return; - } - - /* - * OK, the password isn't blank, so compare with what came from the - * client... - */ - - pass = crypt(password, pw->pw_passwd); - - if (!pass || strcmp(pw->pw_passwd, pass)) - { -# ifdef HAVE_SHADOW_H - if (spw) - { - pass = crypt(password, spw->sp_pwdp); - - if (pass == NULL || strcmp(spw->sp_pwdp, pass)) - { - cupsdLogClient(con, CUPSD_LOG_ERROR, "Authentication failed for user \"%s\".", username); - return; - } - } - else -# endif /* HAVE_SHADOW_H */ - { - cupsdLogClient(con, CUPSD_LOG_ERROR, "Authentication failed for user \"%s\".", username); - return; - } - } + cupsdLogClient(con, CUPSD_LOG_ERROR, "No authentication support is available."); + return; #endif /* HAVE_LIBPAM */ } diff --git a/scheduler/client.c b/scheduler/client.c index 260f0d4969..b41b9ec6da 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -3564,7 +3564,6 @@ valid_host(cupsd_client_t *con) /* I - Client connection */ !strcmp(con->clientname, "[::1]")); } -#ifdef HAVE_DNSSD /* * Check if the hostname is something.local (Bonjour); if so, allow it. */ @@ -3579,10 +3578,8 @@ valid_host(cupsd_client_t *con) /* I - Client connection */ for (end --; end > con->clientname && *end != '.'; end --); } - if (end && (!_cups_strcasecmp(end, ".local") || - !_cups_strcasecmp(end, ".local."))) + if (end && (!_cups_strcasecmp(end, ".local") || !_cups_strcasecmp(end, ".local."))) return (1); -#endif /* HAVE_DNSSD */ /* * Check if the hostname is an IP address... @@ -3636,10 +3633,7 @@ valid_host(cupsd_client_t *con) /* I - Client connection */ } } -#ifdef HAVE_DNSSD - for (a = (cupsd_alias_t *)cupsArrayGetFirst(DNSSDAlias); - a; - a = (cupsd_alias_t *)cupsArrayGetNext(DNSSDAlias)) + for (a = (cupsd_alias_t *)cupsArrayGetFirst(DNSSDAlias); a; a = (cupsd_alias_t *)cupsArrayGetNext(DNSSDAlias)) { /* * "ServerAlias *" allows all host values through... @@ -3660,7 +3654,6 @@ valid_host(cupsd_client_t *con) /* I - Client connection */ return (1); } } -#endif /* HAVE_DNSSD */ /* * Check for interface hostname matches... diff --git a/scheduler/conf.c b/scheduler/conf.c index 80dc806112..2221120a82 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -68,9 +68,7 @@ typedef struct static const cupsd_var_t cupsd_vars[] = { { "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN }, -#ifdef HAVE_DNSSD { "BrowseDNSSDSubTypes", &DNSSDSubTypes, CUPSD_VARTYPE_STRING }, -#endif /* HAVE_DNSSD */ { "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN }, { "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN }, { "Classification", &Classification, CUPSD_VARTYPE_STRING }, @@ -81,9 +79,7 @@ static const cupsd_var_t cupsd_vars[] = { "DefaultPolicy", &DefaultPolicy, CUPSD_VARTYPE_STRING }, { "DefaultShared", &DefaultShared, CUPSD_VARTYPE_BOOLEAN }, { "DirtyCleanInterval", &DirtyCleanInterval, CUPSD_VARTYPE_TIME }, -#ifdef HAVE_DNSSD { "DNSSDHostName", &DNSSDHostName, CUPSD_VARTYPE_STRING }, -#endif /* HAVE_DNSSD */ { "ErrorPolicy", &ErrorPolicy, CUPSD_VARTYPE_STRING }, { "FilterLimit", &FilterLimit, CUPSD_VARTYPE_INTEGER }, { "FilterNice", &FilterNice, CUPSD_VARTYPE_INTEGER }, @@ -729,10 +725,8 @@ cupsdReadConfiguration(void) Browsing = CUPS_DEFAULT_BROWSING; DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; -#ifdef HAVE_DNSSD cupsdSetString(&DNSSDSubTypes, "_cups,_print,_universal"); cupsdClearString(&DNSSDHostName); -#endif /* HAVE_DNSSD */ cupsdSetString(&ErrorPolicy, CUPS_DEFAULT_ERROR_POLICY); diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 23ff775008..6b926cfdd1 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -36,7 +36,6 @@ static int avahi_running = 0; * Local functions... */ -#ifdef HAVE_DNSSD static char *get_auth_info_required(cupsd_printer_t *p, char *buffer, size_t bufsize); # ifdef __APPLE__ @@ -73,7 +72,6 @@ static void dnssdStop(void); static void dnssdUpdate(void); # endif /* HAVE_MDNSRESPONDER */ static void dnssdUpdateDNSSDName(int from_callback); -#endif /* HAVE_DNSSD */ /* @@ -103,10 +101,8 @@ cupsdDeregisterPrinter( * Announce the deletion... */ -#ifdef HAVE_DNSSD if (removeit && (BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster) dnssdDeregisterPrinter(p, 1, 0); -#endif /* HAVE_DNSSD */ } @@ -125,10 +121,8 @@ cupsdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */ (p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER))) return; -#ifdef HAVE_DNSSD if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster) dnssdRegisterPrinter(p, 0); -#endif /* HAVE_DNSSD */ } @@ -142,7 +136,6 @@ cupsdStartBrowsing(void) if (!Browsing || !BrowseLocalProtocols) return; -#ifdef HAVE_DNSSD if (BrowseLocalProtocols & BROWSE_DNSSD) { # ifdef HAVE_MDNSRESPONDER @@ -218,7 +211,6 @@ cupsdStartBrowsing(void) */ dnssdRegisterAllPrinters(0); -#endif /* HAVE_DNSSD */ } @@ -232,7 +224,6 @@ cupsdStopBrowsing(void) if (!Browsing || !BrowseLocalProtocols) return; -#ifdef HAVE_DNSSD /* * De-register the individual printers */ @@ -245,11 +236,9 @@ cupsdStopBrowsing(void) if ((BrowseLocalProtocols & BROWSE_DNSSD) && DNSSDMaster) dnssdStop(); -#endif /* HAVE_DNSSD */ } -#ifdef HAVE_DNSSD /* * 'cupsdUpdateDNSSDName()' - Update the computer name we use for browsing... */ @@ -1611,4 +1600,3 @@ get_auth_info_required( return ("none"); } -#endif /* HAVE_DNSSD */ diff --git a/scheduler/dirsvc.h b/scheduler/dirsvc.h index f21de5c69f..17cfdf81a6 100644 --- a/scheduler/dirsvc.h +++ b/scheduler/dirsvc.h @@ -28,7 +28,6 @@ VAR int Browsing VALUE(TRUE), BrowseLocalProtocols VALUE(BROWSE_ALL); /* Protocols to support for local printers */ -#ifdef HAVE_DNSSD VAR char *DNSSDComputerName VALUE(NULL), /* Computer/server name */ *DNSSDHostName VALUE(NULL), @@ -52,7 +51,6 @@ VAR AvahiClient *DNSSDClient VALUE(NULL); # endif /* HAVE_MDNSRESPONDER */ VAR cupsd_srv_t WebIFSrv VALUE(NULL); /* Service reference for the web interface */ -#endif /* HAVE_DNSSD */ /* @@ -63,6 +61,4 @@ extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit); extern void cupsdRegisterPrinter(cupsd_printer_t *p); extern void cupsdStartBrowsing(void); extern void cupsdStopBrowsing(void); -#ifdef HAVE_DNSSD extern void cupsdUpdateDNSSDName(void); -#endif /* HAVE_DNSSD */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 8ab2ed028b..0203f3feb4 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -4960,7 +4960,6 @@ copy_printer_attrs( if (!ra || cupsArrayFind(ra, "printer-current-time")) ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", ippTimeToDate(curtime)); -#ifdef HAVE_DNSSD if (!ra || cupsArrayFind(ra, "printer-dns-sd-name")) { if (printer->reg_name) @@ -4968,7 +4967,6 @@ copy_printer_attrs( else ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE, "printer-dns-sd-name", 0); } -#endif /* HAVE_DNSSD */ if (!ra || cupsArrayFind(ra, "printer-error-policy")) ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-error-policy", NULL, printer->error_policy); @@ -5617,12 +5615,9 @@ create_local_printer( * compare case-insensitively. */ -#ifdef HAVE_DNSSD if (DNSSDHostName) nameptr = DNSSDHostName; - else -#endif - if (ServerName) + else if (ServerName) nameptr = ServerName; else nameptr = NULL; diff --git a/scheduler/main.c b/scheduler/main.c index b5f172b67d..aba269df1e 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -825,9 +825,7 @@ main(int argc, /* I - Number of command-line args */ * Got an error from select! */ -#ifdef HAVE_DNSSD cupsd_printer_t *p; /* Current printer */ -#endif /* HAVE_DNSSD */ if (errno == EINTR) /* Just interrupted by a signal */ continue; @@ -867,14 +865,9 @@ main(int argc, /* I - Number of command-line args */ job->print_pipes[0], job->print_pipes[1], job->back_pipes[0], job->back_pipes[1]); -#ifdef HAVE_DNSSD - for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); - p; - p = (cupsd_printer_t *)cupsArrayNext(Printers)) + for (p = (cupsd_printer_t *)cupsArrayFirst(Printers); p; p = (cupsd_printer_t *)cupsArrayNext(Printers)) cupsdLogMessage(CUPSD_LOG_EMERG, "printer[%s] reg_name=\"%s\"", p->name, p->reg_name ? p->reg_name : "(null)"); -#endif /* HAVE_DNSSD */ - break; } diff --git a/scheduler/printers.c b/scheduler/printers.c index ce879c01d5..46ebe613f2 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -744,10 +744,8 @@ cupsdDeletePrinter( cupsdClearString(&p->alert); cupsdClearString(&p->alert_description); -#ifdef HAVE_DNSSD cupsdClearString(&p->pdl); cupsdClearString(&p->reg_name); -#endif /* HAVE_DNSSD */ cupsArrayDelete(p->filetypes); @@ -3534,6 +3532,8 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ /* MIME type name */ const char *preferred = "image/urf"; /* document-format-preferred value */ + char pdl[1024]; /* Buffer to build pdl list */ + mime_filter_t *filter; /* MIME filter looping var */ /* @@ -3608,9 +3608,7 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ if (i) attr->values[0].string.text = _cupsStrAlloc("application/octet-stream"); - for (type = (mime_type_t *)cupsArrayFirst(p->filetypes); - type; - i ++, type = (mime_type_t *)cupsArrayNext(p->filetypes)) + for (type = (mime_type_t *)cupsArrayFirst(p->filetypes); type; i ++, type = (mime_type_t *)cupsArrayNext(p->filetypes)) { snprintf(mimetype, sizeof(mimetype), "%s/%s", type->super, type->type); @@ -3619,63 +3617,51 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_MIMETYPE), "document-format-preferred", NULL, preferred); -#ifdef HAVE_DNSSD + /* + * We only support raw printing if this is not a Tioga PrintJobMgr based + * queue and if application/octet-stream is a known type... + */ + + for (filter = (mime_filter_t *)cupsArrayFirst(MimeDatabase->filters); filter; filter = (mime_filter_t *)cupsArrayNext(MimeDatabase->filters)) { - char pdl[1024]; /* Buffer to build pdl list */ - mime_filter_t *filter; /* MIME filter looping var */ + if (filter->dst == p->filetype && strstr(filter->filter, "PrintJobMgr")) + break; + } + pdl[0] = '\0'; - /* - * We only support raw printing if this is not a Tioga PrintJobMgr based - * queue and if application/octet-stream is a known type... - */ + /* + * Then list a bunch of formats that are supported by the printer... + */ - for (filter = (mime_filter_t *)cupsArrayFirst(MimeDatabase->filters); - filter; - filter = (mime_filter_t *)cupsArrayNext(MimeDatabase->filters)) + for (type = (mime_type_t *)cupsArrayFirst(p->filetypes); type; type = (mime_type_t *)cupsArrayNext(p->filetypes)) + { + if (!_cups_strcasecmp(type->super, "application")) { - if (filter->dst == p->filetype && strstr(filter->filter, "PrintJobMgr")) - break; + if (!_cups_strcasecmp(type->type, "pdf")) + cupsConcatString(pdl, "application/pdf,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "postscript")) + cupsConcatString(pdl, "application/postscript,", sizeof(pdl)); } - - pdl[0] = '\0'; - - /* - * Then list a bunch of formats that are supported by the printer... - */ - - for (type = (mime_type_t *)cupsArrayFirst(p->filetypes); - type; - type = (mime_type_t *)cupsArrayNext(p->filetypes)) + else if (!_cups_strcasecmp(type->super, "image")) { - if (!_cups_strcasecmp(type->super, "application")) - { - if (!_cups_strcasecmp(type->type, "pdf")) - cupsConcatString(pdl, "application/pdf,", sizeof(pdl)); - else if (!_cups_strcasecmp(type->type, "postscript")) - cupsConcatString(pdl, "application/postscript,", sizeof(pdl)); - } - else if (!_cups_strcasecmp(type->super, "image")) - { - if (!_cups_strcasecmp(type->type, "jpeg")) - cupsConcatString(pdl, "image/jpeg,", sizeof(pdl)); - else if (!_cups_strcasecmp(type->type, "png")) - cupsConcatString(pdl, "image/png,", sizeof(pdl)); - else if (!_cups_strcasecmp(type->type, "pwg-raster")) - cupsConcatString(pdl, "image/pwg-raster,", sizeof(pdl)); - else if (!_cups_strcasecmp(type->type, "urf")) - cupsConcatString(pdl, "image/urf,", sizeof(pdl)); - } + if (!_cups_strcasecmp(type->type, "jpeg")) + cupsConcatString(pdl, "image/jpeg,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "png")) + cupsConcatString(pdl, "image/png,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "pwg-raster")) + cupsConcatString(pdl, "image/pwg-raster,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "urf")) + cupsConcatString(pdl, "image/urf,", sizeof(pdl)); } + } - if (pdl[0]) - pdl[strlen(pdl) - 1] = '\0'; /* Remove trailing comma */ + if (pdl[0]) + pdl[strlen(pdl) - 1] = '\0'; /* Remove trailing comma */ - cupsdLogMessage(CUPSD_LOG_DEBUG, "%s: pdl='%s'", p->name, pdl); + cupsdLogMessage(CUPSD_LOG_DEBUG, "%s: pdl='%s'", p->name, pdl); - cupsdSetString(&p->pdl, pdl); - } -#endif /* HAVE_DNSSD */ + cupsdSetString(&p->pdl, pdl); } diff --git a/scheduler/printers.h b/scheduler/printers.h index bb765c1e0d..4d8fd38e0a 100644 --- a/scheduler/printers.h +++ b/scheduler/printers.h @@ -114,7 +114,6 @@ struct cupsd_printer_s time_t marker_time; /* Last time marker attributes were updated */ _ppd_cache_t *pc; /* PPD cache and mapping data */ -#ifdef HAVE_DNSSD char *reg_name, /* Name used for service registration */ *pdl; /* pdl value for TXT record */ cupsd_srv_t ipp_srv; /* IPP service(s) */ @@ -122,7 +121,6 @@ struct cupsd_printer_s cupsd_srv_t ipps_srv; /* IPPS service(s) */ cupsd_srv_t printer_srv; /* LPD service */ # endif /* HAVE_MDNSRESPONDER */ -#endif /* HAVE_DNSSD */ }; diff --git a/scheduler/sysman.c b/scheduler/sysman.c index e4630de1e1..4a9e9fce57 100644 --- a/scheduler/sysman.c +++ b/scheduler/sysman.c @@ -1021,13 +1021,11 @@ sysUpdateNames(void) p = (cupsd_printer_t *)cupsArrayNext(Printers)) cupsdDeregisterPrinter(p, 1); -# ifdef HAVE_DNSSD /* * Update the computer name and BTMM domain list... */ cupsdUpdateDNSSDName(); -# endif /* HAVE_DNSSD */ /* * Now re-register them... diff --git a/vcnet/config.h b/vcnet/config.h index 22f06a1c35..62e5723859 100644 --- a/vcnet/config.h +++ b/vcnet/config.h @@ -228,20 +228,6 @@ typedef unsigned long useconds_t; /* #undef HAVE_PAM_SETCRED */ -/* - * Do we have ? - */ - -/* #undef HAVE_SHADOW_H */ - - -/* - * Do we have ? - */ - -/* #undef HAVE_CRYPT_H */ - - /* * Use ? */ @@ -405,13 +391,6 @@ typedef unsigned long useconds_t; /* #undef HAVE_LIBPAPER */ -/* - * Do we have DNS Service Discovery (aka Bonjour) support? - */ - -#define HAVE_DNSSD 1 - - /* * Do we have mDNSResponder for DNS-SD? */ @@ -447,13 +426,6 @@ typedef unsigned long useconds_t; /* #undef HAVE_TM_GMTOFF */ -/* - * Do we have rresvport_af()? - */ - -/* #undef HAVE_RRESVPORT_AF */ - - /* * Do we have getifaddrs()? */ diff --git a/xcode/config.h b/xcode/config.h index 0160c53453..108eaf7118 100644 --- a/xcode/config.h +++ b/xcode/config.h @@ -148,20 +148,6 @@ #endif /* TARGET_OS_OSX */ -/* - * Do we have ? - */ - -/* #undef HAVE_SHADOW_H */ - - -/* - * Do we have ? - */ - -/* #undef HAVE_CRYPT_H */ - - /* * Use ? */ @@ -330,13 +316,6 @@ /* #undef HAVE_LIBPAPER */ -/* - * Do we have DNS Service Discovery (aka Bonjour) support? - */ - -#define HAVE_DNSSD 1 - - /* * Do we have mDNSResponder for DNS-SD? */ @@ -372,13 +351,6 @@ #define HAVE_TM_GMTOFF 1 -/* - * Do we have rresvport_af()? - */ - -#define HAVE_RRESVPORT_AF 1 - - /* * Do we have getifaddrs()? */