Blob Blame History Raw
Index: openssh-9.9p1/session.c
===================================================================
--- openssh-9.9p1.orig/session.c
+++ openssh-9.9p1/session.c
@@ -2037,6 +2037,8 @@ session_pty_req(struct ssh *ssh, Session
 		return 0;
 	}
 	debug("session_pty_req: session %d alloc %s", s->self, s->tty);
+	verbose("Allocated pty %s for user %s session %d",
+					s->tty, s->pw->pw_name, s->self);
 
 	ssh_tty_parse_modes(ssh, s->ttyfd);
 
@@ -2139,7 +2141,7 @@ session_shell_req(struct ssh *ssh, Sessi
 		sshpkt_fatal(ssh, r, "%s: parse packet", __func__);
 
 	channel_set_xtype(ssh, s->chanid, "session:shell");
-
+	verbose("Shell Request for user %s", s->pw->pw_name);
 	return do_exec(ssh, s, NULL) == 0;
 }
 
@@ -2156,6 +2158,7 @@ session_exec_req(struct ssh *ssh, Sessio
 
 	channel_set_xtype(ssh, s->chanid, "session:command");
 	slog_set_command(command);
+	verbose("Exec Request for user %s with command %s", s->pw->pw_name, command);
 	success = do_exec(ssh, s, command) == 0;
 	free(command);
 	return success;
Index: openssh-9.9p1/regress/session-req.sh
===================================================================
--- /dev/null
+++ openssh-9.9p1/regress/session-req.sh
@@ -0,0 +1,39 @@
+tid="session req"
+
+start_sshd
+
+test_user_shell_exec_req() {
+  session_shell_req_expected="Exec Request for user $USER with command true"
+  cnt=$(grep -c "$session_shell_req_expected" "$TEST_SSHD_LOGFILE")
+  if [ $cnt == "0" ]; then
+  	fail "No exec request for user log lines found"
+  fi
+}
+
+test_user_pty() {
+  session_pty_req_expected="Allocated pty .* for user $USER session .*"
+  line_count=$(grep -c "$session_req_expected" "$TEST_SSHD_LOGFILE")
+  if [ $line_count == "0" ]; then
+  	fail "No Allocated pty for user session found in log lines"
+  fi
+}
+
+test_user_shell_req() {
+  exit | ${SSH} -F $OBJ/ssh_config somehost
+  if [ $? -ne 0 ]; then
+  	fail "ssh connect with failed"
+  fi
+  session_shell_req_expected="Shell Request for user $USER"
+  line_count=$(grep -c "$session_shell_req_expected" "$TEST_SSHD_LOGFILE")
+  if [ $line_count == "0" ]; then
+  	fail "No session request for user log lines found"
+  fi
+}
+
+${SSH} -F $OBJ/ssh_config somehost true
+if [ $? -ne 0 ]; then
+	fail "ssh connect with failed"
+fi
+test_user_shell_exec_req
+test_user_pty
+test_user_shell_req