Rediff serverbin-compat patch.
This commit is contained in:
parent
1011a6e935
commit
69289fd792
@ -1,6 +1,64 @@
|
||||
--- cups-1.2.1/scheduler/ipp.c.serverbin-compat 2006-06-07 11:47:18.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/ipp.c 2006-06-07 11:50:06.000000000 +0100
|
||||
@@ -2209,9 +2209,18 @@
|
||||
diff -up cups-1.3.7/scheduler/conf.c.serverbin-compat cups-1.3.7/scheduler/conf.c
|
||||
--- cups-1.3.7/scheduler/conf.c.serverbin-compat 2008-03-20 04:06:01.000000000 +0000
|
||||
+++ cups-1.3.7/scheduler/conf.c 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -402,6 +402,9 @@ cupsdReadConfiguration(void)
|
||||
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);
|
||||
@@ -1095,7 +1098,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 /* ! defined(__x86_64__) */
|
||||
snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
|
||||
+#endif
|
||||
|
||||
MimeDatabase = mimeLoad(ServerRoot, temp);
|
||||
|
||||
diff -up cups-1.3.7/scheduler/conf.h.serverbin-compat cups-1.3.7/scheduler/conf.h
|
||||
--- cups-1.3.7/scheduler/conf.h.serverbin-compat 2008-02-15 23:26:51.000000000 +0000
|
||||
+++ cups-1.3.7/scheduler/conf.h 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -59,6 +59,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 -up cups-1.3.7/scheduler/env.c.serverbin-compat cups-1.3.7/scheduler/env.c
|
||||
--- cups-1.3.7/scheduler/env.c.serverbin-compat 2007-07-11 22:46:42.000000000 +0100
|
||||
+++ cups-1.3.7/scheduler/env.c 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -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);
|
||||
diff -up cups-1.3.7/scheduler/ipp.c.serverbin-compat cups-1.3.7/scheduler/ipp.c
|
||||
--- cups-1.3.7/scheduler/ipp.c.serverbin-compat 2008-03-24 22:34:44.000000000 +0000
|
||||
+++ cups-1.3.7/scheduler/ipp.c 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -2377,9 +2377,18 @@ add_printer(cupsd_client_t *con, /* I -
|
||||
* Could not find device in list!
|
||||
*/
|
||||
|
||||
@ -19,67 +77,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
--- cups-1.2.1/scheduler/printers.c.serverbin-compat 2006-06-07 12:21:59.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/printers.c 2006-06-07 12:26:44.000000000 +0100
|
||||
@@ -902,9 +902,19 @@
|
||||
* Backend does not exist, stop printer...
|
||||
*/
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ 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);
|
||||
+#ifdef __x86_64__
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2838,6 +2848,12 @@
|
||||
|
||||
if (access(filename, X_OK))
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ 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));
|
||||
@@ -2846,6 +2862,9 @@
|
||||
cupsdAddPrinterHistory(p);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
|
||||
+#ifdef __x86_64__
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
--- cups-1.2.1/scheduler/conf.h.serverbin-compat 2006-06-07 11:38:05.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/conf.h 2006-06-07 11:39:41.000000000 +0100
|
||||
@@ -68,6 +68,10 @@
|
||||
/* 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),
|
||||
--- cups-1.2.1/scheduler/job.c.serverbin-compat 2006-06-07 11:50:31.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/job.c 2006-06-07 12:21:48.000000000 +0100
|
||||
@@ -3117,8 +3117,32 @@
|
||||
diff -up cups-1.3.7/scheduler/job.c.serverbin-compat cups-1.3.7/scheduler/job.c
|
||||
--- cups-1.3.7/scheduler/job.c.serverbin-compat 2008-03-25 22:57:40.000000000 +0000
|
||||
+++ cups-1.3.7/scheduler/job.c 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -3223,8 +3223,32 @@ start_job(cupsd_job_t *job, /* I -
|
||||
i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
|
||||
{
|
||||
if (filter->filter[0] != '/')
|
||||
@ -114,7 +115,7 @@
|
||||
else
|
||||
strlcpy(command, filter->filter, sizeof(command));
|
||||
|
||||
@@ -3259,6 +3283,28 @@
|
||||
@@ -3374,6 +3398,28 @@ start_job(cupsd_job_t *job, /* I -
|
||||
{
|
||||
sscanf(printer->device_uri, "%254[^:]", method);
|
||||
snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, method);
|
||||
@ -143,44 +144,49 @@
|
||||
|
||||
/*
|
||||
* See if the backend needs to run as root...
|
||||
--- cups-1.2.1/scheduler/env.c.serverbin-compat 2006-06-07 11:45:26.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/env.c 2006-06-07 11:46:55.000000000 +0100
|
||||
@@ -95,8 +95,13 @@
|
||||
cupsdSetEnv("LD_LIBRARY_PATH", NULL);
|
||||
cupsdSetEnv("LD_PRELOAD", NULL);
|
||||
cupsdSetEnv("NLSPATH", NULL);
|
||||
diff -up cups-1.3.7/scheduler/printers.c.serverbin-compat cups-1.3.7/scheduler/printers.c
|
||||
--- cups-1.3.7/scheduler/printers.c.serverbin-compat 2008-01-30 06:09:39.000000000 +0000
|
||||
+++ cups-1.3.7/scheduler/printers.c 2008-07-15 11:04:19.000000000 +0100
|
||||
@@ -934,9 +934,19 @@ cupsdLoadAllPrinters(void)
|
||||
* Backend does not exist, stop printer...
|
||||
*/
|
||||
|
||||
+#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);
|
||||
--- cups-1.2.1/scheduler/conf.c.serverbin-compat 2006-06-07 11:38:24.000000000 +0100
|
||||
+++ cups-1.2.1/scheduler/conf.c 2006-06-07 11:42:49.000000000 +0100
|
||||
@@ -275,6 +275,9 @@
|
||||
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");
|
||||
+ snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
|
||||
+ p->device_uri);
|
||||
+ if (access(line, F_OK))
|
||||
+ {
|
||||
+#endif /* __x86_64__ */
|
||||
cupsdSetString(&RequestRoot, CUPS_REQUESTS);
|
||||
cupsdSetString(&CacheDir, CUPS_CACHEDIR);
|
||||
cupsdSetString(&DataDir, CUPS_DATADIR);
|
||||
@@ -954,7 +957,12 @@
|
||||
* Read the MIME type and conversion database...
|
||||
*/
|
||||
|
||||
+
|
||||
p->state = IPP_PRINTER_STOPPED;
|
||||
snprintf(p->state_message, sizeof(p->state_message),
|
||||
"Backend %s does not exist!", line);
|
||||
+#ifdef __x86_64__
|
||||
+ snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
|
||||
+ ServerBin_compat);
|
||||
+#else /* ! defined(__x86_64__) */
|
||||
snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
|
||||
+#endif
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
MimeDatabase = mimeLoad(ServerRoot, temp);
|
||||
@@ -3395,6 +3405,12 @@ add_printer_filter(
|
||||
|
||||
if (access(filename, X_OK))
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ 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));
|
||||
@@ -3402,6 +3418,9 @@ add_printer_filter(
|
||||
cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
|
||||
+#ifdef __x86_64__
|
||||
+ }
|
||||
+#endif /* __x86_64__ */
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user