diff options
Diffstat (limited to 'utils/login.c')
-rw-r--r-- | utils/login.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/utils/login.c b/utils/login.c index 7f93e6fe..8dd40103 100644 --- a/utils/login.c +++ b/utils/login.c @@ -178,7 +178,8 @@ add_utmp_entry (char *args, unsigned args_len, int tty_fd, int inherit_host) { struct utmp utmp; char bogus_tty[sizeof (_PATH_TTY) + 2]; - char *tty = ttyname (0), *host; + char *tty = ttyname (0); + char const *host; if (! tty) { @@ -263,7 +264,8 @@ main(int argc, char *argv[]) { int i; io_t node; - char *arg, *path; + char const *arg; + char *path; error_t err = 0; char *args = 0; /* The login parameters */ unsigned args_len = 0; @@ -334,7 +336,7 @@ main(int argc, char *argv[]) { int retry_argc; char **retry_argv; - char *via = envz_get (args, args_len, "VIA"); + char const *via = envz_get (args, args_len, "VIA"); error (retry ? 0 : code, err, fmt, str); /* May exit... */ @@ -471,7 +473,8 @@ main(int argc, char *argv[]) case ARGP_KEY_ARG: if (state->arg_num > 0) { - err = argz_create (state->argv + state->next - 1, + err = argz_create ((char *const **)(state->argv + + state->next - 1), &sh_args, &sh_args_len); state->next = state->argc; /* Consume all args */ if (err) @@ -596,9 +599,9 @@ main(int argc, char *argv[]) } /* Put in certain last-ditch defaults. */ - err = argz_create (default_args, &args_defs, &args_defs_len); + err = argz_create ((char *const **)default_args, &args_defs, &args_defs_len); if (! err) - err = argz_create (default_env, &env_defs, &env_defs_len); + err = argz_create ((char *const **)default_env, &env_defs, &env_defs_len); if (! err) /* Set the default path using confstr() if possible. */ { @@ -614,7 +617,7 @@ main(int argc, char *argv[]) if (err) error (23, err, "adding defaults"); - err = argz_create (environ, &parent_env, &parent_env_len); + err = argz_create ((char *const **)environ, &parent_env, &parent_env_len); /* Parse our options. */ argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, 0); @@ -659,14 +662,14 @@ main(int argc, char *argv[]) if (! no_login) { - char *user = envz_get (args, args_len, "USER"); + char const *user = envz_get (args, args_len, "USER"); if (user && *user) setlogin (user); proc_make_login_coll (proc_server); } if (eff_uids->num > 0) - proc_setowner (proc_server, eff_uids->ids[0]); + proc_setowner (proc_server, eff_uids->ids[0], 0); /* XXX else clear the owner, once there's a proc call to do it. */ /* Now start constructing the exec arguments. */ |