Blame SOURCES/fapolicyd-cli-big-buffer.patch

037a42
From 98768e7d2b3736a7924d8e17de206fd25071e395 Mon Sep 17 00:00:00 2001
037a42
From: Steve Grubb <sgrubb@redhat.com>
037a42
Date: Tue, 2 Jun 2020 17:11:19 -0400
037a42
Subject: [PATCH] Make fapolicyd-cli buffer bigger for rule listing
037a42
037a42
---
037a42
 ChangeLog               | 2 ++
037a42
 src/cli/fapolicyd-cli.c | 5 +++--
037a42
 2 files changed, 5 insertions(+), 2 deletions(-)
037a42
037a42
diff --git a/src/cli/fapolicyd-cli.c b/src/cli/fapolicyd-cli.c
037a42
index feb9e71..8783547 100644
037a42
--- a/src/cli/fapolicyd-cli.c
037a42
+++ b/src/cli/fapolicyd-cli.c
037a42
@@ -41,6 +41,7 @@
037a42
 #include "database.h"
037a42
 #include "file-backend.h"
037a42
 #include "fapolicyd-backend.h"
037a42
+#include "string-util.h"
037a42
 
037a42
 
037a42
 static const char *usage =
037a42
@@ -318,14 +319,14 @@ static int do_ftype(const char *path)
037a42
 static int do_list(void)
037a42
 {
037a42
 	unsigned count = 1, lineno = 0;
037a42
-	char buf[160];
037a42
+	char buf[BUFFER_MAX+1];
037a42
 	FILE *f = fopen(RULES_FILE, "rm");
037a42
 	if (f == NULL) {
037a42
 		fprintf(stderr, "Cannot open rules file (%s)\n",
037a42
 						strerror(errno));
037a42
 		return 1;
037a42
 	}
037a42
-	while (get_line(f, buf, sizeof(buf), &lineno)) {
037a42
+	while (get_line(f, buf, BUFFER_MAX, &lineno)) {
037a42
 		char *str = buf;
037a42
 		lineno++;
037a42
 		while (*str) {