Blame SOURCES/smartmontools-7.2-capnotify.patch

289471
diff -up smartmontools-7.2/smartd.cpp.capnotify smartmontools-7.2/smartd.cpp
289471
--- smartmontools-7.2/smartd.cpp.capnotify	2020-11-23 19:25:16.000000000 +0100
289471
+++ smartmontools-7.2/smartd.cpp	2021-06-16 12:06:03.985526022 +0200
289471
@@ -1020,6 +1020,8 @@ static void capabilities_drop_now()
289471
   capng_clear(CAPNG_SELECT_BOTH);
289471
   capng_updatev(CAPNG_ADD, (capng_type_t)(CAPNG_EFFECTIVE|CAPNG_PERMITTED),
289471
     CAP_SYS_ADMIN, CAP_MKNOD, CAP_SYS_RAWIO, -1);
289471
+  capng_updatev(CAPNG_ADD, (capng_type_t)(CAPNG_BOUNDING_SET),
289471
+    CAP_SETGID, CAP_SETUID, CAP_CHOWN, CAP_FOWNER, CAP_DAC_OVERRIDE, -1);
289471
   capng_apply(CAPNG_SELECT_BOTH);
289471
 }
289471
 
289471
@@ -1030,9 +1032,8 @@ static void capabilities_check_config(de
289471
   for (unsigned i = 0; i < configs.size(); i++) {
289471
     dev_config & cfg = configs[i];
289471
     if (!cfg.emailaddress.empty() || !cfg.emailcmdline.empty()) {
289471
-      PrintOut(LOG_INFO, "Device: %s, --capabilites is set, mail will be suppressed.\n",
289471
+      PrintOut(LOG_INFO, "Device: %s, --capabilites is set, mail notification may not work.\n",
289471
                cfg.name.c_str());
289471
-      cfg.emailaddress.clear(); cfg.emailcmdline.clear();
289471
     }
289471
   }
289471
 }
289471
@@ -1633,7 +1634,7 @@ static void Usage()
289471
 #ifdef HAVE_LIBCAP_NG
289471
   PrintOut(LOG_INFO,"  -C, --capabilities\n");
289471
   PrintOut(LOG_INFO,"        Drop unneeded Linux process capabilities.\n"
289471
-                    "        Warning: Mail notification does not work when used.\n\n");
289471
+                    "        Warning: Mail notification may not work when used.\n\n");
289471
 #endif
289471
   PrintOut(LOG_INFO,"  -d, --debug\n");
289471
   PrintOut(LOG_INFO,"        Start smartd in debug mode\n\n");