From 977da5f49cfbbbfe07947c2c898a91a7e75e1661 Mon Sep 17 00:00:00 2001 From: cyd01 Date: Fri, 18 Sep 2020 18:05:42 +0200 Subject: [PATCH] Tagging the 0.74.2.1 release of the kitty project. --- 0.74_My_PuTTY/config.c | 13 +++++--- 0.74_My_PuTTY/portfwd.c | 40 ++++++++++++++++++++++++- 0.74_My_PuTTY/version.h | 2 +- 0.74_My_PuTTY/windows/version_major.txt | 2 +- 0.74_My_PuTTY/windows/window.c | 26 ++++++++++++++-- kitty_image.c | 9 +----- kitty_registry.c | 2 +- 7 files changed, 75 insertions(+), 19 deletions(-) diff --git a/0.74_My_PuTTY/config.c b/0.74_My_PuTTY/config.c index 672cbc4..b07f4e4 100644 --- a/0.74_My_PuTTY/config.c +++ b/0.74_My_PuTTY/config.c @@ -1058,7 +1058,7 @@ static void sessionsaver_handler(union control *ctrl, dlgparam *dlg, dlg_update_start(ctrl, dlg); dlg_listbox_clear(ctrl, dlg); #ifdef MOD_PERSO - if( ssd->savedsession!=NULL ) strcpy( ssd->savedsession, dlg_editbox_get( ssd->editbox, dlg ) ) ; // ajout 0.63 pour que le filtre fonctionne + if( ssd->savedsession!=NULL ) strcpy( ssd->savedsession, dlg_editbox_get( ssd->editbox, dlg ) ) ; ctrlSessionList = ctrl ; //if(get_param("INIFILE")==SAVEMODE_DIR) CleanFolderName( CurrentFolder ) ; @@ -1096,11 +1096,15 @@ static void sessionsaver_handler(union control *ctrl, dlgparam *dlg, } } + dlg_update_done(ctrl, dlg); + + if( get_param("INIFILE")==SAVEMODE_DIR ) { dlg_listbox_select(ctrl, dlg,1) ; } #else for (i = 0; i < ssd->sesslist.nsessions; i++) dlg_listbox_add(ctrl, dlg, ssd->sesslist.sessions[i]); -#endif dlg_update_done(ctrl, dlg); +#endif + } } else if (event == EVENT_VALCHANGE) { int top, bottom, halfway, i; @@ -3034,7 +3038,8 @@ if( !GetPuttyFlag() ) { ctrl_text(s, " %%P: protocol name", HELPCTX(appearance_title)); ctrl_text(s, " %%s: session name", HELPCTX(appearance_title)); ctrl_text(s, " %%u: username", HELPCTX(appearance_title)); - ctrl_text(s, " %%w: forwarded ports list", HELPCTX(appearance_title)); + ctrl_text(s, " %%l: forwarded local ports list", HELPCTX(appearance_title)); + ctrl_text(s, " %%d: forwarded dynamic ports list", HELPCTX(appearance_title)); } #endif ctrl_checkbox(s, "Separate window and icon titles", 'i', @@ -4052,7 +4057,7 @@ if( !GetPuttyFlag() ) { "PSCP and WinSCP integration"); s = ctrl_getset(b, "Connection/SSH/PSCP and WinSCP", "winSCPproto", "General protocol setting") ; - ctrl_radiobuttons(s, "Prefered protocol:", NO_SHORTCUT, 7, + ctrl_radiobuttons(s, "Prefered protocol:", NO_SHORTCUT, 4, HELPCTX(no_help), conf_radiobutton_handler, I(CONF_winscpprot), diff --git a/0.74_My_PuTTY/portfwd.c b/0.74_My_PuTTY/portfwd.c index 49a8d50..75c3fd6 100644 --- a/0.74_My_PuTTY/portfwd.c +++ b/0.74_My_PuTTY/portfwd.c @@ -786,6 +786,45 @@ void portfwdmgr_free(PortFwdManager *mgr) sfree(mgr); } +#ifdef MOD_PERSO +// Manage sftpconnect that ends with :* (create a local forward port dynamically) +void AddDynamicSFTPConnect( Conf *conf ) { + char * p = conf_get_str( conf, CONF_sftpconnect ) ; + if( p[0]==':' ) { + if( (conf_get_str( conf, CONF_username )!=NULL) && (strlen(conf_get_str( conf, CONF_username ))>0) ) { + char *b ; + b = (char*) malloc( strlen(conf_get_str( conf, CONF_username )) + 20 ) ; + sprintf( b, "%s@localhost%s", conf_get_str( conf, CONF_username ),p ) ; + conf_set_str( conf, CONF_sftpconnect, b ) ; + p = conf_get_str( conf, CONF_sftpconnect ) ; + free(b); + } else if( strstr(conf_get_str( conf, CONF_host ),"@")!=NULL ) { + char *b ; + b = (char*) malloc( strlen(conf_get_str( conf, CONF_host )) + 20 ) ; + strcpy(b,conf_get_str( conf, CONF_host )); + strstr(b,"@")[0]='\0'; + strcat(b,"@localhost"); + strcat(b,p); + conf_set_str( conf, CONF_sftpconnect, b ) ; + p = conf_get_str( conf, CONF_sftpconnect ) ; + free(b) ; + } + } + if( (p[strlen(p)-1]=='*') && (p[strlen(p)-2]==':') ) { + char key[10], val[20] ; + p[strlen(p)-2]='\0' ; + int rnd = (rand() % (65000 - 60000)) + 60000 ; + sprintf(key,"L%d",rnd); + sprintf(val,"localhost:%d",conf_get_int(conf, CONF_port)); + conf_set_str_str(conf, CONF_portfwd, key, val) ; + char *b = (char*) malloc( strlen(p)+20 ); + sprintf(b,"%s:%d",p,rnd) ; + conf_set_str( conf, CONF_sftpconnect, b ) ; + free(b); + } +} +#endif + void portfwdmgr_config(PortFwdManager *mgr, Conf *conf) { PortFwdRecord *pfr; @@ -805,7 +844,6 @@ void portfwdmgr_config(PortFwdManager *mgr, Conf *conf) */ for (i = 0; (pfr = index234(mgr->forwardings, i)) != NULL; i++) pfr->status = DESTROY; - for (val = conf_get_str_strs(conf, CONF_portfwd, NULL, &key); val != NULL; val = conf_get_str_strs(conf, CONF_portfwd, key, &key)) { diff --git a/0.74_My_PuTTY/version.h b/0.74_My_PuTTY/version.h index 2ee6945..47612fd 100644 --- a/0.74_My_PuTTY/version.h +++ b/0.74_My_PuTTY/version.h @@ -1,5 +1,5 @@ #define RELEASE 0.74 #define TEXTVER "Release 0.74" #define SSHVER "-Release-0.74" -#define BINARY_VERSION 0,74,1,1 +#define BINARY_VERSION 0,74,2,1 #define SOURCE_COMMIT "unavailable" diff --git a/0.74_My_PuTTY/windows/version_major.txt b/0.74_My_PuTTY/windows/version_major.txt index 9ec18e1..e7a4a73 100644 --- a/0.74_My_PuTTY/windows/version_major.txt +++ b/0.74_My_PuTTY/windows/version_major.txt @@ -1 +1 @@ -"0.74.1" +"0.74.2" diff --git a/0.74_My_PuTTY/windows/window.c b/0.74_My_PuTTY/windows/window.c index ab8e0db..a00167f 100644 --- a/0.74_My_PuTTY/windows/window.c +++ b/0.74_My_PuTTY/windows/window.c @@ -1663,6 +1663,9 @@ else { #ifdef MOD_PORTKNOCKING ManagePortKnocking(conf_get_str(conf,CONF_host),conf_get_str(conf,CONF_portknockingoptions)); +#endif +#ifdef MOD_PERSO +AddDynamicSFTPConnect( conf ) ; #endif if (restricted_acl) { @@ -7261,7 +7264,8 @@ void set_title_internal(TermWin *tw, const char *title) { %%P: le protocole %%s: nom de la session (vide sinon) %%u: le user - %%w: la liste des port forward locaux + %%l: la liste des port forward locaux + %%d: la liste des port forward dynamic Ex: %%P://%%u@%%h:%%p Ex: %%f / %%s */ @@ -7292,7 +7296,7 @@ void make_title( char * res, char * fmt, const char * title ) { sprintf(b,"%ld", GetCurrentProcessId() ) ; while( (p=poss( "%%i", res)) > 0 ) { del(res,p,3); insert(res,b,p); } - while( (p=poss( "%%w", res)) > 0 ) { // forward port locaux + while( (p=poss( "%%d", res)) > 0 ) { // forward port dynamic char *key, *val; int nb=0 ; del(res,p,3) ; @@ -7300,7 +7304,23 @@ void make_title( char * res, char * fmt, const char * title ) { for (val = conf_get_str_strs(conf, CONF_portfwd, NULL, &key); val != NULL; val = conf_get_str_strs(conf, CONF_portfwd, key, &key)) { - if ( key[0]=='L' ) { + if( (key[0]=='L') && (!strcmp(val,"D")) ) { + if(nb!=0) {strcat(b,"|");} + strcat(b,key+1); + nb++; + } + } + insert(res,b,p) ; + } + while( (p=poss( "%%l", res)) > 0 ) { // forward port locaux + char *key, *val; + int nb=0 ; + del(res,p,3) ; + b[0]='\0'; + for (val = conf_get_str_strs(conf, CONF_portfwd, NULL, &key); + val != NULL; + val = conf_get_str_strs(conf, CONF_portfwd, key, &key)) { + if( (key[0]=='L') && (strcmp(val,"D")) ) { if(nb!=0) {strcat(b,"|");} strcat(b,key+1); nb++; diff --git a/kitty_image.c b/kitty_image.c index 25a0dc1..bd56a9c 100644 --- a/kitty_image.c +++ b/kitty_image.c @@ -1,10 +1,3 @@ -// Probleme du bug de consommation memoire avec le shrink => -// - voir 0/1 dans la fonction RedrawBackground -// - voir dans le fichier WINDOW.C le if((UINT_PTR)wParam == TIMER_REDRAW) -// Le probleme est dans load_file_jpeg => il manquait un GlobalFree - - -// Essai de compilation séparée #ifdef FLJ #undef MOD_BACKGROUNDIMAGE #endif @@ -13,12 +6,12 @@ #include "jpeg/jpeglib.h" #include +#include #ifdef MOD_BACKGROUNDIMAGE #include #include "putty.h" -#include #include "terminal.h" #include "kitty_image.h" diff --git a/kitty_registry.c b/kitty_registry.c index bb52e40..485fd77 100644 --- a/kitty_registry.c +++ b/kitty_registry.c @@ -480,7 +480,7 @@ return 1 ; RegDeleteValue( hSubKey, "IconeFile" ) ; RegDeleteValue( hSubKey, "WinSCPProtocol" ) ; RegDeleteValue( hSubKey, "SFTPConnect" ) ; - RegDeleteValue( hSubKey, "PSCPOptions" ) ; + RegDeleteValue( hSubKey, "PSCPOptions" ) ; RegDeleteValue( hSubKey, "PSCPRemoteDir" ) ; RegDeleteValue( hSubKey, "WinSCPOptions" ) ; RegDeleteValue( hSubKey, "WinSCPRawSettings" ) ;