liuzhe02 / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

Accept connections in subfolders #167

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
shellinabox-svn

Please provide any additional information below.

This is not a bug report, it's rather a patch submission.

I'm serving shellinabox through a proxy web server.
In my case, lighttpd does not allow me to rewrite url before passing it to the 
proxy like apache does with its proxypass.
Eg: If I ask lighttpd to proxify queries made to 
https://mydomain.com/shell/box1/ , it would send the exact same URL to the 
proxyfied(shellinabox) server.

Shellinabox was reporting this url as "Not found". Normal because shellinabox 
reads the url until the second / and discards the rest so that 
/beep.wav/noise/blabla would work, but not /noise/blabla/beed.wav.

I wrote a patch so that shellinabox matches only the LAST part of the url, 
discarding the rest. It has no side effects that I could see, it does not 
change actual behavior except that it will be more flexible in what url it 
accepts.

As a side bonus, that allows me to create a wrapper using the ${url} in the 
cmdline and have urls like https://domain.tld/hostname/user/ that launch ssh 
automagically at the good user@hostname which is awesome for my customers!

Original issue reported on code.google.com by decoy113...@gmail.com on 6 Mar 2012 at 1:02

Attachments:

GoogleCodeExporter commented 8 years ago
If I understand your patch correctly, you are looking for the last '/' in the 
string whereas the original code looks for the first non '/' character.  I'm 
concerned about the causal reference to *(pointer-1) which could underflow.  
I'll rewrite the patch using more deterministic functions.

Markus should review.

Original comment by beewoo...@gmail.com on 31 Mar 2012 at 11:21

Attachments: