blob: b7bad3309a0d716f6e386afabfc17a801af77796 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Mike Frysinger7031f622006-05-08 03:20:50 +00002/*
3 * files.c -- DHCP server file manipulation *
4 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001
5 */
6
Mike Frysinger7031f622006-05-08 03:20:50 +00007#include <netinet/ether.h>
Mike Frysinger7031f622006-05-08 03:20:50 +00008
Denis Vlasenko5a3395b2006-11-18 19:51:32 +00009#include "common.h"
Mike Frysinger7031f622006-05-08 03:20:50 +000010#include "dhcpd.h"
11#include "options.h"
Denis Vlasenko5a3395b2006-11-18 19:51:32 +000012
Mike Frysinger7031f622006-05-08 03:20:50 +000013
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000014/* on these functions, make sure your datatype matches */
Mike Frysinger7031f622006-05-08 03:20:50 +000015static int read_ip(const char *line, void *arg)
16{
Denis Vlasenkoe9913032007-02-04 02:41:57 +000017 len_and_sockaddr *lsa;
Mike Frysinger7031f622006-05-08 03:20:50 +000018
Denis Vlasenkoe9913032007-02-04 02:41:57 +000019 lsa = host_and_af2sockaddr(line, 0, AF_INET);
Denis Vlasenko42b3dea2007-07-03 15:47:50 +000020 if (!lsa)
21 return 0;
Bernhard Reutner-Fischer8c69afd2008-01-29 10:33:34 +000022 *(uint32_t*)arg = lsa->u.sin.sin_addr.s_addr;
Denis Vlasenko42b3dea2007-07-03 15:47:50 +000023 free(lsa);
24 return 1;
Mike Frysinger7031f622006-05-08 03:20:50 +000025}
26
27static int read_mac(const char *line, void *arg)
28{
Mike Frysinger7031f622006-05-08 03:20:50 +000029 struct ether_addr *temp_ether_addr;
Mike Frysinger7031f622006-05-08 03:20:50 +000030
Denis Vlasenkofcc63472008-04-10 02:09:40 +000031 temp_ether_addr = ether_aton_r(line, (struct ether_addr *)arg);
Denis Vlasenko5a3395b2006-11-18 19:51:32 +000032 if (temp_ether_addr == NULL)
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000033 return 0;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000034 return 1;
Mike Frysinger7031f622006-05-08 03:20:50 +000035}
36
37
38static int read_str(const char *line, void *arg)
39{
40 char **dest = arg;
41
42 free(*dest);
Denis Vlasenko4ebaf102007-01-19 21:33:19 +000043 *dest = xstrdup(line);
Mike Frysinger7031f622006-05-08 03:20:50 +000044 return 1;
45}
46
47
48static int read_u32(const char *line, void *arg)
49{
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000050 *(uint32_t*)arg = bb_strtou32(line, NULL, 10);
Denis Vlasenkod686a042006-11-27 14:43:21 +000051 return errno == 0;
Mike Frysinger7031f622006-05-08 03:20:50 +000052}
53
54
55static int read_yn(const char *line, void *arg)
56{
57 char *dest = arg;
Mike Frysinger7031f622006-05-08 03:20:50 +000058
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000059 if (!strcasecmp("yes", line)) {
Mike Frysinger7031f622006-05-08 03:20:50 +000060 *dest = 1;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000061 return 1;
62 }
63 if (!strcasecmp("no", line)) {
Mike Frysinger7031f622006-05-08 03:20:50 +000064 *dest = 0;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000065 return 1;
66 }
67 return 0;
Mike Frysinger7031f622006-05-08 03:20:50 +000068}
69
70
71/* find option 'code' in opt_list */
Denis Vlasenkof1980f62008-09-26 09:34:59 +000072struct option_set* FAST_FUNC find_option(struct option_set *opt_list, uint8_t code)
Mike Frysinger7031f622006-05-08 03:20:50 +000073{
74 while (opt_list && opt_list->data[OPT_CODE] < code)
75 opt_list = opt_list->next;
76
Denis Vlasenkoc82b5102007-07-01 17:05:57 +000077 if (opt_list && opt_list->data[OPT_CODE] == code)
78 return opt_list;
79 return NULL;
Mike Frysinger7031f622006-05-08 03:20:50 +000080}
81
82
83/* add an option to the opt_list */
Denis Vlasenkoc90c3f32006-11-23 12:57:49 +000084static void attach_option(struct option_set **opt_list,
85 const struct dhcp_option *option, char *buffer, int length)
Mike Frysinger7031f622006-05-08 03:20:50 +000086{
87 struct option_set *existing, *new, **curr;
88
Denis Vlasenkod686a042006-11-27 14:43:21 +000089 existing = find_option(*opt_list, option->code);
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +000090 if (!existing) {
Denis Vlasenko35ff7462007-11-28 19:23:12 +000091 DEBUG("Attaching option %02x to list", option->code);
Mike Frysinger7031f622006-05-08 03:20:50 +000092
Denis Vlasenko50664732007-02-27 21:15:08 +000093#if ENABLE_FEATURE_RFC3397
94 if ((option->flags & TYPE_MASK) == OPTION_STR1035)
95 /* reuse buffer and length for RFC1035-formatted string */
Denis Vlasenkoc4f12f52008-05-12 14:35:56 +000096 buffer = (char *)dname_enc(NULL, 0, buffer, &length);
Denis Vlasenko50664732007-02-27 21:15:08 +000097#endif
98
Mike Frysinger7031f622006-05-08 03:20:50 +000099 /* make a new option */
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000100 new = xmalloc(sizeof(*new));
Mike Frysinger7031f622006-05-08 03:20:50 +0000101 new->data = xmalloc(length + 2);
102 new->data[OPT_CODE] = option->code;
103 new->data[OPT_LEN] = length;
104 memcpy(new->data + 2, buffer, length);
105
106 curr = opt_list;
107 while (*curr && (*curr)->data[OPT_CODE] < option->code)
108 curr = &(*curr)->next;
109
110 new->next = *curr;
111 *curr = new;
Denis Vlasenko50664732007-02-27 21:15:08 +0000112#if ENABLE_FEATURE_RFC3397
113 if ((option->flags & TYPE_MASK) == OPTION_STR1035 && buffer != NULL)
114 free(buffer);
115#endif
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000116 return;
Mike Frysinger7031f622006-05-08 03:20:50 +0000117 }
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000118
119 /* add it to an existing option */
Denis Vlasenko35ff7462007-11-28 19:23:12 +0000120 DEBUG("Attaching option %02x to existing member of list", option->code);
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000121 if (option->flags & OPTION_LIST) {
Denis Vlasenko50664732007-02-27 21:15:08 +0000122#if ENABLE_FEATURE_RFC3397
123 if ((option->flags & TYPE_MASK) == OPTION_STR1035)
124 /* reuse buffer and length for RFC1035-formatted string */
Denis Vlasenkoc4f12f52008-05-12 14:35:56 +0000125 buffer = (char *)dname_enc(existing->data + 2,
Denis Vlasenko50664732007-02-27 21:15:08 +0000126 existing->data[OPT_LEN], buffer, &length);
127#endif
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000128 if (existing->data[OPT_LEN] + length <= 255) {
129 existing->data = xrealloc(existing->data,
130 existing->data[OPT_LEN] + length + 3);
131 if ((option->flags & TYPE_MASK) == OPTION_STRING) {
Denis Vlasenkoe129f432007-02-02 01:57:24 +0000132 /* ' ' can bring us to 256 - bad */
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000133 if (existing->data[OPT_LEN] + length >= 255)
134 return;
135 /* add space separator between STRING options in a list */
136 existing->data[existing->data[OPT_LEN] + 2] = ' ';
137 existing->data[OPT_LEN]++;
138 }
139 memcpy(existing->data + existing->data[OPT_LEN] + 2, buffer, length);
140 existing->data[OPT_LEN] += length;
141 } /* else, ignore the data, we could put this in a second option in the future */
Denis Vlasenko50664732007-02-27 21:15:08 +0000142#if ENABLE_FEATURE_RFC3397
143 if ((option->flags & TYPE_MASK) == OPTION_STR1035 && buffer != NULL)
144 free(buffer);
145#endif
Denis Vlasenkoc4d606e2007-02-02 01:16:08 +0000146 } /* else, ignore the new data */
Mike Frysinger7031f622006-05-08 03:20:50 +0000147}
148
149
150/* read a dhcp option and add it to opt_list */
151static int read_opt(const char *const_line, void *arg)
152{
153 struct option_set **opt_list = arg;
154 char *opt, *val, *endptr;
Mike Frysinger7031f622006-05-08 03:20:50 +0000155 char *line;
Denis Vlasenkob539c842007-11-29 08:17:45 +0000156 const struct dhcp_option *option;
157 int retval, length, idx;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +0000158 char buffer[8] ALIGNED(4);
Mike Frysinger7031f622006-05-08 03:20:50 +0000159 uint16_t *result_u16 = (uint16_t *) buffer;
160 uint32_t *result_u32 = (uint32_t *) buffer;
161
162 /* Cheat, the only const line we'll actually get is "" */
163 line = (char *) const_line;
Denis Vlasenkoc90c3f32006-11-23 12:57:49 +0000164 opt = strtok(line, " \t=");
Denis Vlasenkob539c842007-11-29 08:17:45 +0000165 if (!opt)
166 return 0;
Mike Frysinger7031f622006-05-08 03:20:50 +0000167
Denis Vlasenko027271e2008-03-20 12:47:01 +0000168 idx = index_in_strings(dhcp_option_strings, opt); /* NB: was strcasecmp! */
Denis Vlasenkob539c842007-11-29 08:17:45 +0000169 if (idx < 0)
170 return 0;
171 option = &dhcp_options[idx];
Mike Frysinger7031f622006-05-08 03:20:50 +0000172
Denis Vlasenkob539c842007-11-29 08:17:45 +0000173 retval = 0;
Mike Frysinger7031f622006-05-08 03:20:50 +0000174 do {
Denis Vlasenkoc90c3f32006-11-23 12:57:49 +0000175 val = strtok(NULL, ", \t");
176 if (!val) break;
Denis Vlasenkob539c842007-11-29 08:17:45 +0000177 length = dhcp_option_lengths[option->flags & TYPE_MASK];
Mike Frysinger7031f622006-05-08 03:20:50 +0000178 retval = 0;
179 opt = buffer; /* new meaning for variable opt */
180 switch (option->flags & TYPE_MASK) {
181 case OPTION_IP:
182 retval = read_ip(val, buffer);
183 break;
184 case OPTION_IP_PAIR:
185 retval = read_ip(val, buffer);
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000186 val = strtok(NULL, ", \t/-");
187 if (!val)
188 retval = 0;
189 if (retval)
190 retval = read_ip(val, buffer + 4);
Mike Frysinger7031f622006-05-08 03:20:50 +0000191 break;
192 case OPTION_STRING:
Denis Vlasenko50664732007-02-27 21:15:08 +0000193#if ENABLE_FEATURE_RFC3397
194 case OPTION_STR1035:
195#endif
Mike Frysinger7031f622006-05-08 03:20:50 +0000196 length = strlen(val);
197 if (length > 0) {
198 if (length > 254) length = 254;
199 opt = val;
200 retval = 1;
201 }
202 break;
203 case OPTION_BOOLEAN:
204 retval = read_yn(val, buffer);
205 break;
206 case OPTION_U8:
207 buffer[0] = strtoul(val, &endptr, 0);
208 retval = (endptr[0] == '\0');
209 break;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000210 /* htonX are macros in older libc's, using temp var
211 * in code below for safety */
212 /* TODO: use bb_strtoX? */
213 case OPTION_U16: {
214 unsigned long tmp = strtoul(val, &endptr, 0);
215 *result_u16 = htons(tmp);
216 retval = (endptr[0] == '\0' /*&& tmp < 0x10000*/);
217 break;
218 }
219 case OPTION_S16: {
220 long tmp = strtol(val, &endptr, 0);
221 *result_u16 = htons(tmp);
Mike Frysinger7031f622006-05-08 03:20:50 +0000222 retval = (endptr[0] == '\0');
223 break;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000224 }
225 case OPTION_U32: {
226 unsigned long tmp = strtoul(val, &endptr, 0);
227 *result_u32 = htonl(tmp);
Mike Frysinger7031f622006-05-08 03:20:50 +0000228 retval = (endptr[0] == '\0');
229 break;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000230 }
231 case OPTION_S32: {
232 long tmp = strtol(val, &endptr, 0);
233 *result_u32 = htonl(tmp);
Mike Frysinger7031f622006-05-08 03:20:50 +0000234 retval = (endptr[0] == '\0');
235 break;
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000236 }
Mike Frysinger7031f622006-05-08 03:20:50 +0000237 default:
238 break;
239 }
240 if (retval)
241 attach_option(opt_list, option, opt, length);
242 } while (retval && option->flags & OPTION_LIST);
243 return retval;
244}
245
246static int read_staticlease(const char *const_line, void *arg)
247{
Mike Frysinger7031f622006-05-08 03:20:50 +0000248 char *line;
249 char *mac_string;
250 char *ip_string;
251 uint8_t *mac_bytes;
252 uint32_t *ip;
253
Mike Frysinger7031f622006-05-08 03:20:50 +0000254 /* Allocate memory for addresses */
255 mac_bytes = xmalloc(sizeof(unsigned char) * 8);
256 ip = xmalloc(sizeof(uint32_t));
257
258 /* Read mac */
259 line = (char *) const_line;
260 mac_string = strtok(line, " \t");
261 read_mac(mac_string, mac_bytes);
262
263 /* Read ip */
264 ip_string = strtok(NULL, " \t");
265 read_ip(ip_string, ip);
266
267 addStaticLease(arg, mac_bytes, ip);
268
Rob Landley3f785612006-05-28 01:06:36 +0000269 if (ENABLE_FEATURE_UDHCP_DEBUG) printStaticLeases(arg);
Mike Frysinger7031f622006-05-08 03:20:50 +0000270
271 return 1;
Mike Frysinger7031f622006-05-08 03:20:50 +0000272}
273
274
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000275struct config_keyword {
276 const char *keyword;
277 int (*handler)(const char *line, void *var);
278 void *var;
279 const char *def;
Mike Frysinger7031f622006-05-08 03:20:50 +0000280};
281
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000282static const struct config_keyword keywords[] = {
283 /* keyword handler variable address default */
284 {"start", read_ip, &(server_config.start_ip), "192.168.0.20"},
285 {"end", read_ip, &(server_config.end_ip), "192.168.0.254"},
286 {"interface", read_str, &(server_config.interface), "eth0"},
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000287 /* Avoid "max_leases value not sane" warning by setting default
288 * to default_end_ip - default_start_ip + 1: */
289 {"max_leases", read_u32, &(server_config.max_leases), "235"},
290 {"remaining", read_yn, &(server_config.remaining), "yes"},
291 {"auto_time", read_u32, &(server_config.auto_time), "7200"},
292 {"decline_time", read_u32, &(server_config.decline_time), "3600"},
293 {"conflict_time",read_u32, &(server_config.conflict_time),"3600"},
294 {"offer_time", read_u32, &(server_config.offer_time), "60"},
295 {"min_lease", read_u32, &(server_config.min_lease), "60"},
296 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
297 {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000298 {"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"},
Denis Vlasenko027271e2008-03-20 12:47:01 +0000299 /* keywords with no defaults must be last! */
300 {"option", read_opt, &(server_config.options), ""},
301 {"opt", read_opt, &(server_config.options), ""},
302 {"notify_file", read_str, &(server_config.notify_file), ""},
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000303 {"sname", read_str, &(server_config.sname), ""},
304 {"boot_file", read_str, &(server_config.boot_file), ""},
305 {"static_lease", read_staticlease, &(server_config.static_leases), ""},
306 /* ADDME: static lease */
307};
Denis Vlasenko027271e2008-03-20 12:47:01 +0000308enum { KWS_WITH_DEFAULTS = ARRAY_SIZE(keywords) - 6 };
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000309
Denis Vlasenkof1980f62008-09-26 09:34:59 +0000310void FAST_FUNC read_config(const char *file)
Mike Frysinger7031f622006-05-08 03:20:50 +0000311{
Denis Vlasenkoeb751292008-07-20 17:58:12 +0000312 parser_t *parser;
313 const struct config_keyword *k;
314 unsigned i;
315 char *token[2];
Mike Frysinger7031f622006-05-08 03:20:50 +0000316
Denis Vlasenko027271e2008-03-20 12:47:01 +0000317 for (i = 0; i < KWS_WITH_DEFAULTS; i++)
318 keywords[i].handler(keywords[i].def, keywords[i].var);
Mike Frysinger7031f622006-05-08 03:20:50 +0000319
Denis Vlasenkoeb751292008-07-20 17:58:12 +0000320 parser = config_open(file);
Denis Vlasenko084266e2008-07-26 23:08:31 +0000321 while (config_read(parser, token, 2, 2, "# \t", PARSE_NORMAL)) {
Denis Vlasenkoeb751292008-07-20 17:58:12 +0000322 for (k = keywords, i = 0; i < ARRAY_SIZE(keywords); k++, i++) {
323 if (!strcasecmp(token[0], k->keyword)) {
324 if (!k->handler(token[1], k->var)) {
325 bb_error_msg("can't parse line %u in %s",
326 parser->lineno, file);
Mike Frysinger7031f622006-05-08 03:20:50 +0000327 /* reset back to the default value */
Denis Vlasenkoeb751292008-07-20 17:58:12 +0000328 k->handler(k->def, k->var);
Mike Frysinger7031f622006-05-08 03:20:50 +0000329 }
Denis Vlasenko027271e2008-03-20 12:47:01 +0000330 break;
331 }
332 }
Mike Frysinger7031f622006-05-08 03:20:50 +0000333 }
Denis Vlasenkoeb751292008-07-20 17:58:12 +0000334 config_close(parser);
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000335
336 server_config.start_ip = ntohl(server_config.start_ip);
337 server_config.end_ip = ntohl(server_config.end_ip);
Mike Frysinger7031f622006-05-08 03:20:50 +0000338}
339
340
Denis Vlasenkof1980f62008-09-26 09:34:59 +0000341void FAST_FUNC write_leases(void)
Mike Frysinger7031f622006-05-08 03:20:50 +0000342{
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000343 int fp;
344 unsigned i;
Mike Frysinger7031f622006-05-08 03:20:50 +0000345 time_t curr = time(0);
346 unsigned long tmp_time;
347
Denis Vlasenko62a90cd2008-03-17 09:07:36 +0000348 fp = open_or_warn(server_config.lease_file, O_WRONLY|O_CREAT|O_TRUNC);
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000349 if (fp < 0) {
Mike Frysinger7031f622006-05-08 03:20:50 +0000350 return;
351 }
352
353 for (i = 0; i < server_config.max_leases; i++) {
354 if (leases[i].yiaddr != 0) {
355
356 /* screw with the time in the struct, for easier writing */
357 tmp_time = leases[i].expires;
358
359 if (server_config.remaining) {
360 if (lease_expired(&(leases[i])))
361 leases[i].expires = 0;
362 else leases[i].expires -= curr;
363 } /* else stick with the time we got */
364 leases[i].expires = htonl(leases[i].expires);
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000365 // FIXME: error check??
366 full_write(fp, &leases[i], sizeof(leases[i]));
Mike Frysinger7031f622006-05-08 03:20:50 +0000367
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000368 /* then restore it when done */
Mike Frysinger7031f622006-05-08 03:20:50 +0000369 leases[i].expires = tmp_time;
370 }
371 }
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000372 close(fp);
Mike Frysinger7031f622006-05-08 03:20:50 +0000373
374 if (server_config.notify_file) {
Denis Vlasenko2e4c3c42008-04-02 13:04:19 +0000375// TODO: vfork-based child creation
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000376 char *cmd = xasprintf("%s %s", server_config.notify_file, server_config.lease_file);
377 system(cmd);
378 free(cmd);
Mike Frysinger7031f622006-05-08 03:20:50 +0000379 }
380}
381
382
Denis Vlasenkof1980f62008-09-26 09:34:59 +0000383void FAST_FUNC read_leases(const char *file)
Mike Frysinger7031f622006-05-08 03:20:50 +0000384{
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000385 int fp;
Denis Vlasenko2e4c3c42008-04-02 13:04:19 +0000386 unsigned i;
Mike Frysinger7031f622006-05-08 03:20:50 +0000387 struct dhcpOfferedAddr lease;
388
Denis Vlasenko50f7f442007-04-11 23:20:53 +0000389 fp = open_or_warn(file, O_RDONLY);
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000390 if (fp < 0) {
Mike Frysinger7031f622006-05-08 03:20:50 +0000391 return;
392 }
393
Denis Vlasenko2e4c3c42008-04-02 13:04:19 +0000394 i = 0;
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000395 while (i < server_config.max_leases
396 && full_read(fp, &lease, sizeof(lease)) == sizeof(lease)
397 ) {
Mike Frysinger7031f622006-05-08 03:20:50 +0000398 /* ADDME: is it a static lease */
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000399 uint32_t y = ntohl(lease.yiaddr);
400 if (y >= server_config.start_ip && y <= server_config.end_ip) {
Mike Frysinger7031f622006-05-08 03:20:50 +0000401 lease.expires = ntohl(lease.expires);
Denis Vlasenkoc82b5102007-07-01 17:05:57 +0000402 if (!server_config.remaining)
Denis Vlasenko2e4c3c42008-04-02 13:04:19 +0000403 lease.expires -= time(NULL);
Mike Frysinger7031f622006-05-08 03:20:50 +0000404 if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
Denis Vlasenkoe1a0d482006-10-20 13:28:22 +0000405 bb_error_msg("too many leases while loading %s", file);
Mike Frysinger7031f622006-05-08 03:20:50 +0000406 break;
407 }
408 i++;
409 }
410 }
Denis Vlasenko3538b9a2006-09-06 18:36:50 +0000411 DEBUG("Read %d leases", i);
Denis Vlasenko61126ab2006-11-18 22:03:26 +0000412 close(fp);
Mike Frysinger7031f622006-05-08 03:20:50 +0000413}