libreport/0000-lib-Seek-beginning-of-mountinfo-file.patch
2023-02-27 14:09:00 -05:00

35 lines
1000 B
Diff

From c767c5b858c88aa9fad0ca3aa80e5fd18c6d830d Mon Sep 17 00:00:00 2001
From: Matej Marusak <mmarusak@redhat.com>
Date: Tue, 4 Dec 2018 09:38:32 +0100
Subject: [PATCH 0/2] lib: Seek beginning of mountinfo file
Signed-off-by: Matej Marusak <mmarusak@redhat.com>
(cherry picked from commit c8afd2847f59278faac8d12c150db1d29f7ad622)
---
src/lib/get_cmdline.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lib/get_cmdline.c b/src/lib/get_cmdline.c
index 83c2fb45..49d419d5 100644
--- a/src/lib/get_cmdline.c
+++ b/src/lib/get_cmdline.c
@@ -905,6 +905,7 @@ int process_has_own_root_at(int pid_proc_fd)
close(mnt_fd);
return r;
}
+ fseek(fin, 0, SEEK_SET);
r = get_mountinfo_for_mount_point(fin, &pid_root, "/");
fclose(fin);
@@ -925,6 +926,7 @@ int process_has_own_root_at(int pid_proc_fd)
return r;
}
+ fseek(fin, 0, SEEK_SET);
r = get_mountinfo_for_mount_point(fin, &system_root, "/");
fclose(fin);
if (r)
--
2.21.0