| 1 |
Description: Be quiet on access error |
| 2 |
SNMP agents can legitimately be not allowed to access mount points, such as |
| 3 |
trying to get to things under /run/user. This patch changes a EACCES error to |
| 4 |
a debug message. |
| 5 |
Author: Craig Small <[email protected]> |
| 6 |
Origin: Debian |
| 7 |
Bug-Debian: https://bugs.debian.org/792832 |
| 8 |
Reviewed-by: Craig Small <[email protected]> |
| 9 |
Last-Update: 2025-12-23 |
| 10 |
--- a/agent/mibgroup/hardware/fsys/fsys_mntent.c |
| 11 |
+++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c |
| 12 |
@@ -6,6 +6,7 @@ |
| 13 |
#include "hardware/fsys/hw_fsys_private.h" |
| 14 |
|
| 15 |
#include <stdio.h> |
| 16 |
+#include <errno.h> |
| 17 |
#ifdef HAVE_MNTENT_H |
| 18 |
#include <mntent.h> |
| 19 |
#endif |
| 20 |
@@ -321,7 +322,10 @@ |
| 21 |
|
| 22 |
if (!logged && |
| 23 |
asprintf(&tmpbuf, "Cannot statfs %s", entry->path) >= 0) { |
| 24 |
- snmp_log_perror(tmpbuf); |
| 25 |
+ if (errno == EACCES) |
| 26 |
+ DEBUGMSGTL(("fsys", "%s\n", tmpbuf)); |
| 27 |
+ else |
| 28 |
+ snmp_log_perror(tmpbuf); |
| 29 |
free(tmpbuf); |
| 30 |
logged = 1; |
| 31 |
} |