From a1a1eac515036c73687189ecd1d8272628209fd1 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Mar 14 2014 19:38:45 +0000 Subject: - Fixing sysctl line length limit (#1071530) --- diff --git a/procps-ng.spec b/procps-ng.spec index 78fbf77..49b5527 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -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 - 3.3.9-7 +- Fixing sysctl line length limit (#1071530) + * Thu Feb 27 2014 Jaromir Capik - 3.3.9-6 - Subtracting Shmem from Cached (#1070736) diff --git a/sysctl-linelen-signed.patch b/sysctl-linelen-signed.patch new file mode 100644 index 0000000..e2e3713 --- /dev/null +++ b/sysctl-linelen-signed.patch @@ -0,0 +1,34 @@ +From: Sami Farin +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 + +--- 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;