[pkg-nagios-changes] [Git][nagios-team/monitoring-plugins][experimental] 2 commits: Adding d/p/22_check_disk_avoid_mount from upstream

Jan Wagner (@waja) gitlab at salsa.debian.org
Tue May 23 09:05:13 BST 2023



Jan Wagner pushed to branch experimental at Debian Nagios Maintainer Group / monitoring-plugins


Commits:
7cbe4b61 by Jan Wagner at 2023-05-23T09:49:23+02:00
Adding d/p/22_check_disk_avoid_mount from upstream

- - - - -
01be8ce8 by Jan Wagner at 2023-05-23T10:04:36+02:00
d/p/series: Fix typo

- - - - -


2 changed files:

- + debian/patches/22_check_disk_avoid_mount
- debian/patches/series


Changes:

=====================================
debian/patches/22_check_disk_avoid_mount
=====================================
@@ -0,0 +1,47 @@
+From 0dd11100aa92bab172293ec9615a8a56b0e35ee6 Mon Sep 17 00:00:00 2001
+From: Stefan Taferner <stefan.taferner at porscheinformatik.com>
+Date: Wed, 10 May 2023 19:28:05 +0200
+Subject: [PATCH] avoid mounting when searching for matching mount points
+
+---
+ lib/utils_disk.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/lib/utils_disk.c b/lib/utils_disk.c
+index 468769b19..582d3ea17 100644
+--- a/lib/utils_disk.c
++++ b/lib/utils_disk.c
+@@ -147,24 +147,25 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list
+ 
+       /* set best match if path name exactly matches a mounted device name */
+       for (me = mount_list; me; me = me->me_next) {
+-	if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) < 0)
+-	  continue; /* skip if permissions do not suffice for accessing device */
+-        if (strcmp(me->me_devname, d->name)==0)
+-          best_match = me;
++        if (strcmp(me->me_devname, d->name)==0) {
++          if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) {
++            best_match = me;
++          }
++        }
+       }
+ 
+       /* set best match by directory name if no match was found by devname */
+       if (! best_match) {
+         for (me = mount_list; me; me = me->me_next) {
+-	  if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) < 0)
+-	    continue; /* skip if permissions do not suffice for accessing device */
+           size_t len = strlen (me->me_mountdir);
+           if ((exact == FALSE && (best_match_len <= len && len <= name_len &&
+              (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0)))
+              || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0))
+           {
+-            best_match = me;
+-            best_match_len = len;
++            if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) {
++              best_match = me;
++              best_match_len = len;
++            }
+           }
+         }
+       }


=====================================
debian/patches/series
=====================================
@@ -10,9 +10,10 @@
 16_check_snmp_disable_multiplier_when_unused
 17_fix_exit_codes
 18_check_mysql_fix_typo
-19_check_nwstat_fix_typ
+19_check_nwstat_fix_typo
 20_chech_nt_fix_encoding
 21_check_pgsql_extra_output
+22_check_disk_avoid_mount
 # feature patches
 30_check_radius_radcli_1.3.1_support
 31_checl_mailq_separate_submission_queue



View it on GitLab: https://salsa.debian.org/nagios-team/monitoring-plugins/-/compare/3da21634e793f9b34c9df33d2d60a7baf2f3f39f...01be8ce8fe51a2c13e0fb03bf3cc2996882eaafc

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/monitoring-plugins/-/compare/3da21634e793f9b34c9df33d2d60a7baf2f3f39f...01be8ce8fe51a2c13e0fb03bf3cc2996882eaafc
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20230523/a7bec117/attachment-0001.htm>


More information about the pkg-nagios-changes mailing list