2008-11-12 16:09:54 +00:00
|
|
|
diff -up cups-1.4b1/scheduler/conf.c.serverbin-compat cups-1.4b1/scheduler/conf.c
|
|
|
|
--- cups-1.4b1/scheduler/conf.c.serverbin-compat 2008-10-08 17:34:03.000000000 +0100
|
|
|
|
+++ cups-1.4b1/scheduler/conf.c 2008-11-11 15:39:11.000000000 +0000
|
|
|
|
@@ -432,6 +432,9 @@ cupsdReadConfiguration(void)
|
2008-07-15 10:36:15 +00:00
|
|
|
cupsdSetString(&ServerName, httpGetHostname(NULL, temp, sizeof(temp)));
|
|
|
|
cupsdSetStringf(&ServerAdmin, "root@%s", temp);
|
|
|
|
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);
|
2008-11-12 16:09:54 +00:00
|
|
|
@@ -1187,7 +1190,12 @@ cupsdReadConfiguration(void)
|
2008-07-15 10:36:15 +00:00
|
|
|
* Read the MIME type and conversion database...
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#ifdef __x86_64__
|
|
|
|
+ snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
|
|
|
|
+ ServerBin_compat);
|
2008-11-12 16:09:54 +00:00
|
|
|
+#else
|
2008-07-15 10:36:15 +00:00
|
|
|
snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
|
|
|
|
+#endif
|
2008-11-12 16:09:54 +00:00
|
|
|
snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir);
|
2008-07-15 10:36:15 +00:00
|
|
|
|
2008-11-12 16:09:54 +00:00
|
|
|
MimeDatabase = mimeLoadTypes(NULL, mimedir);
|
|
|
|
diff -up cups-1.4b1/scheduler/conf.h.serverbin-compat cups-1.4b1/scheduler/conf.h
|
|
|
|
--- cups-1.4b1/scheduler/conf.h.serverbin-compat 2008-09-19 21:03:36.000000000 +0100
|
|
|
|
+++ cups-1.4b1/scheduler/conf.h 2008-11-11 15:35:13.000000000 +0000
|
|
|
|
@@ -89,6 +89,10 @@ VAR char *ConfigurationFile VALUE(NULL)
|
2008-07-15 10:36:15 +00:00
|
|
|
/* 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),
|
2008-11-12 16:09:54 +00:00
|
|
|
diff -up cups-1.4b1/scheduler/env.c.serverbin-compat cups-1.4b1/scheduler/env.c
|
|
|
|
--- cups-1.4b1/scheduler/env.c.serverbin-compat 2008-06-18 23:31:26.000000000 +0100
|
|
|
|
+++ cups-1.4b1/scheduler/env.c 2008-11-11 15:35:13.000000000 +0000
|
2008-07-15 10:36:15 +00:00
|
|
|
@@ -86,8 +86,13 @@ cupsdInitEnv(void)
|
|
|
|
cupsdSetEnv("LD_LIBRARY_PATH", NULL);
|
|
|
|
cupsdSetEnv("LD_PRELOAD", NULL);
|
|
|
|
cupsdSetEnv("NLSPATH", NULL);
|
|
|
|
+#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
|
|
|
|
cupsdSetEnv("SERVER_ADMIN", ServerAdmin);
|
|
|
|
cupsdSetEnv("SHLIB_PATH", NULL);
|
|
|
|
cupsdSetEnv("SOFTWARE", CUPS_MINIMAL);
|
2008-11-12 16:09:54 +00:00
|
|
|
diff -up cups-1.4b1/scheduler/ipp.c.serverbin-compat cups-1.4b1/scheduler/ipp.c
|
|
|
|
--- cups-1.4b1/scheduler/ipp.c.serverbin-compat 2008-10-27 21:54:12.000000000 +0000
|
|
|
|
+++ cups-1.4b1/scheduler/ipp.c 2008-11-11 15:41:25.000000000 +0000
|
|
|
|
@@ -2515,9 +2515,18 @@ add_printer(cupsd_client_t *con, /* I -
|
2006-06-07 12:06:51 +00:00
|
|
|
* Could not find device in list!
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#ifdef __x86_64__
|
2008-11-12 16:09:54 +00:00
|
|
|
+ snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat,
|
2007-07-18 11:55:01 +00:00
|
|
|
+ scheme);
|
2006-06-07 12:06:51 +00:00
|
|
|
+ if (access(srcfile, X_OK))
|
2008-11-12 16:09:54 +00:00
|
|
|
+ {
|
2006-06-07 12:06:51 +00:00
|
|
|
+#endif /* __x86_64__ */
|
2008-11-12 16:09:54 +00:00
|
|
|
send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri scheme \"%s\"!"),
|
|
|
|
scheme);
|
2006-06-07 12:06:51 +00:00
|
|
|
return;
|
|
|
|
+#ifdef __x86_64__
|
2008-11-12 16:09:54 +00:00
|
|
|
+ }
|
2006-06-07 12:06:51 +00:00
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-12 16:09:54 +00:00
|
|
|
diff -up cups-1.4b1/scheduler/job.c.serverbin-compat cups-1.4b1/scheduler/job.c
|
|
|
|
--- cups-1.4b1/scheduler/job.c.serverbin-compat 2008-10-21 01:02:45.000000000 +0100
|
|
|
|
+++ cups-1.4b1/scheduler/job.c 2008-11-11 15:35:13.000000000 +0000
|
|
|
|
@@ -3267,8 +3267,32 @@ start_job(cupsd_job_t *job, /* I -
|
2006-06-07 12:06:51 +00:00
|
|
|
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__ */
|
2006-06-07 13:12:22 +00:00
|
|
|
+ }
|
2006-06-07 12:06:51 +00:00
|
|
|
else
|
|
|
|
strlcpy(command, filter->filter, sizeof(command));
|
|
|
|
|
2008-11-12 16:09:54 +00:00
|
|
|
@@ -3414,6 +3438,28 @@ start_job(cupsd_job_t *job, /* I -
|
2006-06-07 12:06:51 +00:00
|
|
|
{
|
|
|
|
sscanf(printer->device_uri, "%254[^:]", method);
|
|
|
|
snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, method);
|
|
|
|
+#ifdef __x86_64__
|
|
|
|
+ if (access(command, F_OK))
|
|
|
|
+ {
|
|
|
|
+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
|
|
|
|
+ method);
|
|
|
|
+ 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!", method,
|
|
|
|
+ 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,
|
|
|
|
+ method);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* See if the backend needs to run as root...
|
2008-11-12 16:09:54 +00:00
|
|
|
diff -up cups-1.4b1/scheduler/printers.c.serverbin-compat cups-1.4b1/scheduler/printers.c
|
|
|
|
--- cups-1.4b1/scheduler/printers.c.serverbin-compat 2008-10-10 06:28:15.000000000 +0100
|
|
|
|
+++ cups-1.4b1/scheduler/printers.c 2008-11-11 15:35:13.000000000 +0000
|
|
|
|
@@ -985,9 +985,19 @@ cupsdLoadAllPrinters(void)
|
2008-07-15 10:36:15 +00:00
|
|
|
* Backend does not exist, stop printer...
|
|
|
|
*/
|
|
|
|
|
2006-06-07 12:06:51 +00:00
|
|
|
+#ifdef __x86_64__
|
2008-07-15 10:36:15 +00:00
|
|
|
+ snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
|
|
|
|
+ p->device_uri);
|
|
|
|
+ if (access(line, F_OK))
|
|
|
|
+ {
|
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
+
|
|
|
|
p->state = IPP_PRINTER_STOPPED;
|
|
|
|
snprintf(p->state_message, sizeof(p->state_message),
|
|
|
|
"Backend %s does not exist!", line);
|
2006-06-07 12:06:51 +00:00
|
|
|
+#ifdef __x86_64__
|
2008-07-15 10:36:15 +00:00
|
|
|
+ }
|
2006-06-07 12:06:51 +00:00
|
|
|
+#endif /* __x86_64__ */
|
2008-07-15 10:36:15 +00:00
|
|
|
}
|
|
|
|
}
|
2006-06-07 12:06:51 +00:00
|
|
|
|
2008-11-12 16:09:54 +00:00
|
|
|
@@ -3448,6 +3458,12 @@ add_printer_filter(
|
2008-07-15 10:36:15 +00:00
|
|
|
|
|
|
|
if (access(filename, X_OK))
|
|
|
|
{
|
2006-06-07 12:06:51 +00:00
|
|
|
+#ifdef __x86_64__
|
2008-07-15 10:36:15 +00:00
|
|
|
+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
|
|
|
|
+ program);
|
|
|
|
+ if (access(filename, X_OK))
|
|
|
|
+ {
|
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
snprintf(p->state_message, sizeof(p->state_message),
|
|
|
|
"Filter \"%s\" for printer \"%s\" not available: %s",
|
|
|
|
program, p->name, strerror(errno));
|
2008-11-12 16:09:54 +00:00
|
|
|
@@ -3455,6 +3471,9 @@ add_printer_filter(
|
2008-07-15 10:36:15 +00:00
|
|
|
cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
|
2006-06-07 12:06:51 +00:00
|
|
|
|
2008-07-15 10:36:15 +00:00
|
|
|
cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
|
|
|
|
+#ifdef __x86_64__
|
|
|
|
+ }
|
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
}
|
|
|
|
}
|
2006-06-07 12:06:51 +00:00
|
|
|
|