This patch preserves the "SSH_ORIGINAL_COMMAND" functionality of the
DataFellows ssh. It essentially sets the environment variable
"SSH_ORIGINAL_COMMAND" to the original command line passed to an sshd
with a "forced command" key. My understanding is that it will be in the
next release of openssh anyway.
diff -ruN openssh-2.2.0p1.orig/session.c openssh-2.2.0p1/session.c
--- openssh-2.2.0p1.orig/session.c Tue Aug 29 18:21:22 2000
+++ openssh-2.2.0p1/session.c Mon Sep 4 11:47:10 2000
@@ -125,6 +125,8 @@
static login_cap_t *lc;
#endif
+static char *saved_command = 0;
+
/*
* Remove local Xauthority file.
*/
@@ -377,8 +379,11 @@
packet_integrity_check(plen, 0, type);
}
if (forced_command != NULL) {
+ saved_command = command;
command = forced_command;
debug("Forced command '%.500s'", forced_command);
+ } else {
+ saved_command = NULL;
}
if (have_pty)
do_exec_pty(s, command, pw);
@@ -1042,6 +1047,9 @@
env = xmalloc(envsize * sizeof(char *));
env[0] = NULL;
+ if (saved_command) {
+ child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", saved_command);
+ }
if (!options.use_login) {
/* Set basic environment. */
child_set_env(&env, &envsize, "USER", pw->pw_name);
And this one just allows the selection of the cipher "none" which is
handy if you only need the "courtesy" functions of ssh (X11 forwarding,
easy remote access withough having to set up rsh) and not need
encryption.
diff -ur openssh-1.2.1pre25.orig/cipher.c openssh-1.2.1pre25/cipher.c
--- openssh-1.2.1pre25.orig/cipher.c Tue Dec 14 23:34:31 1999
+++ openssh-1.2.1pre25/cipher.c Fri Jan 14 14:37:16 2000
@@ -139,6 +139,7 @@
unsigned int mask = 0;
mask |= 1 << SSH_CIPHER_3DES; /* Mandatory */
mask |= 1 << SSH_CIPHER_BLOWFISH;
+ mask |= 1 << SSH_CIPHER_NONE;
return mask;
}
unsigned int
diff -ur openssh-1.2.1pre25.orig/ssh.c openssh-1.2.1pre25/ssh.c
--- openssh-1.2.1pre25.orig/ssh.c Wed Dec 29 00:17:09 1999
+++ openssh-1.2.1pre25/ssh.c Fri Jan 14 14:40:50 2000
@@ -135,7 +135,8 @@
fprintf(stderr, " -c cipher Select encryption algorithm: "
"``3des'', "
- "``blowfish''\n");
+ "``blowfish'', "
+ "``none''\n");
fprintf(stderr, " -p port Connect to this port. Server must be on the
same port.\n");
fprintf(stderr, " -L listen-port:host:port Forward local port to remote
address\n");
fprintf(stderr, " -R listen-port:host:port Forward remote port to local
address\n");
You consideration of one or both of these would be much appreciated.
Thanx,
b.
--
Brian J. Murrell InterLinx Support Services, Inc.
North Vancouver, B.C. 604 983 UNIX
Platform and Brand Independent UNIX Support - R3.2 - R4 - BSD