[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relax dhclient hostname checks



Quoting Michael Knudsen (e_(_at_)_molioner_(_dot_)_dk):
> I used the existing approach with macro goo for the `pure' patch in case
> I or someone else doesn't get around to rewriting this anytime soon:

Please test this instead. The other one didn't work, I messed something
up before:

Index: dhclient.c
===================================================================
RCS file: /cvs/src/sbin/dhclient/dhclient.c,v
retrieving revision 1.63
diff -u -u -r1.63 dhclient.c
--- dhclient.c  2005/02/06 17:10:13     1.63
+++ dhclient.c  2005/03/29 14:50:28
@@ -60,13 +60,14 @@
 #define        hyphenchar(c) ((c) == 0x2d)
 #define        bslashchar(c) ((c) == 0x5c)
 #define        periodchar(c) ((c) == PERIOD)
+#define        uscorechar(c) ((c) == '_')
 #define        asterchar(c) ((c) == 0x2a)
 #define        alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) || \
            ((c) >= 0x61 && (c) <= 0x7a))
 #define        digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
 
 #define        borderchar(c) (alphachar(c) || digitchar(c))
-#define        middlechar(c) (borderchar(c) || hyphenchar(c))
+#define        middlechar(c) (borderchar(c) || hyphenchar(c) || uscorechar(c))
 #define        domainchar(c) ((c) > 0x20 && (c) < 0x7f)
 
 #define        CLIENT_PATH "PATH=/usr/bin:/usr/sbin:/bin:/sbin"

Sorry for the noise.

-- 
Rumour is information distilled so finely that it can filter through
anything.
-- (Terry Pratchett, Feet of Clay)



Visit your host, monkey.org