[dhcp-agent-commits] dhcp-agent/src Makefile.am,1.20,1.21 dhcp-client-conf.c,1.23,1.24 dhcp-client-g
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2003-05-15 05:08:17
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv15092/src Modified Files: Makefile.am dhcp-client-conf.c dhcp-client-guile.c dhcp-client.c Log Message: updated for new sysconf/conf directories Index: Makefile.am =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile.am 11 May 2003 07:50:00 -0000 1.20 --- Makefile.am 15 May 2003 05:08:13 -0000 1.21 *************** *** 4,9 **** AM_CFLAGS = -Wall -Werror ! INCLUDES = @PCAP_INC@ @DNET_INC@ @GUILE_INC@ ! DEFS = @DEFS@ AUTOMAKE_OPTIONS = foreign --- 4,10 ---- AM_CFLAGS = -Wall -Werror ! INCLUDES = ${PCAP_INC} ${DNET_INC} ${GUILE_INC} ! CPPFLAGS = -DDHCPSYSCONFDIR=\"${dhcpsysconfdir}\" -DDHCPSYSCONF_CLIENTDIR=\"${dhcpsysconf_clientdir}\" \ ! -DDHCPLOCALSTATEDIR=\"${dhcplocalstatedir}\" -DDHCPLOCALSTATE_CLIENTDIR=\"${dhcplocalstate_clientdir}\" AUTOMAKE_OPTIONS = foreign *************** *** 64,69 **** dhcp-client-guile.c ! dhcp_client_LDADD = -ldhcputil @GUILE_LIB@ -lefence dhcp_sniff_LDADD = -ldhcputil ! libdhcputil_la_LIBADD = @PCAP_LIB@ @DNET_LIB@ --- 65,72 ---- dhcp-client-guile.c ! dhcp_client_LDADD = -ldhcputil ${GUILE_LIB} -lefence dhcp_sniff_LDADD = -ldhcputil + libdhcputil_la_LIBADD = ${PCAP_LIB} ${DNET_LIB} ! install-exec-am: ! mkdir -p ${dhcplocalstatedir} ${dhcplocalstate_clientdir} \ No newline at end of file Index: dhcp-client-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-conf.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dhcp-client-conf.c 4 May 2003 18:51:23 -0000 1.23 --- dhcp-client-conf.c 15 May 2003 05:08:14 -0000 1.24 *************** *** 519,528 **** sb = stringbuffer_create(); ! stringbuffer_aprintf(sb, "%s.%s", cc->interface, "conf"); ! fname = xstrdup(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return fname; } --- 519,548 ---- sb = stringbuffer_create(); ! stringbuffer_aprintf(sb, "%s/default.conf", DHCPSYSCONF_CLIENTDIR); ! if(file_exists(stringbuffer_getstring(sb))) { ! fname = xstrdup(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return fname; ! ! } ! ! stringbuffer_clear(sb); ! stringbuffer_aprintf(sb, "%s/%s.conf", DHCPSYSCONF_CLIENTDIR, cc->interface); ! ! if(file_exists(stringbuffer_getstring(sb))) { ! ! fname = xstrdup(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return fname; ! ! } ! ! /* otherwise there is no configuration file and this is ! * bad. signal a fatal error. */ ! ! FATAL_MESSAGE("configuration file missing -- looked for default.conf and <interface>.conf. exiting..."); ! exit(1); /* get rid of compiler warning. */ } Index: dhcp-client-guile.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client-guile.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dhcp-client-guile.c 11 May 2003 07:48:29 -0000 1.2 --- dhcp-client-guile.c 15 May 2003 05:08:14 -0000 1.3 *************** *** 544,553 **** sb = stringbuffer_create(); ! stringbuffer_aprintf(sb, "%s.sysconf", dc->interface); ! scm_c_primitive_load(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return; } --- 544,572 ---- sb = stringbuffer_create(); ! stringbuffer_aprintf(sb, "%s/default.sysconf", DHCPSYSCONF_CLIENTDIR); ! if(file_exists(stringbuffer_getstring(sb))) { ! scm_c_primitive_load(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return; ! ! } ! ! stringbuffer_clear(sb); ! stringbuffer_aprintf(sb, "%s/%s.sysconf", DHCPSYSCONF_CLIENTDIR, dc->interface); ! ! if(file_exists(stringbuffer_getstring(sb))) { ! ! scm_c_primitive_load(stringbuffer_getstring(sb)); ! stringbuffer_destroy(sb); ! return; ! } ! ! /* otherwise there is no sysconf file and this is ! * bad. signal a fatal error. */ ! ! FATAL_MESSAGE("sysconf file missing -- looked for default.sysconf and <interface>.sysconf. exiting..."); ! exit(1); /* get rid of compiler warning. */ } Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dhcp-client.c 11 May 2003 07:49:26 -0000 1.23 --- dhcp-client.c 15 May 2003 05:08:14 -0000 1.24 *************** *** 90,94 **** /* global vars affecting other code. */ ! char *work_dir = CLIENT_WORK_DIR; /* our default working directory */ #if !defined(HAVE_PROGNAME) --- 90,94 ---- /* global vars affecting other code. */ ! char *work_dir = DHCPLOCALSTATE_CLIENTDIR; /* our default working directory */ #if !defined(HAVE_PROGNAME) *************** *** 338,358 **** /* Switch into our work directory */ ! ! /* If it isn't there create it. ! * Since we're not setuid we ! * assume the root user knows what he's ! * doing and that it's ! * safe to create this directory. ! * ! */ ! ! if(!file_exists(work_dir)) { ! ! if(mkdir(work_dir, S_IRWXU) < 0) { ! FATAL_MESSAGE("cannot create work directory", strerror(errno)); ! } ! } ! ! if(!file_permissions_are(work_dir, S_IRWXU)) { FATAL_MESSAGE("wrong permissions on work directory: %s (use rwx only for owner)", work_dir); } --- 338,342 ---- /* Switch into our work directory */ ! if(!file_permissions_are(work_dir, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) { FATAL_MESSAGE("wrong permissions on work directory: %s (use rwx only for owner)", work_dir); } |