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

40 lines
1.1 KiB
Diff

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