summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-07-05 23:59:45 +0000
committerDarren Tucker <dtucker@dtucker.net>2020-07-15 15:07:42 +1000
commit6d755706a0059eb9e2d63517f288b75cbc3b4701 (patch)
treeadb003b1adcea270f4480baa4ff83d495b3478f3 /session.c
parentb0c1e8384d5e136ebdf895d1434aea7dd8661a1c (diff)
upstream: some language improvements; ok markus
OpenBSD-Commit-ID: 939d787d571b4d5da50b3b721fd0b2ac236acaa8
Diffstat (limited to 'session.c')
-rw-r--r--session.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/session.c b/session.c
index 84d3286c4..ede983564 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.322 2020/07/03 07:02:37 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.323 2020/07/05 23:59:45 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -644,7 +644,7 @@ do_exec_pty(struct ssh *ssh, Session *s, const char *command)
644 644
645 s->pid = pid; 645 s->pid = pid;
646 646
647 /* Parent. Close the slave side of the pseudo tty. */ 647 /* Parent. Close the child side of the pseudo tty. */
648 close(ttyfd); 648 close(ttyfd);
649 649
650 /* Enter interactive session. */ 650 /* Enter interactive session. */
@@ -843,12 +843,12 @@ check_quietlogin(Session *s, const char *command)
843 * into the environment. If the file does not exist, this does nothing. 843 * into the environment. If the file does not exist, this does nothing.
844 * Otherwise, it must consist of empty lines, comments (line starts with '#') 844 * Otherwise, it must consist of empty lines, comments (line starts with '#')
845 * and assignments of the form name=value. No other forms are allowed. 845 * and assignments of the form name=value. No other forms are allowed.
846 * If whitelist is not NULL, then it is interpreted as a pattern list and 846 * If allowlist is not NULL, then it is interpreted as a pattern list and
847 * only variable names that match it will be accepted. 847 * only variable names that match it will be accepted.
848 */ 848 */
849static void 849static void
850read_environment_file(char ***env, u_int *envsize, 850read_environment_file(char ***env, u_int *envsize,
851 const char *filename, const char *whitelist) 851 const char *filename, const char *allowlist)
852{ 852{
853 FILE *f; 853 FILE *f;
854 char *line = NULL, *cp, *value; 854 char *line = NULL, *cp, *value;
@@ -881,8 +881,8 @@ read_environment_file(char ***env, u_int *envsize,
881 */ 881 */
882 *value = '\0'; 882 *value = '\0';
883 value++; 883 value++;
884 if (whitelist != NULL && 884 if (allowlist != NULL &&
885 match_pattern_list(cp, whitelist, 0) != 1) 885 match_pattern_list(cp, allowlist, 0) != 1)
886 continue; 886 continue;
887 child_set_env(env, envsize, cp, value); 887 child_set_env(env, envsize, cp, value);
888 } 888 }
@@ -1111,10 +1111,10 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
1111 cp = strchr(ocp, '='); 1111 cp = strchr(ocp, '=');
1112 if (*cp == '=') { 1112 if (*cp == '=') {
1113 *cp = '\0'; 1113 *cp = '\0';
1114 /* Apply PermitUserEnvironment whitelist */ 1114 /* Apply PermitUserEnvironment allowlist */
1115 if (options.permit_user_env_whitelist == NULL || 1115 if (options.permit_user_env_allowlist == NULL ||
1116 match_pattern_list(ocp, 1116 match_pattern_list(ocp,
1117 options.permit_user_env_whitelist, 0) == 1) 1117 options.permit_user_env_allowlist, 0) == 1)
1118 child_set_env(&env, &envsize, 1118 child_set_env(&env, &envsize,
1119 ocp, cp + 1); 1119 ocp, cp + 1);
1120 } 1120 }
@@ -1127,7 +1127,7 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
1127 snprintf(buf, sizeof buf, "%.200s/.ssh/environment", 1127 snprintf(buf, sizeof buf, "%.200s/.ssh/environment",
1128 pw->pw_dir); 1128 pw->pw_dir);
1129 read_environment_file(&env, &envsize, buf, 1129 read_environment_file(&env, &envsize, buf,
1130 options.permit_user_env_whitelist); 1130 options.permit_user_env_allowlist);
1131 } 1131 }
1132 1132
1133#ifdef USE_PAM 1133#ifdef USE_PAM