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

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