summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2009-03-30 13:13:28 +0000
committerTony Vroon <chainsaw@gentoo.org>2009-03-30 13:13:28 +0000
commitdbe5ad8a0e003074bd5968adf1c15883450afbd5 (patch)
tree919fc91d4466ec0a9518ffe062761fb18bc63cb3 /net-misc/dhcp
parentWiden net-misc/dhcp mask for v4, clarify reason. 4.0.1 is going in and 4.0.0 ... (diff)
downloadgentoo-2-dbe5ad8a0e003074bd5968adf1c15883450afbd5.tar.gz
gentoo-2-dbe5ad8a0e003074bd5968adf1c15883450afbd5.tar.bz2
gentoo-2-dbe5ad8a0e003074bd5968adf1c15883450afbd5.zip
Version bump to 4.0.1, stdin config support for dhclient has been rediffed due to upstream changes. Still masked, deleting old ebuild.
(Portage version: 2.1.6.11/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/dhcp')
-rw-r--r--net-misc/dhcp/ChangeLog12
-rw-r--r--net-misc/dhcp/dhcp-4.0.1.ebuild (renamed from net-misc/dhcp/dhcp-4.0.0.ebuild)6
-rw-r--r--net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch114
3 files changed, 127 insertions, 5 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog
index b40ecf69bc77..7d49aaf73169 100644
--- a/net-misc/dhcp/ChangeLog
+++ b/net-misc/dhcp/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-misc/dhcp
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.152 2008/10/26 03:45:20 vapier Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.153 2009/03/30 13:13:28 chainsaw Exp $
+
+*dhcp-4.0.1 (30 Mar 2009)
+
+ 30 Mar 2009; <chainsaw@gentoo.org>
+ +files/dhcp-4.0.1-dhclient-stdin-conf.patch, -dhcp-4.0.0.ebuild,
+ +dhcp-4.0.1.ebuild:
+ Version bump to 4.0.1, stdin config support for dhclient has been rediffed
+ due to upstream changes. Still masked, deleting old ebuild.
26 Oct 2008; Mike Frysinger <vapier@gentoo.org> dhcp-4.0.0.ebuild:
Pull in app-vim/dhcpd-syntax with USE=vim-syntax #240192 by Dan Wallis.
diff --git a/net-misc/dhcp/dhcp-4.0.0.ebuild b/net-misc/dhcp/dhcp-4.0.1.ebuild
index 3107fe3da2e8..8b20567f7ad8 100644
--- a/net-misc/dhcp/dhcp-4.0.0.ebuild
+++ b/net-misc/dhcp/dhcp-4.0.1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.0.0.ebuild,v 1.2 2008/10/26 03:45:20 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.0.1.ebuild,v 1.1 2009/03/30 13:13:28 chainsaw Exp $
inherit eutils flag-o-matic autotools
@@ -50,7 +50,7 @@ src_unpack() {
# Quiet the isc blurb
epatch "${FILESDIR}/${PN}"-4.0-no_isc_blurb.patch
# Enable dhclient to get extra configuration from stdin
- epatch "${FILESDIR}/${PN}"-4.0-dhclient-stdin-conf.patch
+ epatch "${FILESDIR}/${PN}"-4.0.1-dhclient-stdin-conf.patch
# Disable fallback interfaces when using BPF
# This allows more than one dhclient instance on the BSD's
epatch "${FILESDIR}/${PN}"-3.0.5-bpf-nofallback.patch
diff --git a/net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch b/net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch
new file mode 100644
index 000000000000..ddbe4a39d5a4
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch
@@ -0,0 +1,114 @@
+diff -uNr dhcp-4.0.1.ORIG/client/clparse.c dhcp-4.0.1/client/clparse.c
+--- dhcp-4.0.1.ORIG/client/clparse.c 2009-03-30 13:54:47.000000000 +0100
++++ dhcp-4.0.1/client/clparse.c 2009-03-30 13:58:02.000000000 +0100
+@@ -174,6 +174,10 @@
+ #endif
+ }
+
++ /* Read any extra configuration from stdin */
++ read_client_conf_stdin ((struct interface_info *)0,
++ &top_level_config);
++
+ /* Set up state and config structures for clients that don't
+ have per-interface configuration statements. */
+ config = (struct client_config *)0;
+@@ -203,23 +207,13 @@
+ return status;
+ }
+
+-int read_client_conf_file (const char *name, struct interface_info *ip,
++int read_client_conf_actual (struct parse *cfile, struct interface_info *ip,
+ struct client_config *client)
+ {
+- int file;
+- struct parse *cfile;
+ const char *val;
+ int token;
+ isc_result_t status;
+
+- if ((file = open (name, O_RDONLY)) < 0)
+- return uerr2isc (errno);
+-
+- cfile = NULL;
+- status = new_parse(&cfile, file, NULL, 0, path_dhclient_conf, 0);
+- if (status != ISC_R_SUCCESS || cfile == NULL)
+- return status;
+-
+ do {
+ token = peek_token (&val, (unsigned *)0, cfile);
+ if (token == END_OF_FILE)
+@@ -230,10 +224,74 @@
+ status = (cfile -> warnings_occurred
+ ? ISC_R_BADPARSE
+ : ISC_R_SUCCESS);
++ return status;
++}
++
++int read_client_conf_file (const char *name, struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ struct parse *cfile;
++ isc_result_t status;
++
++ if ((file = open (name, O_RDONLY)) < 0)
++ return uerr2isc (errno);
++
++ cfile = (struct parse *)0;
++ new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
++ status = read_client_conf_actual(cfile, ip, client);
+ end_parse (&cfile);
+ return status;
+ }
+
++int read_client_conf_stdin (struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ char *buffer = NULL, *p;
++ unsigned buflen, len = 0;
++ struct parse *cfile;
++ size_t bytes;
++ isc_result_t status;
++
++ file = fileno(stdin);
++ if (isatty (file))
++ return ISC_R_NOTFOUND;
++ if (fcntl (file, F_SETFL, O_NONBLOCK) < 0)
++ log_fatal ("could not set stdin to non blocking!");
++
++ buflen = BUFSIZ;
++ buffer = malloc (BUFSIZ + 1);
++ p = buffer;
++ do {
++ bytes = read (file, p, BUFSIZ);
++ if (bytes == 0)
++ break;
++ if (bytes == -1)
++ log_fatal ("failed to read stdin!");
++ if (bytes >= BUFSIZ) {
++ buflen += BUFSIZ;
++ len += BUFSIZ;
++ buffer = realloc (buffer, buflen + 1);
++ if (!buffer)
++ log_fatal ("not enough buffer to read stdin!");
++ p = buffer + len;
++ } else {
++ len += bytes;
++ break;
++ }
++ } while(1);
++ buffer[len] = '\0';
++
++ cfile = (struct parse *)0;
++ status = new_parse (&cfile, -1, buffer, len, "stdin", 0);
++ if (status == ISC_R_SUCCESS) {
++ status = read_client_conf_actual (cfile, ip, client);
++ end_parse (&cfile);
++ }
++ free(buffer);
++ return status;
++}
+
+ /* lease-file :== client-lease-statements END_OF_FILE
+ client-lease-statements :== <nil>