| 1 | Descriptionscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#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 | Authorscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#Author.: Craig Small <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 6 | Originscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#Origin.: Debian |
| 7 | Bug-Debianscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#Bug-Debian.: https://bugs.debian.org/792832scip-debian-bts debian-bts . . 792832: |
| 8 | Reviewed-byscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#Reviewed-by.: Craig Small <[email protected]> |
| 9 | Last-Updatescip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/patches/agent_silent_eacces#Last-Update.: 2025-12-23 |
| 10 | --- a/agent/mibgroup/hardware/fsys/fsys_mntent.cscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/upstream/`agent/mibgroup/hardware/fsys/fsys_mntent.c`: |
| 11 | +++ b/agent/mibgroup/hardware/fsys/fsys_mntent.cscip-debian debian net-snmp 5.9.5.2+dfsg-2.1 net-snmp/upstream/`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 | } |