]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - cups/patches/005_cups-serverbin-compat.patch
docbook2X: New package.
[people/ms/ipfire-3.x.git] / cups / patches / 005_cups-serverbin-compat.patch
1 diff -up cups-1.5b1/scheduler/conf.c.serverbin-compat cups-1.5b1/scheduler/conf.c
2 --- cups-1.5b1/scheduler/conf.c.serverbin-compat 2011-05-20 06:24:54.000000000 +0200
3 +++ cups-1.5b1/scheduler/conf.c 2011-05-23 17:20:33.000000000 +0200
4 @@ -491,6 +491,9 @@ cupsdReadConfiguration(void)
5 cupsdClearString(&ServerName);
6 cupsdClearString(&ServerAdmin);
7 cupsdSetString(&ServerBin, CUPS_SERVERBIN);
8 +#ifdef __x86_64__
9 + cupsdSetString(&ServerBin_compat, "/usr/lib64/cups");
10 +#endif /* __x86_64__ */
11 cupsdSetString(&RequestRoot, CUPS_REQUESTS);
12 cupsdSetString(&CacheDir, CUPS_CACHEDIR);
13 cupsdSetString(&DataDir, CUPS_DATADIR);
14 @@ -1378,7 +1381,12 @@ cupsdReadConfiguration(void)
15 * Read the MIME type and conversion database...
16 */
17
18 +#ifdef __x86_64__
19 + snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin,
20 + ServerBin_compat);
21 +#else
22 snprintf(temp, sizeof(temp), "%s/filter", ServerBin);
23 +#endif
24 snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir);
25
26 MimeDatabase = mimeNew();
27 diff -up cups-1.5b1/scheduler/conf.h.serverbin-compat cups-1.5b1/scheduler/conf.h
28 --- cups-1.5b1/scheduler/conf.h.serverbin-compat 2011-04-22 19:47:03.000000000 +0200
29 +++ cups-1.5b1/scheduler/conf.h 2011-05-23 15:34:25.000000000 +0200
30 @@ -105,6 +105,10 @@ VAR char *ConfigurationFile VALUE(NULL)
31 /* Root directory for scheduler */
32 *ServerBin VALUE(NULL),
33 /* Root directory for binaries */
34 +#ifdef __x86_64__
35 + *ServerBin_compat VALUE(NULL),
36 + /* Compat directory for binaries */
37 +#endif /* __x86_64__ */
38 *StateDir VALUE(NULL),
39 /* Root directory for state data */
40 *RequestRoot VALUE(NULL),
41 diff -up cups-1.5b1/scheduler/env.c.serverbin-compat cups-1.5b1/scheduler/env.c
42 --- cups-1.5b1/scheduler/env.c.serverbin-compat 2011-01-11 04:48:42.000000000 +0100
43 +++ cups-1.5b1/scheduler/env.c 2011-05-23 17:07:17.000000000 +0200
44 @@ -218,8 +218,13 @@ cupsdUpdateEnv(void)
45 set_if_undefined("LD_PRELOAD", NULL);
46 set_if_undefined("NLSPATH", NULL);
47 if (find_env("PATH") < 0)
48 +#ifdef __x86_64__
49 + cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
50 + ":/bin:/usr/bin", ServerBin, ServerBin_compat);
51 +#else /* ! defined(__x86_64__) */
52 cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR
53 ":/bin:/usr/bin", ServerBin);
54 +#endif
55 set_if_undefined("SERVER_ADMIN", ServerAdmin);
56 set_if_undefined("SHLIB_PATH", NULL);
57 set_if_undefined("SOFTWARE", CUPS_MINIMAL);
58 diff -up cups-1.5b1/scheduler/ipp.c.serverbin-compat cups-1.5b1/scheduler/ipp.c
59 --- cups-1.5b1/scheduler/ipp.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
60 +++ cups-1.5b1/scheduler/ipp.c 2011-05-23 16:09:57.000000000 +0200
61 @@ -2586,9 +2586,18 @@ add_printer(cupsd_client_t *con, /* I -
62 * Could not find device in list!
63 */
64
65 +#ifdef __x86_64__
66 + snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat,
67 + scheme);
68 + if (access(srcfile, X_OK))
69 + {
70 +#endif /* __x86_64__ */
71 send_ipp_status(con, IPP_NOT_POSSIBLE,
72 _("Bad device-uri scheme \"%s\"."), scheme);
73 return;
74 +#ifdef __x86_64__
75 + }
76 +#endif /* __x86_64__ */
77 }
78 }
79
80 diff -up cups-1.5b1/scheduler/job.c.serverbin-compat cups-1.5b1/scheduler/job.c
81 --- cups-1.5b1/scheduler/job.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
82 +++ cups-1.5b1/scheduler/job.c 2011-05-23 16:18:57.000000000 +0200
83 @@ -1047,8 +1047,32 @@ cupsdContinueJob(cupsd_job_t *job) /* I
84 i ++, filter = (mime_filter_t *)cupsArrayNext(filters))
85 {
86 if (filter->filter[0] != '/')
87 - snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
88 - filter->filter);
89 + {
90 + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
91 + filter->filter);
92 +#ifdef __x86_64__
93 + if (access(command, F_OK))
94 + {
95 + snprintf(command, sizeof(command), "%s/filter/%s",
96 + ServerBin_compat, filter->filter);
97 + if (!access(command, F_OK))
98 + {
99 + /* Not in the correct directory, but found it in the compat
100 + * directory. Issue a warning. */
101 + cupsdLogMessage(CUPSD_LOG_INFO,
102 + "Filter '%s' not in %s/filter!",
103 + filter->filter, ServerBin);
104 + }
105 + else
106 + {
107 + /* Not in the compat directory either; make any error
108 + * messages use the correct directory name then. */
109 + snprintf(command, sizeof(command), "%s/filter/%s", ServerBin,
110 + filter->filter);
111 + }
112 + }
113 +#endif /* __x86_64__ */
114 + }
115 else
116 strlcpy(command, filter->filter, sizeof(command));
117
118 @@ -1199,6 +1223,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
119 {
120 cupsdClosePipe(job->back_pipes);
121 cupsdClosePipe(job->side_pipes);
122 +#ifdef __x86_64__
123 + if (access(command, F_OK))
124 + {
125 + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat,
126 + scheme);
127 + if (!access(command, F_OK))
128 + {
129 + /* Not in the correct directory, but we found it in the compat
130 + * directory. Issue a warning. */
131 + cupsdLogMessage(CUPSD_LOG_INFO,
132 + "Backend '%s' not in %s/backend!", scheme,
133 + ServerBin);
134 + }
135 + else
136 + {
137 + /* Not in the compat directory either; make any error
138 + messages use the correct directory name then. */
139 + snprintf(command, sizeof(command), "%s/backend/%s", ServerBin,
140 + scheme);
141 + }
142 + }
143 +#endif /* __x86_64__ */
144
145 close(job->status_pipes[1]);
146 job->status_pipes[1] = -1;
147 diff -up cups-1.5b1/scheduler/printers.c.serverbin-compat cups-1.5b1/scheduler/printers.c
148 --- cups-1.5b1/scheduler/printers.c.serverbin-compat 2011-05-20 05:49:49.000000000 +0200
149 +++ cups-1.5b1/scheduler/printers.c 2011-05-23 17:09:04.000000000 +0200
150 @@ -1030,9 +1030,19 @@ cupsdLoadAllPrinters(void)
151 * Backend does not exist, stop printer...
152 */
153
154 +#ifdef __x86_64__
155 + snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat,
156 + p->device_uri);
157 + if (access(line, 0))
158 + {
159 +#endif /* __x86_64__ */
160 +
161 p->state = IPP_PRINTER_STOPPED;
162 snprintf(p->state_message, sizeof(p->state_message),
163 "Backend %s does not exist!", line);
164 +#ifdef __x86_64__
165 + }
166 +#endif /* __x86_64__ */
167 }
168 }
169
170 @@ -3621,8 +3631,20 @@ add_printer_filter(
171 else
172 snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program);
173
174 +#ifdef __x86_64__
175 + if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
176 + cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) {
177 + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat,
178 + program);
179 + if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
180 + cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING)
181 + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin,
182 + program);
183 + }
184 +#else /* ! defined(__x86_64__) */
185 _cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser,
186 cupsdLogFCMessage, p);
187 +#endif
188 }
189
190 /*