View | Details | Raw Unified | Return to bug 205604
Collapse All | Expand All

(-)b/usr.sbin/lpr/common_source/lp.h (+1 lines)
Lines 57-62 struct printer { Link Here
57
	long	 conn_timeout;	/* CT: TCP connection timeout */
57
	long	 conn_timeout;	/* CT: TCP connection timeout */
58
	long	 daemon_user;	/* DU: daemon user id -- XXX belongs ???? */
58
	long	 daemon_user;	/* DU: daemon user id -- XXX belongs ???? */
59
	char	*form_feed;	/* FF: form feed */
59
	char	*form_feed;	/* FF: form feed */
60
	char	*filter_path;	/* FP: PATH environment variable for filters */
60
	long	 header_last;	/* HL: print header last */
61
	long	 header_last;	/* HL: print header last */
61
	char	*log_file;	/* LF: log file */
62
	char	*log_file;	/* LF: log file */
62
	char	*lock_file;	/* LO: lock file */
63
	char	*lock_file;	/* LO: lock file */
(-)b/usr.sbin/lpr/common_source/lp.local.h (+2 lines)
Lines 48-53 Link Here
48
#define DEFUID		1
48
#define DEFUID		1
49
#define DEFTIMEOUT	120
49
#define DEFTIMEOUT	120
50
50
51
#define ENV_PATH	"PATH"
52
51
/*
53
/*
52
 * When files are created in the spooling area, they are normally
54
 * When files are created in the spooling area, they are normally
53
 *   readable only by their owner and the spooling group.  If you
55
 *   readable only by their owner and the spooling group.  If you
(-)b/usr.sbin/lpr/common_source/printcap.c (-1 / +14 lines)
Lines 217-223 static int Link Here
217
getprintcap_int(char *bp, struct printer *pp)
217
getprintcap_int(char *bp, struct printer *pp)
218
{
218
{
219
	enum lpd_filters filt;
219
	enum lpd_filters filt;
220
	char *rp_name;
220
	char *p_path, *rp_name;
221
	int error;
221
	int error;
222
222
223
	if ((pp->printer = capdb_canonical_name(bp)) == 0)
223
	if ((pp->printer = capdb_canonical_name(bp)) == 0)
Lines 231-236 getprintcap_int(char *bp, struct printer *pp) Link Here
231
	CHK(capdb_getaltnum(bp, "du", "daemon.user", DEFUID, 
231
	CHK(capdb_getaltnum(bp, "du", "daemon.user", DEFUID, 
232
			    &pp->daemon_user));
232
			    &pp->daemon_user));
233
	CHK(capdb_getaltstr(bp, "ff", "job.formfeed", DEFFF, &pp->form_feed));
233
	CHK(capdb_getaltstr(bp, "ff", "job.formfeed", DEFFF, &pp->form_feed));
234
	CHK(capdb_getaltstr(bp, "fp", "filt.path", 0, &pp->filter_path));
234
	CHK(capdb_getaltstr(bp, "lf", "spool.log", _PATH_CONSOLE, 
235
	CHK(capdb_getaltstr(bp, "lf", "spool.log", _PATH_CONSOLE, 
235
			    &pp->log_file));
236
			    &pp->log_file));
236
	CHK(capdb_getaltstr(bp, "lo", "spool.lock", DEFLOCK, &pp->lock_file));
237
	CHK(capdb_getaltstr(bp, "lo", "spool.lock", DEFLOCK, &pp->lock_file));
Lines 270-275 getprintcap_int(char *bp, struct printer *pp) Link Here
270
	pp->tof = !capdb_getaltlog(bp, "fo", "job.topofform");
271
	pp->tof = !capdb_getaltlog(bp, "fo", "job.topofform");
271
	
272
	
272
	/*
273
	/*
274
	 * Substitute spaces and commas in the PATH environment variable
275
	 * by colons.
276
	 */
277
	if (pp->filter_path) {
278
		for (p_path = pp->filter_path; *p_path; p_path++) {
279
			if (*p_path == ' ' || *p_path == ',')
280
				*p_path = ':';
281
		}
282
	}
283
284
	/*
273
	 * Decide if the remote printer name matches the local printer name.
285
	 * Decide if the remote printer name matches the local printer name.
274
	 * If no name is given then we assume they mean them to match.
286
	 * If no name is given then we assume they mean them to match.
275
	 * If a name is given see if the rp_name is one of the names for
287
	 * If a name is given see if the rp_name is one of the names for
Lines 344-349 free_printer(struct printer *pp) Link Here
344
	for (filt = 0; filt < LPF_COUNT; filt++)
356
	for (filt = 0; filt < LPF_COUNT; filt++)
345
		cfree(pp->filters[filt]);
357
		cfree(pp->filters[filt]);
346
	cfree(pp->form_feed);
358
	cfree(pp->form_feed);
359
	cfree(pp->filter_path);
347
	cfree(pp->log_file);
360
	cfree(pp->log_file);
348
	cfree(pp->lock_file);
361
	cfree(pp->lock_file);
349
	cfree(pp->lp);
362
	cfree(pp->lp);
(-)b/usr.sbin/lpr/lpd/printjob.c (+6 lines)
Lines 1680-1685 dofork(const struct printer *pp, int action) Link Here
1680
				    pp->printer, pp->daemon_user);
1680
				    pp->printer, pp->daemon_user);
1681
				break;
1681
				break;
1682
			}
1682
			}
1683
			fail = setenv(ENV_PATH, pp->filter_path, 1);
1684
			if (fail) {
1685
				syslog(LOG_ERR, "%s: setenv(%s, %s, 1): %m",
1686
					pp->printer, ENV_PATH, pp->filter_path);
1687
				break;
1688
			}
1683
		}
1689
		}
1684
		return (forkpid);
1690
		return (forkpid);
1685
	}
1691
	}
(-)b/usr.sbin/lpr/lpr/printcap.5 (+2 lines)
Lines 83-88 call) Link Here
83
.Tn ( DVI
83
.Tn ( DVI
84
format)
84
format)
85
.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
85
.It "ff	str" Ta So Li \ef Sc Ta No "string to send for a form feed"
86
.It "fp	str" Ta So Li NULL Sc Ta No "PATH environment variable for filter command"
86
.It "fo	bool	false	print a form feed when device is opened"
87
.It "fo	bool	false	print a form feed when device is opened"
87
.It "gf	str" Ta Dv NULL Ta No "graph data filter"
88
.It "gf	str" Ta Dv NULL Ta No "graph data filter"
88
.Xr ( plot 3
89
.Xr ( plot 3
Lines 142-147 Each two-letter capability has a human-readable alternate name. Link Here
142
.It "df	filt.dvi"
143
.It "df	filt.dvi"
143
.It "du	daemon.user"
144
.It "du	daemon.user"
144
.It "ff	job.formfeed"
145
.It "ff	job.formfeed"
146
.It "fp	filt.path"
145
.It "fo	job.topofform"
147
.It "fo	job.topofform"
146
.It "gf	filt.plot"
148
.It "gf	filt.plot"
147
.It "hl	banner.last"
149
.It "hl	banner.last"

Return to bug 205604