]> granicus.if.org Git - procps-ng/commitdiff
sysctl: increase max supported line length of the conf file
authorSami Farin <hvtaifwkbgefbaei@gmail.com>
Fri, 14 Mar 2014 06:00:00 +0000 (00:00 -0600)
committerJaromir Capik <jcapik@redhat.com>
Fri, 14 Mar 2014 17:55:14 +0000 (18:55 +0100)
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>
sysctl.c

index 51af15dcc6f9b59f01e27b19132cab64f3d06186..fc224e5d74c71e4a9ae93d0dfb6f38d046d36bbb 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -483,14 +483,16 @@ static int pattern_match(const char *string, const char *pat)
        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;