MINOR: cfgparse: warn when gid parameter is not a number
Currently, no warning are emitted when the gid is not a number.
Purpose of this warning is to let admins know they their configuration
won't be applied as expected.
(cherry picked from commit 776e518caf10cc76a19278f67800082cfe058723)
(cherry picked from commit baae1475c29f3a3ebd41823a6ea8b215f89a3eb8)
diff --git a/src/cfgparse.c b/src/cfgparse.c
index fff95e1..c79ddc2 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -913,7 +913,11 @@
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- global.gid = atol(args[1]);
+ if (strl2irc(args[1], strlen(args[1]), &global.gid) != 0) {
+ Warning("parsing [%s:%d] : gid: string '%s' is not a number.\n | You might want to use the 'group' parameter to use a system group name.\n", file, linenum, args[1]);
+ err_code |= ERR_WARN;
+ goto out;
+ }
}
/* user/group name handling */
else if (!strcmp(args[0], "user")) {