diff --git a/scheduler/conf.c b/scheduler/conf.c index bc52d2a..bc13b44 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -576,6 +576,9 @@ cupsdReadConfiguration(void) cupsdClearString(&ServerName); cupsdClearString(&ServerAdmin); cupsdSetString(&ServerBin, CUPS_SERVERBIN); +#ifdef __x86_64__ + cupsdSetString(&ServerBin_compat, "/usr/lib64/cups"); +#endif /* __x86_64__ */ cupsdSetString(&RequestRoot, CUPS_REQUESTS); cupsdSetString(&CacheDir, CUPS_CACHEDIR); cupsdSetString(&DataDir, CUPS_DATADIR); @@ -1531,7 +1534,12 @@ cupsdReadConfiguration(void) * Read the MIME type and conversion database... */ +#ifdef __x86_64__ + snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin, + ServerBin_compat); +#else snprintf(temp, sizeof(temp), "%s/filter", ServerBin); +#endif snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir); MimeDatabase = mimeNew(); diff --git a/scheduler/conf.h b/scheduler/conf.h index 873c370..d1be882 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -106,6 +106,10 @@ VAR char *ConfigurationFile VALUE(NULL), /* Root directory for scheduler */ *ServerBin VALUE(NULL), /* Root directory for binaries */ +#ifdef __x86_64__ + *ServerBin_compat VALUE(NULL), + /* Compat directory for binaries */ +#endif /* __x86_64__ */ *StateDir VALUE(NULL), /* Root directory for state data */ *RequestRoot VALUE(NULL), diff --git a/scheduler/env.c b/scheduler/env.c index 01676c3..da37301 100644 --- a/scheduler/env.c +++ b/scheduler/env.c @@ -212,8 +212,13 @@ cupsdUpdateEnv(void) set_if_undefined("LD_PRELOAD", NULL); set_if_undefined("NLSPATH", NULL); if (find_env("PATH") < 0) +#ifdef __x86_64__ + cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR + ":/bin:/usr/bin", ServerBin, ServerBin_compat); +#else /* ! defined(__x86_64__) */ cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR ":/bin:/usr/bin", ServerBin); +#endif set_if_undefined("SERVER_ADMIN", ServerAdmin); set_if_undefined("SHLIB_PATH", NULL); set_if_undefined("SOFTWARE", CUPS_MINIMAL); diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 5cf980a..176cc83 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -2448,12 +2448,21 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ * Could not find device in list! */ +#ifdef __x86_64__ + snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat, + scheme); + if (access(srcfile, X_OK)) + { +#endif /* __x86_64__ */ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri scheme \"%s\"."), scheme); if (!modify) cupsdDeletePrinter(printer, 0); return; +#ifdef __x86_64__ + } +#endif /* __x86_64__ */ } } diff --git a/scheduler/job.c b/scheduler/job.c index 86e75e6..e5c6498 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1127,8 +1127,32 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ i ++, filter = (mime_filter_t *)cupsArrayNext(filters)) { if (filter->filter[0] != '/') - snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, - filter->filter); + { + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, + filter->filter); +#ifdef __x86_64__ + if (access(command, F_OK)) + { + snprintf(command, sizeof(command), "%s/filter/%s", + ServerBin_compat, filter->filter); + if (!access(command, F_OK)) + { + /* Not in the correct directory, but found it in the compat + * directory. Issue a warning. */ + cupsdLogMessage(CUPSD_LOG_INFO, + "Filter '%s' not in %s/filter!", + filter->filter, ServerBin); + } + else + { + /* Not in the compat directory either; make any error + * messages use the correct directory name then. */ + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, + filter->filter); + } + } +#endif /* __x86_64__ */ + } else strlcpy(command, filter->filter, sizeof(command)); @@ -1284,6 +1308,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ { cupsdClosePipe(job->back_pipes); cupsdClosePipe(job->side_pipes); +#ifdef __x86_64__ + if (access(command, F_OK)) + { + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat, + scheme); + if (!access(command, F_OK)) + { + /* Not in the correct directory, but we found it in the compat + * directory. Issue a warning. */ + cupsdLogMessage(CUPSD_LOG_INFO, + "Backend '%s' not in %s/backend!", scheme, + ServerBin); + } + else + { + /* Not in the compat directory either; make any error + messages use the correct directory name then. */ + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, + scheme); + } + } +#endif /* __x86_64__ */ close(job->status_pipes[1]); job->status_pipes[1] = -1; diff --git a/scheduler/printers.c b/scheduler/printers.c index bb99907..44ddc59 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -988,9 +988,19 @@ cupsdLoadAllPrinters(void) * Backend does not exist, stop printer... */ +#ifdef __x86_64__ + snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat, + p->device_uri); + if (access(line, 0)) + { +#endif /* __x86_64__ */ + p->state = IPP_PRINTER_STOPPED; snprintf(p->state_message, sizeof(p->state_message), "Backend %s does not exist!", line); +#ifdef __x86_64__ + } +#endif /* __x86_64__ */ } } @@ -3503,8 +3513,20 @@ add_printer_filter( else snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program); +#ifdef __x86_64__ + if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, + cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) { + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat, + program); + if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, + cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, + program); + } +#else /* ! defined(__x86_64__) */ _cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, cupsdLogFCMessage, p); +#endif } /*