version 1.77, 2019/09/14 17:47:01 |
version 1.78, 2019/12/04 09:51:09 |
|
|
if (pwd == NULL) |
if (pwd == NULL) |
auth_errx(as, 1, "who are you?"); |
auth_errx(as, 1, "who are you?"); |
if ((username = strdup(pwd->pw_name)) == NULL) |
if ((username = strdup(pwd->pw_name)) == NULL) |
auth_errx(as, 1, "can't allocate memory"); |
auth_err(as, 1, NULL); |
if (asme && !altshell) { |
if (asme && !altshell) { |
if (pwd->pw_shell && *pwd->pw_shell) { |
if (pwd->pw_shell && *pwd->pw_shell) { |
if ((shell = strdup(pwd->pw_shell)) == NULL) |
if ((shell = strdup(pwd->pw_shell)) == NULL) |
auth_errx(as, 1, "can't allocate memory"); |
auth_err(as, 1, NULL); |
} else { |
} else { |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
iscsh = NO; |
iscsh = NO; |
|
|
auth_clean(as); |
auth_clean(as); |
if (auth_setitem(as, AUTHV_INTERACTIVE, "True") != 0 || |
if (auth_setitem(as, AUTHV_INTERACTIVE, "True") != 0 || |
auth_setitem(as, AUTHV_NAME, user) != 0) |
auth_setitem(as, AUTHV_NAME, user) != 0) |
auth_errx(as, 1, "can't allocate memory"); |
auth_err(as, 1, NULL); |
if ((user = auth_getitem(as, AUTHV_NAME)) == NULL) |
if ((user = auth_getitem(as, AUTHV_NAME)) == NULL) |
auth_errx(as, 1, "internal error"); |
auth_errx(as, 1, "internal error"); |
if (auth_setpwd(as, NULL) || (pwd = auth_getpwd(as)) == NULL) { |
if (auth_setpwd(as, NULL) || (pwd = auth_getpwd(as)) == NULL) { |
|
|
} |
} |
fprintf(stderr, "Login incorrect\n"); |
fprintf(stderr, "Login incorrect\n"); |
} |
} |
|
if (pwd == NULL) |
|
auth_errx(as, 1, "internal error"); |
|
|
if (pledge("stdio unveil rpath getpw exec id", NULL) == -1) |
if (pledge("stdio unveil rpath getpw exec id", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |
|
|
auth_errx(as, 1, "permission denied (shell)."); |
auth_errx(as, 1, "permission denied (shell)."); |
} else if (pwd->pw_shell && *pwd->pw_shell) { |
} else if (pwd->pw_shell && *pwd->pw_shell) { |
if ((shell = strdup(pwd->pw_shell)) == NULL) |
if ((shell = strdup(pwd->pw_shell)) == NULL) |
auth_errx(as, 1, "can't allocate memory"); |
auth_err(as, 1, NULL); |
iscsh = UNSET; |
iscsh = UNSET; |
} else { |
} else { |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |