diff common-session.c @ 482:7ad49f34a122

- Add run_shell_command() function to run a "sh -c" command, handling lots of the work that exechild did (and can be shared by client -J option)
author Matt Johnston <matt@ucc.asn.au>
date Mon, 15 Sep 2008 14:04:55 +0000
parents e3db1f7a2e43
children 738313e73b1c
line wrap: on
line diff
--- a/common-session.c	Mon Sep 15 13:41:18 2008 +0000
+++ b/common-session.c	Mon Sep 15 14:04:55 2008 +0000
@@ -414,3 +414,12 @@
 		ret = MIN(opts.keepalive_secs, ret);
 	return ret;
 }
+
+const char* get_user_shell() {
+	/* an empty shell should be interpreted as "/bin/sh" */
+	if (ses.authstate.pw_shell[0] == '\0') {
+		return "/bin/sh";
+	} else {
+		return ses.authstate.pw_shell;
+	}
+}