diff options
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1,7 +1,10 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "git-compat-util.h" #include "abspath.h" #include "config.h" #include "environment.h" +#include "gettext.h" #include "path.h" #include "pkt-line.h" #include "protocol.h" @@ -1175,13 +1178,13 @@ static int service_loop(struct socketlist *socklist) struct credentials; -static void drop_privileges(struct credentials *cred) +static void drop_privileges(struct credentials *cred UNUSED) { /* nothing */ } -static struct credentials *prepare_credentials(const char *user_name, - const char *group_name) +static struct credentials *prepare_credentials(const char *user_name UNUSED, + const char *group_name UNUSED) { die("--user not supported on this platform"); } @@ -1306,17 +1309,20 @@ int cmd_main(int argc, const char **argv) continue; } if (skip_prefix(arg, "--timeout=", &v)) { - timeout = atoi(v); + if (strtoul_ui(v, 10, &timeout)) + die(_("invalid timeout '%s', expecting a non-negative integer"), v); continue; } if (skip_prefix(arg, "--init-timeout=", &v)) { - init_timeout = atoi(v); + if (strtoul_ui(v, 10, &init_timeout)) + die(_("invalid init-timeout '%s', expecting a non-negative integer"), v); continue; } if (skip_prefix(arg, "--max-connections=", &v)) { - max_connections = atoi(v); + if (strtol_i(v, 10, &max_connections)) + die(_("invalid max-connections '%s', expecting an integer"), v); if (max_connections < 0) - max_connections = 0; /* unlimited */ + max_connections = 0; /* unlimited */ continue; } if (!strcmp(arg, "--strict-paths")) { |