Fix parsing of /etc/sysconfig/clock when ZONE has spaces. (#828291)

This commit is contained in:
Jeff Law 2012-06-07 11:54:50 -06:00
parent b63a792795
commit e20289d31a

View File

@ -28,7 +28,7 @@
Summary: The GNU libc libraries Summary: The GNU libc libraries
Name: glibc Name: glibc
Version: %{glibcversion} Version: %{glibcversion}
Release: 9%{?dist} Release: 10%{?dist}
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs # Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@ -1067,8 +1067,9 @@ fd = io.open("/etc/sysconfig/clock")
if not fd then return end if not fd then return end
zonename = nil zonename = nil
for l in fd:lines() do for l in fd:lines() do
zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^ \t\n\"]*)"); zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^\t\n\"]*)");
if zone then if zone then
zone = string.gsub (zone, " ", "_")
zonename = "/usr/share/zoneinfo/" .. zone zonename = "/usr/share/zoneinfo/" .. zone
break break
end end
@ -1105,8 +1106,9 @@ fd = io.open("/etc/sysconfig/clock")
if not fd then return end if not fd then return end
zonename = nil zonename = nil
for l in fd:lines() do for l in fd:lines() do
zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^ \t\n\"]*)"); zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^\t\n\"]*)");
if zone then if zone then
zone = string.gsub (zone, " ", "_")
zonename = "/usr/share/zoneinfo/" .. zone zonename = "/usr/share/zoneinfo/" .. zone
break break
end end
@ -1285,6 +1287,9 @@ rm -f *.filelist*
%endif %endif
%changelog %changelog
* Thu Jun 7 2012 Jeff Law <law@redhat.com> - 2.15.90-10
- Fix parsing of /etc/sysconfig/clock when ZONE has spaces. (#828291)
* Tue Jun 5 2012 Jeff Law <law@redhat.com> - 2.15.90-9 * Tue Jun 5 2012 Jeff Law <law@redhat.com> - 2.15.90-9
- Resync with upstream sources, drop unnecessary patches. - Resync with upstream sources, drop unnecessary patches.
- Fix DoS in RPC implementation (#767693) - Fix DoS in RPC implementation (#767693)