• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision5959 (tree)
Time2015-08-25 18:17:18
Authordoda

Log Message

/ssh-L, /ssh-R で複数の転送を受け付ける形式を /ssh-L8080:remote:80,2525:remote2:25 に変更する。
/ssh-L8080:remote:80,R8888:localhost:80 のようなローカル/リモート混在を使えなくする。

Change Summary

Incremental Difference

--- trunk/ttssh2/ttxssh/ttxssh.c (revision 5958)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 5959)
@@ -1720,21 +1720,31 @@
17201720 if (option[4] == 0) {
17211721 pvar->settings.Enabled = 1;
17221722 } else if (MATCH_STR(option + 4, "-L") == 0 ||
1723- MATCH_STR(option + 4, "-R") == 0 ||
1724- _stricmp(option + 4, "-X") == 0) {
1725- // 内部では ; で区切っているので、, を ; に変換する
1726- strncpy_s(option2, opt_len, option+5, _TRUNCATE);
1727- for (i=0; i<strlen(option2); i++) {
1728- if (option2[i] == ',') {
1729- option2[i] = ';';
1723+ MATCH_STR(option + 4, "-R") == 0) {
1724+ char *p = option + 5;
1725+ option2[0] = *p;
1726+ i = 1;
1727+ while (*++p) {
1728+ if (*p == ';' || *p == ',') {
1729+ option2[i] = 0;
1730+ add_forward_param(pvar, option2);
1731+ i = 1;
17301732 }
1733+ else {
1734+ option2[i++] = *p;
1735+ }
17311736 }
1732- add_forward_param(pvar, option2);
1737+ if (i > 1) {
1738+ option2[i] = 0;
1739+ add_forward_param(pvar, option2);
1740+ }
17331741 } else if (MATCH_STR(option + 4, "-X") == 0) {
17341742 add_forward_param(pvar, "X");
1735- strncpy_s(pvar->settings.X11Display,
1736- sizeof(pvar->settings.X11Display),
1737- option + 6, _TRUNCATE);
1743+ if (option+6 != 0) {
1744+ strncpy_s(pvar->settings.X11Display,
1745+ sizeof(pvar->settings.X11Display),
1746+ option + 6, _TRUNCATE);
1747+ }
17381748 } else if (MATCH_STR(option + 4, "-v") == 0) {
17391749 pvar->settings.LogLevel = LOG_LEVEL_VERBOSE;
17401750 } else if (_stricmp(option + 4, "-autologin") == 0 ||
Show on old repository browser