-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcisco_color_ssh.patch
85 lines (73 loc) · 2.5 KB
/
cisco_color_ssh.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
diff -Naur ../openssh-5.9p1/Makefile.in ./Makefile.in
--- ../openssh-5.9p1/Makefile.in 2011-08-05 16:15:18.000000000 -0400
+++ ./Makefile.in 2011-11-29 08:58:27.000000000 -0500
@@ -75,7 +75,7 @@
SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
sshconnect.o sshconnect1.o sshconnect2.o mux.o \
- roaming_common.o roaming_client.o
+ roaming_common.o roaming_client.o cisco_color.o
SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
audit.o audit-bsm.o audit-linux.o platform.o \
@@ -231,7 +231,9 @@
$(AUTORECONF)
-rm -rf autom4te.cache
-install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config
+install:
+ echo "Please install the ssh binary manually to ensure you don't overwrite system"
+ echo "default."
install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf
install-nosysconf: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files
diff -Naur ../openssh-5.9p1/channels.c ./channels.c
--- ../openssh-5.9p1/channels.c 2011-06-22 18:31:57.000000000 -0400
+++ ./channels.c 2011-11-29 08:50:16.000000000 -0500
@@ -77,6 +77,8 @@
#include "key.h"
#include "authfd.h"
#include "pathnames.h"
+#include "cisco_color.h"
+
/* -- channel core */
@@ -2263,6 +2265,7 @@
int id;
char *data;
u_int data_len, win_len;
+ int increased;
Channel *c;
/* Get the channel number and verify it. */
@@ -2282,6 +2285,8 @@
if (c->datagram)
win_len += 4; /* string length header */
+ /* Parse our regexes */
+ increased = process_patterns(data,data_len);
/*
* Ignore data for protocol > 1.3 if output end is no longer open.
* For protocol 2 the sending side is reducing its window as it sends
@@ -2310,9 +2315,9 @@
c->local_window -= win_len;
}
if (c->datagram)
- buffer_put_string(&c->output, data, data_len);
+ buffer_put_string(&c->output, data, data_len + increased);
else
- buffer_append(&c->output, data, data_len);
+ buffer_append(&c->output, data, data_len + increased);
packet_check_eom();
}
diff -Naur ../openssh-5.9p1/ssh.c ./ssh.c
--- ../openssh-5.9p1/ssh.c 2011-08-05 16:18:16.000000000 -0400
+++ ./ssh.c 2011-11-29 08:50:23.000000000 -0500
@@ -104,6 +104,7 @@
#include "uidswap.h"
#include "roaming.h"
#include "version.h"
+#include "cisco_color.h"
#ifdef ENABLE_PKCS11
#include "ssh-pkcs11.h"
@@ -249,6 +250,9 @@
struct servent *sp;
Forward fwd;
+ /* compile Regex for color matching */
+ init_patterns();
+
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
sanitise_stdfd();