- Fixing sysctl line length limit (#1071530)

This commit is contained in:
Jaromir Capik 2014-03-14 20:38:45 +01:00
parent f3eed83b00
commit a1a1eac515
2 changed files with 40 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Summary: System and process monitoring utilities
Name: procps-ng
Version: 3.3.9
Release: 6%{?dist}
Release: 7%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
Group: Applications/System
URL: https://sourceforge.net/projects/procps-ng/
@ -17,6 +17,7 @@ Patch2: vmstat-timestamps.patch
Patch3: watch-fd-leak.patch
Patch4: vmstat-format-security.patch
Patch5: subtract-shmem-from-cached.patch
Patch6: sysctl-linelen-signed.patch
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -86,6 +87,7 @@ System and process monitoring utilities development headers
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
@ -155,6 +157,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%{_includedir}/proc
%changelog
* Fri Mar 14 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-7
- Fixing sysctl line length limit (#1071530)
* Thu Feb 27 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-6
- Subtracting Shmem from Cached (#1070736)

View File

@ -0,0 +1,34 @@
From: Sami Farin <hvtaifwkbgefbaei@gmail.com>
Date: Fri, 14 Mar 2014 00:00:00 -0600
Subject: [PATCH] sysctl: increase max supported line length of the conf file
I ran into this limit with net.ipv4.ip_local_reserved_ports ,
sysctl complained about the line after the long line, further
slowing down my error hunting.
Due to fgets usage, increase buffer size to 4096 chars with
minimum amount of code changes.
Signed-off-by: Sami Farin <hvtaifwkbgefbaei@gmail.com>
--- a/sysctl.c 2013-10-11 02:04:36.000000000 +0300
+++ b/sysctl.c 2014-03-01 12:47:47.629400962 +0200
@@ -483,14 +483,16 @@ static int pattern_match(const char *str
return (1);
}
+#define LINELEN 4096
+
/*
* Preload the sysctl's from the conf file. We parse the file and then
* reform it (strip out whitespace).
*/
static int Preload(const char *restrict const filename)
{
- char oneline[256];
- char buffer[256];
+ char oneline[LINELEN];
+ char buffer[LINELEN];
FILE *fp;
char *t;
int n = 0;