changeset 508:d4bbc0039008

- Set a default path, since bash won't export one otherwise (though it will set one, leading to mysterious problems) - Rearrange some options
author Matt Johnston <matt@ucc.asn.au>
date Wed, 05 Nov 2008 13:30:23 +0000
parents ada77f43c79a
children 4e251543b941
files options.h svr-chansession.c
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/options.h	Wed Nov 05 13:14:38 2008 +0000
+++ b/options.h	Wed Nov 05 13:30:23 2008 +0000
@@ -60,20 +60,24 @@
 #define ENABLE_CLI_LOCALTCPFWD
 #define ENABLE_CLI_REMOTETCPFWD
 
-/* Allow using -J <proxycommand> to run the connection through a 
-   pipe to a program, rather the normal TCP connection */
-#define ENABLE_CLI_PROXYCMD
-
 #define ENABLE_SVR_LOCALTCPFWD
 #define ENABLE_SVR_REMOTETCPFWD
 
 /* Enable Authentication Agent Forwarding - server only for now */
 #define ENABLE_AGENTFWD
 
-/* Enable "Netcat mode". TODO describe here. */
+
+/* Note: Both ENABLE_CLI_PROXYCMD and ENABLE_CLI_NETCAT must be set to
+ * allow multihop dbclient connections */
+
+/* Allow using -J <proxycommand> to run the connection through a 
+   pipe to a program, rather the normal TCP connection */
+#define ENABLE_CLI_PROXYCMD
+
+/* Enable "Netcat mode" option. This will forward standard input/output
+ * to a remote TCP-forwarded connection */
 #define ENABLE_CLI_NETCAT
 
-
 /* Encryption - at least one required.
  * Protocol RFC requires 3DES and recommends AES128 for interoperability.
  * Including multiple keysize variants the same cipher 
@@ -254,6 +258,9 @@
 be overridden at runtime with -K. 0 disables keepalives */
 #define DEFAULT_KEEPALIVE 0
 
+/* The default path. This will often get replaced by the shell */
+#define DEFAULT_PATH "/bin:/usr/bin"
+
 /* Some other defines (that mostly should be left alone) are defined
  * in sysoptions.h */
 #include "sysoptions.h"
--- a/svr-chansession.c	Wed Nov 05 13:14:38 2008 +0000
+++ b/svr-chansession.c	Wed Nov 05 13:30:23 2008 +0000
@@ -878,6 +878,7 @@
 	addnewvar("LOGNAME", ses.authstate.pw_name);
 	addnewvar("HOME", ses.authstate.pw_dir);
 	addnewvar("SHELL", get_user_shell());
+	addnewvar("PATH", DEFAULT_PATH);
 	if (chansess->term != NULL) {
 		addnewvar("TERM", chansess->term);
 	}