2011-05-24 12:27:29 +00:00
|
|
|
diff -up cups-1.5b1/scheduler/conf.c.serverbin-compat cups-1.5b1/scheduler/conf.c
|
|
|
|
--- cups-1.5b1/scheduler/conf.c.serverbin-compat 2011-05-20 06:24:54.000000000 +0200
|
|
|
|
+++ cups-1.5b1/scheduler/conf.c 2011-05-23 17:20:33.000000000 +0200
|
|
|
|
@@ -491,6 +491,9 @@ cupsdReadConfiguration(void)
|
2009-03-05 13:31:30 +00:00
|
|
|
cupsdClearString(&ServerName);
|
|
|
|
cupsdClearString(&ServerAdmin);
|
2008-07-15 10:36:15 +00:00
|
|
|
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);
|
2011-05-24 12:27:29 +00:00
|
|
|
@@ -1378,7 +1381,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
|
|
|
|
2011-05-24 12:27:29 +00:00
|
|
|
MimeDatabase = mimeNew();
|
|
|
|
diff -up cups-1.5b1/scheduler/conf.h.serverbin-compat cups-1.5b1/scheduler/conf.h
|
|
|
|
--- cups-1.5b1/scheduler/conf.h.serverbin-compat 2011-04-22 19:47:03.000000000 +0200
|
|
|
|
+++ cups-1.5b1/scheduler/conf.h 2011-05-23 15:34:25.000000000 +0200
|
2010-09-15 12:23:05 +00:00
|
|
|
@@ -105,6 +105,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),
|
2011-05-24 12:27:29 +00:00
|
|
|
diff -up cups-1.5b1/scheduler/env.c.serverbin-compat cups-1.5b1/scheduler/env.c
|
|
|
|
--- cups-1.5b1/scheduler/env.c.serverbin-compat 2011-01-11 04:48:42.000000000 +0100
|
|
|
|
+++ cups-1.5b1/scheduler/env.c 2011-05-23 17:07:17.000000000 +0200
|
|
|
|
@@ -218,8 +218,13 @@ cupsdUpdateEnv(void)
|
|
|
|
set_if_undefined("LD_PRELOAD", NULL);
|
|
|
|
set_if_undefined("NLSPATH", NULL);
|
|
|
|
if (find_env("PATH") < 0)
|
2008-07-15 10:36:15 +00:00
|
|
|
+#ifdef __x86_64__
|
2011-05-24 12:27:29 +00:00
|
|
|
+ cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
|
|
|
|
+ ":/bin:/usr/bin", ServerBin, ServerBin_compat);
|
2008-07-15 10:36:15 +00:00
|
|
|
+#else /* ! defined(__x86_64__) */
|
2011-05-24 12:27:29 +00:00
|
|
|
cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
|
|
|
|
":/bin:/usr/bin", ServerBin);
|
2008-07-15 10:36:15 +00:00
|
|
|
+#endif
|
2011-05-24 12:27:29 +00:00
|
|
|
set_if_undefined("SERVER_ADMIN", ServerAdmin);
|
|
|
|
set_if_undefined("SHLIB_PATH", NULL);
|
|
|
|
set_if_undefined("SOFTWARE", CUPS_MINIMAL);
|
|
|
|
diff -up cups-1.5b1/scheduler/ipp.c.serverbin-compat cups-1.5b1/scheduler/ipp.c
|
|
|
|
--- cups-1.5b1/scheduler/ipp.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
|
|
|
+++ cups-1.5b1/scheduler/ipp.c 2011-05-23 16:09:57.000000000 +0200
|
|
|
|
@@ -2586,9 +2586,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__ */
|
2011-05-24 12:27:29 +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__ */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-24 12:27:29 +00:00
|
|
|
diff -up cups-1.5b1/scheduler/job.c.serverbin-compat cups-1.5b1/scheduler/job.c
|
|
|
|
--- cups-1.5b1/scheduler/job.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
|
|
|
+++ cups-1.5b1/scheduler/job.c 2011-05-23 16:18:57.000000000 +0200
|
|
|
|
@@ -1047,8 +1047,32 @@ cupsdContinueJob(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));
|
|
|
|
|
2011-05-24 12:27:29 +00:00
|
|
|
@@ -1199,6 +1223,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
|
|
|
{
|
2009-03-05 13:31:30 +00:00
|
|
|
cupsdClosePipe(job->back_pipes);
|
|
|
|
cupsdClosePipe(job->side_pipes);
|
2006-06-07 12:06:51 +00:00
|
|
|
+#ifdef __x86_64__
|
|
|
|
+ if (access(command, F_OK))
|
|
|
|
+ {
|
|
|
|
+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
|
2011-01-12 16:45:25 +00:00
|
|
|
+ scheme);
|
2006-06-07 12:06:51 +00:00
|
|
|
+ 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,
|
2011-01-12 16:45:25 +00:00
|
|
|
+ "Backend '%s' not in %s/backend!", scheme,
|
2006-06-07 12:06:51 +00:00
|
|
|
+ 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,
|
2011-01-12 16:45:25 +00:00
|
|
|
+ scheme);
|
2006-06-07 12:06:51 +00:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#endif /* __x86_64__ */
|
|
|
|
|
2009-03-05 13:31:30 +00:00
|
|
|
close(job->status_pipes[1]);
|
|
|
|
job->status_pipes[1] = -1;
|
2011-05-24 12:27:29 +00:00
|
|
|
diff -up cups-1.5b1/scheduler/printers.c.serverbin-compat cups-1.5b1/scheduler/printers.c
|
|
|
|
--- cups-1.5b1/scheduler/printers.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
|
|
|
|
+++ cups-1.5b1/scheduler/printers.c 2011-05-23 17:09:04.000000000 +0200
|
|
|
|
@@ -1030,9 +1030,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);
|
2009-06-17 11:30:03 +00:00
|
|
|
+ if (access(line, 0))
|
2008-07-15 10:36:15 +00:00
|
|
|
+ {
|
|
|
|
+#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
|
|
|
|
2011-05-24 12:27:29 +00:00
|
|
|
@@ -3621,8 +3631,20 @@ add_printer_filter(
|
|
|
|
else
|
|
|
|
snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program);
|
2008-07-15 10:36:15 +00:00
|
|
|
|
2006-06-07 12:06:51 +00:00
|
|
|
+#ifdef __x86_64__
|
2011-05-24 12:27:29 +00:00
|
|
|
+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
|
|
|
+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) {
|
2008-07-15 10:36:15 +00:00
|
|
|
+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
|
2011-05-24 12:27:29 +00:00
|
|
|
+ program);
|
|
|
|
+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
|
|
|
+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING)
|
2010-09-15 12:23:05 +00:00
|
|
|
+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin,
|
|
|
|
+ program);
|
2011-05-24 12:27:29 +00:00
|
|
|
+ }
|
|
|
|
+#else /* ! defined(__x86_64__) */
|
|
|
|
_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
|
|
|
|
cupsdLogFCMessage, p);
|
|
|
|
+#endif
|
|
|
|
}
|
2006-06-07 12:06:51 +00:00
|
|
|
|
2011-05-24 12:27:29 +00:00
|
|
|
/*
|