Additional check for bad setting values for rlimit settings.
authorDavin McCall <davmac@davmac.org>
Fri, 28 Jun 2019 10:28:05 +0000 (20:28 +1000)
committerDavin McCall <davmac@davmac.org>
Fri, 28 Jun 2019 10:28:05 +0000 (20:28 +1000)
src/load-service.cc

index 0134acdcd285fe2f853a2e8b74747e53949b7770..c7eb422d430bf8183ba40b79b5734ab59357bc03 100644 (file)
@@ -258,6 +258,9 @@ static void parse_rlimit(const std::string &line, const std::string &service_nam
 
         if (*index == '-') {
             rlimit.limits.rlim_max = RLIM_INFINITY;
+            if (index[1] != 0) {
+                throw service_description_exc(service_name, std::string("Bad value for ") + param_name);
+            }
         }
         else {
             char *hard_start = index;