Author: gnodet
Date: Tue Jan 20 10:43:41 2009
New Revision: 736063

URL: http://svn.apache.org/viewvc?rev=736063&view=rev
Log:
SSHD-10: sshd barfs on 'keepal...@openssh.com' request from client

Modified:
    
mina/sshd/trunk/src/main/java/org/apache/sshd/server/session/ServerSession.java

Modified: 
mina/sshd/trunk/src/main/java/org/apache/sshd/server/session/ServerSession.java
URL: 
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/session/ServerSession.java?rev=736063&r1=736062&r2=736063&view=diff
==============================================================================
--- 
mina/sshd/trunk/src/main/java/org/apache/sshd/server/session/ServerSession.java 
(original)
+++ 
mina/sshd/trunk/src/main/java/org/apache/sshd/server/session/ServerSession.java 
Tue Jan 20 10:43:41 2009
@@ -398,10 +398,17 @@
 
     private void globalRequest(Buffer buffer) throws Exception {
         String req = buffer.getString();
-        log.info("Received SSH_MSG_GLOBAL_REQUEST {}" ,req);
-        log.error("Unknown global request: {}", req);
-        buffer = createBuffer(SshConstants.Message.SSH_MSG_REQUEST_FAILURE);
-        writePacket(buffer);
+        boolean wantReply = buffer.getBoolean();
+        if (req.equals("keepal...@openssh.com")) {
+          // Relatively standard KeepAlive directive, just wants failure
+        } else {
+          log.info("Received SSH_MSG_GLOBAL_REQUEST {}" ,req);
+          log.error("Unknown global request: {}", req);
+        }
+        if (wantReply){
+          buffer = createBuffer(SshConstants.Message.SSH_MSG_REQUEST_FAILURE);
+          writePacket(buffer);
+        }
     }
 
 


Reply via email to