Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1453212 Details for
Bug 1556983
Ensure the DHCP client-id doesn't change when upgrading from RHEL 7.5
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[dist-git PATCH] dhcp: don't add leading zero to printable client-id
0001-dhcp-don-t-add-leading-zero-to-printable-client-id-r.patch (text/plain), 13.87 KB, created by
Beniamino Galvani
on 2018-06-20 12:45:39 UTC
(
hide
)
Description:
[dist-git PATCH] dhcp: don't add leading zero to printable client-id
Filename:
MIME Type:
Creator:
Beniamino Galvani
Created:
2018-06-20 12:45:39 UTC
Size:
13.87 KB
patch
obsolete
>From d50141fcf342fc63ce1722088f4e9c827451d516 Mon Sep 17 00:00:00 2001 >From: Beniamino Galvani <bgalvani@redhat.com> >Date: Wed, 20 Jun 2018 13:30:23 +0200 >Subject: [PATCH] dhcp: don't add leading zero to printable client-id (rh > #1556983) > >Resolves: #1556983 >--- > ...-no-leading-zero-client-id-rh1556983.patch | 330 ++++++++++++++++++ > NetworkManager.spec | 5 + > 2 files changed, 335 insertions(+) > create mode 100644 0003-dhclient-no-leading-zero-client-id-rh1556983.patch > >diff --git a/0003-dhclient-no-leading-zero-client-id-rh1556983.patch b/0003-dhclient-no-leading-zero-client-id-rh1556983.patch >new file mode 100644 >index 0000000..575d0b1 >--- /dev/null >+++ b/0003-dhclient-no-leading-zero-client-id-rh1556983.patch >@@ -0,0 +1,330 @@ >+From 8e8c797904fc29396d340609f006add206df4973 Mon Sep 17 00:00:00 2001 >+From: Beniamino Galvani <bgalvani@redhat.com> >+Date: Wed, 20 Jun 2018 11:49:22 +0200 >+Subject: [PATCH 1/2] Revert "dhclient: write client-id with backslash and >+ quotes as hex" >+ >+This reverts commit 0e4b33ee7552b036332f1bdbfed78f8ee75f000e. >+--- >+ src/dhcp/nm-dhcp-dhclient-utils.c | 2 +- >+ src/dhcp/tests/test-dhcp-dhclient.c | 32 +---------------------------- >+ 2 files changed, 2 insertions(+), 32 deletions(-) >+ >+diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c >+index 3290dd65c..6adb395c9 100644 >+--- a/src/dhcp/nm-dhcp-dhclient-utils.c >++++ b/src/dhcp/nm-dhcp-dhclient-utils.c >+@@ -124,7 +124,7 @@ add_ip4_config (GString *str, GBytes *client_id, const char *hostname, gboolean >+ * as long as all the characters are printable. >+ */ >+ for (i = 1; (p[0] == 0) && i < l; i++) { >+- if (!g_ascii_isprint (p[i]) || p[i] == '\\' || p[i] == '"') >++ if (!g_ascii_isprint (p[i])) >+ break; >+ } >+ >+diff --git a/src/dhcp/tests/test-dhcp-dhclient.c b/src/dhcp/tests/test-dhcp-dhclient.c >+index 2f369aacc..f3b17807f 100644 >+--- a/src/dhcp/tests/test-dhcp-dhclient.c >++++ b/src/dhcp/tests/test-dhcp-dhclient.c >+@@ -176,35 +176,6 @@ test_quote_client_id (void) >+ >+ /*****************************************************************************/ >+ >+-static const char *quote_client_id_expected_2 = \ >+- "# Created by NetworkManager\n" >+- "\n" >+- "send dhcp-client-identifier 00:61:5c:62:63; # added by NetworkManager\n" >+- "\n" >+- "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+- "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+- "option wpad code 252 = string;\n" >+- "\n" >+- "also request rfc3442-classless-static-routes;\n" >+- "also request ms-classless-static-routes;\n" >+- "also request static-routes;\n" >+- "also request wpad;\n" >+- "also request ntp-servers;\n" >+- "\n"; >+- >+-static void >+-test_quote_client_id_2 (void) >+-{ >+- test_config (NULL, quote_client_id_expected_2, >+- AF_INET, NULL, 0, FALSE, >+- "a\\bc", >+- NULL, >+- "eth0", >+- NULL); >+-} >+- >+-/*****************************************************************************/ >+- >+ static const char *hex_zero_client_id_expected = \ >+ "# Created by NetworkManager\n" >+ "\n" >+@@ -1026,8 +997,7 @@ main (int argc, char **argv) >+ >+ g_test_add_func ("/dhcp/dhclient/orig_missing", test_orig_missing); >+ g_test_add_func ("/dhcp/dhclient/override_client_id", test_override_client_id); >+- g_test_add_func ("/dhcp/dhclient/quote_client_id/1", test_quote_client_id); >+- g_test_add_func ("/dhcp/dhclient/quote_client_id/2", test_quote_client_id_2); >++ g_test_add_func ("/dhcp/dhclient/quote_client_id", test_quote_client_id); >+ g_test_add_func ("/dhcp/dhclient/hex_zero_client_id", test_hex_zero_client_id); >+ g_test_add_func ("/dhcp/dhclient/ascii_client_id", test_ascii_client_id); >+ g_test_add_func ("/dhcp/dhclient/hex_single_client_id", test_hex_single_client_id); >+-- >+2.17.0 >+ >+From 5fa45f1a84ea2e46e5fb07aeef19cb46322b64bc Mon Sep 17 00:00:00 2001 >+From: Beniamino Galvani <bgalvani@redhat.com> >+Date: Wed, 20 Jun 2018 11:50:51 +0200 >+Subject: [PATCH 2/2] Revert "dhcp: dhclient: set type 0 for printable client >+ IDs" >+ >+Keep the RHEL 7.5 behavior. >+ >+This reverts commit 8ffa22d10d3001405965826b46463663fd2dacc2. >+--- >+ src/dhcp/nm-dhcp-dhclient-utils.c | 46 +++------------- >+ src/dhcp/tests/test-dhcp-dhclient.c | 83 +++-------------------------- >+ 2 files changed, 16 insertions(+), 113 deletions(-) >+ >+diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c >+index 6adb395c9..90fa33397 100644 >+--- a/src/dhcp/nm-dhcp-dhclient-utils.c >++++ b/src/dhcp/nm-dhcp-dhclient-utils.c >+@@ -137,9 +137,8 @@ add_ip4_config (GString *str, GBytes *client_id, const char *hostname, gboolean >+ g_string_append_printf (str, "%02x", (guint8) p[i]); >+ } >+ } else { >+- /* Printable; just add to the line with type 0 */ >++ /* Printable; just add to the line minus the 'type' */ >+ g_string_append_c (str, '"'); >+- g_string_append (str, "\\x00"); >+ g_string_append_len (str, p + 1, l - 1); >+ g_string_append_c (str, '"'); >+ } >+@@ -177,60 +176,31 @@ read_client_id (const char *str) >+ { >+ gs_free char *s = NULL; >+ char *p; >+- int i = 0, j = 0; >+ >+ nm_assert (!strncmp (str, CLIENTID_TAG, NM_STRLEN (CLIENTID_TAG))); >+- str += NM_STRLEN (CLIENTID_TAG); >+ >+- if (!g_ascii_isspace (*str)) >+- return NULL; >++ str += NM_STRLEN (CLIENTID_TAG); >+ while (g_ascii_isspace (*str)) >+ str++; >+ >+ if (*str == '"') { >+- /* Parse string literal with escape sequences */ >+ s = g_strdup (str + 1); >+ p = strrchr (s, '"'); >+ if (p) >+ *p = '\0'; >+ else >+ return NULL; >++ } else >++ s = g_strdup (str); >+ >+- if (!s[0]) >+- return NULL; >+- >+- while (s[i]) { >+- if ( s[i] == '\\' >+- && s[i + 1] == 'x' >+- && g_ascii_isxdigit (s[i + 2]) >+- && g_ascii_isxdigit (s[i + 3])) { >+- s[j++] = (g_ascii_xdigit_value (s[i + 2]) << 4) >+- + g_ascii_xdigit_value (s[i + 3]); >+- i += 4; >+- continue; >+- } >+- if ( s[i] == '\\' >+- && s[i + 1] >= '0' && s[i + 1] <= '7' >+- && s[1 + 2] >= '0' && s[i + 2] <= '7' >+- && s[1 + 3] >= '0' && s[i + 3] <= '7') { >+- s[j++] = ((s[i + 1] - '0') << 6) >+- + ((s[i + 2] - '0') << 3) >+- + ( s[i + 3] - '0'); >+- i += 4; >+- continue; >+- } >+- s[j++] = s[i++]; >+- } >+- return g_bytes_new_take (g_steal_pointer (&s), j); >+- } >+- >+- /* Otherwise, try to read a hexadecimal sequence */ >+- s = g_strdup (str); >+ g_strchomp (s); >+ if (s[strlen (s) - 1] == ';') >+ s[strlen (s) - 1] = '\0'; >+ >+- return nm_utils_hexstr2bin (s); >++ if (!s[0]) >++ return NULL; >++ >++ return nm_dhcp_utils_client_id_string_to_bytes (s); >+ } >+ >+ GBytes * >+diff --git a/src/dhcp/tests/test-dhcp-dhclient.c b/src/dhcp/tests/test-dhcp-dhclient.c >+index f3b17807f..377938c87 100644 >+--- a/src/dhcp/tests/test-dhcp-dhclient.c >++++ b/src/dhcp/tests/test-dhcp-dhclient.c >+@@ -150,7 +150,7 @@ test_override_client_id (void) >+ static const char *quote_client_id_expected = \ >+ "# Created by NetworkManager\n" >+ "\n" >+- "send dhcp-client-identifier \"\\x00abcd\"; # added by NetworkManager\n" >++ "send dhcp-client-identifier \"1234\"; # added by NetworkManager\n" >+ "\n" >+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+@@ -168,36 +168,7 @@ test_quote_client_id (void) >+ { >+ test_config (NULL, quote_client_id_expected, >+ AF_INET, NULL, 0, FALSE, >+- "abcd", >+- NULL, >+- "eth0", >+- NULL); >+-} >+- >+-/*****************************************************************************/ >+- >+-static const char *hex_zero_client_id_expected = \ >+- "# Created by NetworkManager\n" >+- "\n" >+- "send dhcp-client-identifier 00:11:22:33; # added by NetworkManager\n" >+- "\n" >+- "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+- "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+- "option wpad code 252 = string;\n" >+- "\n" >+- "also request rfc3442-classless-static-routes;\n" >+- "also request ms-classless-static-routes;\n" >+- "also request static-routes;\n" >+- "also request wpad;\n" >+- "also request ntp-servers;\n" >+- "\n"; >+- >+-static void >+-test_hex_zero_client_id (void) >+-{ >+- test_config (NULL, hex_zero_client_id_expected, >+- AF_INET, NULL, 0, FALSE, >+- "00:11:22:33", >++ "1234", >+ NULL, >+ "eth0", >+ NULL); >+@@ -208,7 +179,7 @@ test_hex_zero_client_id (void) >+ static const char *ascii_client_id_expected = \ >+ "# Created by NetworkManager\n" >+ "\n" >+- "send dhcp-client-identifier \"\\x00qb:cd:ef:12:34:56\"; # added by NetworkManager\n" >++ "send dhcp-client-identifier \"qb:cd:ef:12:34:56\"; # added by NetworkManager\n" >+ "\n" >+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+@@ -264,13 +235,13 @@ test_hex_single_client_id (void) >+ /*****************************************************************************/ >+ >+ static const char *existing_hex_client_id_orig = \ >+- "send dhcp-client-identifier 10:30:04:20:7A:08;\n"; >++ "send dhcp-client-identifier 00:30:04:20:7A:08;\n"; >+ >+ static const char *existing_hex_client_id_expected = \ >+ "# Created by NetworkManager\n" >+ "# Merged from /path/to/dhclient.conf\n" >+ "\n" >+- "send dhcp-client-identifier 10:30:04:20:7A:08;\n" >++ "send dhcp-client-identifier 00:30:04:20:7A:08;\n" >+ "\n" >+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+@@ -287,7 +258,7 @@ static void >+ test_existing_hex_client_id (void) >+ { >+ gs_unref_bytes GBytes *new_client_id = NULL; >+- const guint8 bytes[] = { 0x10, 0x30, 0x04, 0x20, 0x7A, 0x08 }; >++ const guint8 bytes[] = { 0x00, 0x30, 0x04,0x20, 0x7A, 0x08 }; >+ >+ new_client_id = g_bytes_new (bytes, sizeof (bytes)); >+ test_config (existing_hex_client_id_orig, existing_hex_client_id_expected, >+@@ -300,52 +271,16 @@ test_existing_hex_client_id (void) >+ >+ /*****************************************************************************/ >+ >+-static const char *existing_escaped_client_id_orig = \ >+- "send dhcp-client-identifier \"\\044test\\xfe\";\n"; >+- >+-static const char *existing_escaped_client_id_expected = \ >+- "# Created by NetworkManager\n" >+- "# Merged from /path/to/dhclient.conf\n" >+- "\n" >+- "send dhcp-client-identifier \"\\044test\\xfe\";\n" >+- "\n" >+- "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+- "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+- "option wpad code 252 = string;\n" >+- "\n" >+- "also request rfc3442-classless-static-routes;\n" >+- "also request ms-classless-static-routes;\n" >+- "also request static-routes;\n" >+- "also request wpad;\n" >+- "also request ntp-servers;\n" >+- "\n"; >+- >+-static void >+-test_existing_escaped_client_id (void) >+-{ >+- gs_unref_bytes GBytes *new_client_id = NULL; >+- >+- new_client_id = g_bytes_new ("$test\xfe", 6); >+- test_config (existing_escaped_client_id_orig, existing_escaped_client_id_expected, >+- AF_INET, NULL, 0, FALSE, >+- NULL, >+- new_client_id, >+- "eth0", >+- NULL); >+-} >+- >+-/*****************************************************************************/ >+- >+ #define EACID "qb:cd:ef:12:34:56" >+ >+ static const char *existing_ascii_client_id_orig = \ >+- "send dhcp-client-identifier \"\\x00" EACID "\";\n"; >++ "send dhcp-client-identifier \"" EACID "\";\n"; >+ >+ static const char *existing_ascii_client_id_expected = \ >+ "# Created by NetworkManager\n" >+ "# Merged from /path/to/dhclient.conf\n" >+ "\n" >+- "send dhcp-client-identifier \"\\x00" EACID "\";\n" >++ "send dhcp-client-identifier \"" EACID "\";\n" >+ "\n" >+ "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" >+ "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" >+@@ -998,11 +933,9 @@ main (int argc, char **argv) >+ g_test_add_func ("/dhcp/dhclient/orig_missing", test_orig_missing); >+ g_test_add_func ("/dhcp/dhclient/override_client_id", test_override_client_id); >+ g_test_add_func ("/dhcp/dhclient/quote_client_id", test_quote_client_id); >+- g_test_add_func ("/dhcp/dhclient/hex_zero_client_id", test_hex_zero_client_id); >+ g_test_add_func ("/dhcp/dhclient/ascii_client_id", test_ascii_client_id); >+ g_test_add_func ("/dhcp/dhclient/hex_single_client_id", test_hex_single_client_id); >+ g_test_add_func ("/dhcp/dhclient/existing-hex-client-id", test_existing_hex_client_id); >+- g_test_add_func ("/dhcp/dhclient/existing-client-id", test_existing_escaped_client_id); >+ g_test_add_func ("/dhcp/dhclient/existing-ascii-client-id", test_existing_ascii_client_id); >+ g_test_add_func ("/dhcp/dhclient/fqdn", test_fqdn); >+ g_test_add_func ("/dhcp/dhclient/fqdn_options_override", test_fqdn_options_override); >+-- >+2.17.0 >+ >diff --git a/NetworkManager.spec b/NetworkManager.spec >index c50223f..3dec592 100644 >--- a/NetworkManager.spec >+++ b/NetworkManager.spec >@@ -112,6 +112,7 @@ Source4: 10-slaves-order.conf > # the next rebase of the source tarball. > Patch1: 0001-cloned-mac-address-permanent-rh1413312.patch > Patch2: 0002-nm-wait-online-not-require-nm-service-rh1520865.patch >+Patch3: 0003-dhclient-no-leading-zero-client-id-rh1556983.patch > > Patch1000: 1000-fix-clients-tests.patch > >@@ -433,6 +434,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. > > %patch1 -p1 > %patch2 -p1 >+%patch3 -p1 > %patch1000 -p1 > %patch9999 -p1 > >@@ -822,6 +824,9 @@ fi > %endif > > %changelog >+* Wed Jun 20 2018 Beniamino Galvani <bgalvani@redhat.com> - >+- dhcp: preserve old behavior and don't add leading zero to printable client-id (rh #1556983) >+ > * Mon Jun 18 2018 Thomas Haller <thaller@redhat.com> - 1:1.12.0-0.1 > - Update to upstream release 1.11.90 (release candidate) (rh #1592311) > - libnm: properly handle cancelling of async operations (rh #1555281) >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1556983
: 1453212