Parser for dhclient config and lease files... */
/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2006 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
#ifndef lint
static char copyright[] =
-"$Id: clparse.c,v 1.64 2005/03/17 20:14:55 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
+"$Id: clparse.c,v 1.65 2006/02/24 23:16:27 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
status = (cfile -> warnings_occurred
? ISC_R_BADPARSE
: ISC_R_SUCCESS);
- close (file);
end_parse (&cfile);
return status;
}
} while (1);
- close (file);
end_parse (&cfile);
}
if ((status = interface_allocate (&ip, MDL)) != ISC_R_SUCCESS)
log_fatal ("Can't record interface %s: %s",
name, isc_result_totext (status));
- strcpy (ip -> name, name);
+
+ if (strlen(name) >= sizeof(ip->name)) {
+ interface_dereference(&ip, MDL);
+ return 0;
+ }
+ strcpy(ip->name, name);
+
if (dummy_interfaces) {
interface_reference (&ip -> next,
dummy_interfaces, MDL);
skip_to_semi (cfile);
break;
}
- interface_or_dummy (ipp, val);
+ if (!interface_or_dummy (ipp, val))
+ log_fatal ("Can't allocate interface %s.", val);
break;
case NAME: