Blame SOURCES/smartmontools-7.2-capnotify.patch

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