diff --git a/bugfix-dhcp-64-bit-lease-parse.patch b/bugfix-dhcp-64-bit-lease-parse.patch new file mode 100644 index 0000000000000000000000000000000000000000..0488c546ae4979d8d2e089e0ffc78e64b1f7798c --- /dev/null +++ b/bugfix-dhcp-64-bit-lease-parse.patch @@ -0,0 +1,76 @@ +diff --git a/common/parse.c b/common/parse.c +index 386a632..6ebbc9b 100644 +--- a/common/parse.c ++++ b/common/parse.c +@@ -943,8 +943,8 @@ TIME + parse_date_core(cfile) + struct parse *cfile; + { +- int guess; +- int tzoff, year, mon, mday, hour, min, sec; ++ TIME guess; ++ long int tzoff, year, mon, mday, hour, min, sec; + const char *val; + enum dhcp_token token; + static int months[11] = { 31, 59, 90, 120, 151, 181, +@@ -970,7 +970,7 @@ parse_date_core(cfile) + } + + skip_token(&val, NULL, cfile); /* consume number */ +- guess = atoi(val); ++ guess = atol(val); + + return((TIME)guess); + } +@@ -998,7 +998,7 @@ parse_date_core(cfile) + somebody invents a time machine, I think we can safely disregard + it. This actually works around a stupid Y2K bug that was present + in a very early beta release of dhcpd. */ +- year = atoi(val); ++ year = atol(val); + if (year > 1900) + year -= 1900; + +@@ -1044,7 +1044,7 @@ parse_date_core(cfile) + return((TIME)0); + } + skip_token(&val, NULL, cfile); /* consume day of month */ +- mday = atoi(val); ++ mday = atol(val); + + /* Hour... */ + token = peek_token(&val, NULL, cfile); +@@ -1055,7 +1055,7 @@ parse_date_core(cfile) + return((TIME)0); + } + skip_token(&val, NULL, cfile); /* consume hour */ +- hour = atoi(val); ++ hour = atol(val); + + /* Colon separating hour from minute... */ + token = peek_token(&val, NULL, cfile); +@@ -1077,7 +1077,7 @@ parse_date_core(cfile) + return((TIME)0); + } + skip_token(&val, NULL, cfile); /* consume minute */ +- min = atoi(val); ++ min = atol(val); + + /* Colon separating minute from second... */ + token = peek_token(&val, NULL, cfile); +@@ -1099,13 +1099,13 @@ parse_date_core(cfile) + return((TIME)0); + } + skip_token(&val, NULL, cfile); /* consume second */ +- sec = atoi(val); ++ sec = atol(val); + + tzoff = 0; + token = peek_token(&val, NULL, cfile); + if (token == NUMBER) { + skip_token(&val, NULL, cfile); /* consume tzoff */ +- tzoff = atoi(val); ++ tzoff = atol(val); + } else if (token != SEMI) { + skip_token(&val, NULL, cfile); + parse_warn(cfile, diff --git a/dhcp.spec b/dhcp.spec index 46cc065ca221ee089d72ad492bbbb9397c82bd11..485a707700c3042ef2749340aa681ea005f1c0b4 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,7 +3,7 @@ Name: dhcp Version: 4.4.2 -Release: 2 +Release: 3 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 @@ -52,6 +52,7 @@ Patch29: bugfix-reduce-getifaddr-calls.patch Patch30: bugfix-dhcpd-2038-problem.patch Patch31: dhcpd-coredump-infiniband.patch Patch32: bugfix-dhclient-check-if-pid-was-held.patch +Patch33: bugfix-dhcp-64-bit-lease-parse.patch BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel bind-export-devel BuildRequires: systemd systemd-devel @@ -290,6 +291,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Tue Dec 29 2020 quanhongfei - 4.4.2-3 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:fix dhcp 64_bit lease parse + * Thu Sep 10 2020 gaihuiying - 4.4.2-2 - Type:bugfix - ID:NA