Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 205214 | Differences between
and this patch

Collapse All | Expand All

(-)dhcp-4.0.0.ORIG/client/clparse.c (-7 / +35 lines)
Lines 149-154 Link Here
149
	status = read_client_conf_file (path_dhclient_conf,
149
	status = read_client_conf_file (path_dhclient_conf,
150
					(struct interface_info *)0,
150
					(struct interface_info *)0,
151
					&top_level_config);
151
					&top_level_config);
152
153
	/* Read any extra configuration from stdin */
154
	read_client_conf_stdin ((struct interface_info *)0,
155
					&top_level_config);
156
	
152
	if (status != ISC_R_SUCCESS) {
157
	if (status != ISC_R_SUCCESS) {
153
		;
158
		;
154
#ifdef LATER
159
#ifdef LATER
Lines 201-220 Link Here
201
	return status;
206
	return status;
202
}
207
}
203
208
204
int read_client_conf_file (const char *name, struct interface_info *ip,
209
int read_client_conf_actual (int file, const char *name, 
205
			   struct client_config *client)
210
			     struct interface_info *ip,
211
			     struct client_config *client)
206
{
212
{
207
	int file;
208
	struct parse *cfile;
213
	struct parse *cfile;
209
	const char *val;
214
	const char *val;
210
	int token;
215
	int token;
211
	isc_result_t status;
216
	isc_result_t status;
212
	
217
	
213
	if ((file = open (name, O_RDONLY)) < 0)
214
		return uerr2isc (errno);
215
216
	cfile = (struct parse *)0;
218
	cfile = (struct parse *)0;
217
	new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
219
	new_parse (&cfile, file, (char *)0, 0, name , 0);
218
220
219
	do {
221
	do {
220
		token = peek_token (&val, (unsigned *)0, cfile);
222
		token = peek_token (&val, (unsigned *)0, cfile);
Lines 230-235 Link Here
230
	return status;
232
	return status;
231
}
233
}
232
234
235
int read_client_conf_file (const char *name, struct interface_info *ip,
236
			   struct client_config *client)
237
{
238
	int file;
239
	isc_result_t status;
240
	
241
	if ((file = open (name, O_RDONLY)) < 0)
242
		return uerr2isc (errno);
243
244
	status = read_client_conf_actual(file, name, ip, client);
245
246
	return status;
247
}
248
249
250
int read_client_conf_stdin (struct interface_info *ip,
251
			    struct client_config *client)
252
{
253
	int file = fileno(stdin);
254
	isc_result_t status;
255
256
	if (isatty(file)) return ISC_R_NOTFOUND;
257
	status = read_client_conf_actual(file, "stdin", ip, client);
258
259
	return status;
260
}
233
261
234
/* lease-file :== client-lease-statements END_OF_FILE
262
/* lease-file :== client-lease-statements END_OF_FILE
235
   client-lease-statements :== <nil>
263
   client-lease-statements :== <nil>
(-)dhcp-4.0.0.ORIG/common/conflex.c (-1 / +1 lines)
Lines 103-109 Link Here
103
	struct parse **cfile;
103
	struct parse **cfile;
104
{
104
{
105
	/* "Memory" config files have no file. */
105
	/* "Memory" config files have no file. */
106
	if ((*cfile)->file != -1) {
106
	if ((*cfile)->file != -1 && (*cfile)->file != fileno(stdin)) {
107
		munmap((*cfile)->inbuf, (*cfile)->bufsiz);
107
		munmap((*cfile)->inbuf, (*cfile)->bufsiz);
108
		close((*cfile)->file);
108
		close((*cfile)->file);
109
	}
109
	}

Return to bug 205214