Display correct error message when "Server{UID|GID}" is invalid

This partly closes bug #118. ngIRCd still starts up even when
Server{UID|GID} is invalid: then the daemon falls back to "nobody"
when running with root(0) privileges (as before).
This commit is contained in:
Alexander Barton 2012-01-03 20:37:41 +01:00
parent e4006a93e3
commit edab86e0f8
1 changed files with 6 additions and 2 deletions

View File

@ -1308,7 +1308,9 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
else { else {
Conf_GID = (unsigned int)atoi(Arg); Conf_GID = (unsigned int)atoi(Arg);
if (!Conf_GID && strcmp(Arg, "0")) if (!Conf_GID && strcmp(Arg, "0"))
Config_Error_NaN(Line, Var); Config_Error(LOG_WARNING,
"%s, line %d: Value of \"%s\" is not a valid group name or ID!",
NGIRCd_ConfFile, Line, Var);
} }
return; return;
} }
@ -1319,7 +1321,9 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
else { else {
Conf_UID = (unsigned int)atoi(Arg); Conf_UID = (unsigned int)atoi(Arg);
if (!Conf_UID && strcmp(Arg, "0")) if (!Conf_UID && strcmp(Arg, "0"))
Config_Error_NaN(Line, Var); Config_Error(LOG_WARNING,
"%s, line %d: Value of \"%s\" is not a valid user name or ID!",
NGIRCd_ConfFile, Line, Var);
} }
return; return;
} }