diff --git a/0.74_My_PuTTY/config.c b/0.74_My_PuTTY/config.c index ac3c1bf..db7621e 100644 --- a/0.74_My_PuTTY/config.c +++ b/0.74_My_PuTTY/config.c @@ -2333,6 +2333,12 @@ void setup_config_box(struct controlbox *b, bool midsession, sessionsaver_handler, P(ssd)); ssd->cancelbutton->button.iscancel = true; #ifdef MOD_PERSO + if( strlen(conf_get_str(conf,CONF_host))==0 ) { + if( strlen(conf_get_str(conf,CONF_host_alt))>0 ) { + conf_set_str( conf, CONF_host, conf_get_str( conf, CONF_host_alt ) ) ; + conf_set_str( conf, CONF_host_alt, "" ) ; + } + } if( GetConfigBoxHeight() > 7 ) ssd->cancelbutton->generic.column = 0 ; else #endif ssd->cancelbutton->generic.column = 4; @@ -4001,6 +4007,12 @@ if( !GetPuttyFlag() ) { HELPCTX(ssh_tunnels_portfwd_localhost), conf_checkbox_handler, I(CONF_rport_acceptall)); +#ifdef MOD_PERSO + ctrl_checkbox(s, "Print Dynamic ports in window title",NO_SHORTCUT, + HELPCTX(no_help), + conf_checkbox_handler, + I(CONF_ssh_tunnel_print_in_title)); +#endif ctrl_columns(s, 3, 55, 20, 25); c = ctrl_text(s, "Forwarded ports:", HELPCTX(ssh_tunnels_portfwd)); @@ -4058,13 +4070,6 @@ if( !GetPuttyFlag() ) { "IPv6", '6', I(ADDRTYPE_IPV6), NULL); #endif - -#ifdef MOD_PERSO - ctrl_checkbox(s, "Print Dynamic ports in window title",NO_SHORTCUT, - HELPCTX(no_help), - conf_checkbox_handler, - I(CONF_ssh_tunnel_print_in_title)); -#endif ctrl_tabdelay(s, pfd->addbutton); ctrl_columns(s, 1, 100); diff --git a/0.74_My_PuTTY/putty.h b/0.74_My_PuTTY/putty.h index 8ab1948..22b9ad3 100644 --- a/0.74_My_PuTTY/putty.h +++ b/0.74_My_PuTTY/putty.h @@ -1536,6 +1536,7 @@ NORETURN void cleanup_exit(int); X(BOOL, NONE, crhaslf) \ X(STR, NONE, winclass) \ /* #ifdef MOD_PERSO */ \ + X(STR, NONE, host_alt) \ X(INT, NONE, bcdelay) \ X(INT, NONE, initdelay) \ X(INT, NONE, transparencynumber) \ diff --git a/0.74_My_PuTTY/settings.c b/0.74_My_PuTTY/settings.c index eb31159..73acd5b 100644 --- a/0.74_My_PuTTY/settings.c +++ b/0.74_My_PuTTY/settings.c @@ -887,6 +887,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf) #ifdef MOD_PERSO if( conf_get_int(conf, CONF_transparencynumber)<-1 ) conf_set_int(conf, CONF_transparencynumber,-1) ; if( conf_get_int(conf, CONF_transparencynumber)>255 ) conf_set_int(conf, CONF_transparencynumber,255) ; + write_setting_s(sesskey, "HostAlt", conf_get_str(conf, CONF_host_alt) ); write_setting_i(sesskey, "TransparencyValue", conf_get_int(conf, CONF_transparencynumber) ) ; write_setting_i(sesskey, "SendToTray", conf_get_int(conf, CONF_sendtotray) ); write_setting_i(sesskey, "Maximize", conf_get_int(conf, CONF_maximize) ); @@ -1549,6 +1550,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf) gpps(sesskey, "zDownloadDir", "C:\\", conf, CONF_zdownloaddir ); #endif #ifdef MOD_PERSO + gpps(sesskey, "HostAlt", "", conf, CONF_host_alt ); gppi(sesskey, "TransparencyValue", 0, conf, CONF_transparencynumber ) ; if( conf_get_int( conf, CONF_transparencynumber) < -1 ) conf_set_int( conf,CONF_transparencynumber,-1) ; if( conf_get_int( conf, CONF_transparencynumber) > 255 ) conf_set_int( conf,CONF_transparencynumber,255) ; diff --git a/0.74_My_PuTTY/version.h b/0.74_My_PuTTY/version.h index 9ef54fd..3a06ee9 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,4,2 +#define BINARY_VERSION 0,74,4,3 #define SOURCE_COMMIT "unavailable" diff --git a/0.74_My_PuTTY/windows/version_minor.txt b/0.74_My_PuTTY/windows/version_minor.txt index 0cfbf08..00750ed 100644 --- a/0.74_My_PuTTY/windows/version_minor.txt +++ b/0.74_My_PuTTY/windows/version_minor.txt @@ -1 +1 @@ -2 +3 diff --git a/0.74_My_PuTTY/windows/window.c b/0.74_My_PuTTY/windows/window.c index ceff610..3bd71c9 100644 --- a/0.74_My_PuTTY/windows/window.c +++ b/0.74_My_PuTTY/windows/window.c @@ -388,6 +388,20 @@ void RunSessionWithCurrentSettings( HWND hwnd, Conf * oldconf, const char * host if( host != NULL ) { conf_set_str(newconf,CONF_host,host) ; } if( user != NULL ) { conf_set_str(newconf,CONF_username,user) ; } if( pass != NULL ) { conf_set_str(newconf,CONF_password,pass) ; } + +#ifndef MOD_NOPASSWORD + char pst[4096] ; + strcpy( pst, conf_get_str(newconf, CONF_password ) ) ; + MASKPASS(GetCryptSaltFlag(), pst); + if( pass != NULL ) { strcpy( pst, pass ) ; } + conf_set_str( newconf, CONF_password, pst ) ; + memset(pst,0,strlen(pst)); +#else + conf_set_str( newconf, CONF_password, "" ) ; +#endif + + + if( remotepath != NULL ) { char *buf=(char*)malloc(strlen(remotepath)+5); sprintf(buf,"cd %s",remotepath); @@ -4231,6 +4245,7 @@ free(cmd); #endif /* rutty */ #ifdef MOD_PERSO case IDM_NEWDUPSESS: + conf_set_str( conf, CONF_host_alt, conf_get_str( conf, CONF_host ) ) ; RunSessionWithCurrentSettings( hwnd, conf, "", NULL, NULL, 0, NULL ) ; break; /*case IDM_USERCMD: diff --git a/docs/version.txt b/docs/version.txt index ba7a6d7..a1f2639 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -0.74.4.2 \ No newline at end of file +0.74.4.3 \ No newline at end of file diff --git a/kitty.c b/kitty.c index 650ab18..4d6f889 100644 --- a/kitty.c +++ b/kitty.c @@ -3175,7 +3175,7 @@ void routine_inputbox_password( void * phwnd ) { GetAndSendLinePassword( MainHwnd ) ; } -// Demarre le timer d'autocommand a  la connexion +// Demarre le timer d'autocommand a la connexion void CreateTimerInit( void ) { SetTimer(MainHwnd, TIMER_INIT, init_delay, NULL) ; } @@ -3183,27 +3183,29 @@ void CreateTimerInit( void ) { // Positionne le repertoire ou se trouve la configuration void SetConfigDirectory( const char * Directory ) { char *buf ; - if( ConfigDirectory != NULL ) { free( ConfigDirectory ) ; ConfigDirectory = NULL ; } - if( (Directory!=NULL)&&(strlen(Directory)>0) ) { - if( existdirectory(Directory) ) { - ConfigDirectory = (char*)malloc( strlen(Directory)+1 ) ; - strcpy( ConfigDirectory, Directory ) ; - } - else { - buf=(char*)malloc(strlen(InitialDirectory)+strlen(Directory)+10) ; - sprintf(buf,"%s\\%s",InitialDirectory,Directory) ; - if( existdirectory(buf) ) { - ConfigDirectory = (char*)malloc( strlen(buf)+1 ) ; - strcpy( ConfigDirectory, buf ) ; - } - free(buf); - } + if( ConfigDirectory != NULL ) { + free( ConfigDirectory ) ; + ConfigDirectory = NULL ; + } + if( (Directory!=NULL)&&(strlen(Directory)>0) ) { + if( IsPathAbsolute(Directory) ) { + buf = (char*) malloc(strlen(Directory)+1) ; + strcpy( buf, Directory ) ; + } else { + buf = (char*)malloc(strlen(InitialDirectory)+strlen(Directory)+2) ; + sprintf( buf, "%s\\%s", InitialDirectory, Directory ) ; } + if( existdirectory(buf) ) { + ConfigDirectory = (char*)malloc( strlen(buf)+1 ) ; + strcpy( ConfigDirectory, buf ) ; + } + free( buf ) ; + } if( ConfigDirectory==NULL ) { ConfigDirectory = (char*)malloc( strlen(InitialDirectory)+1 ) ; strcpy( ConfigDirectory, InitialDirectory ) ; - } } +} void GetInitialDirectory( char * InitialDirectory ) { int i ; @@ -3213,14 +3215,14 @@ void GetInitialDirectory( char * InitialDirectory ) { do { if( InitialDirectory[i] == '\\' ) { InitialDirectory[i]='\0' ; i = 0 ; } i-- ; - } - while( i >= 0 ) ; - } + } while( i >= 0 ) ; } - else { strcpy( InitialDirectory, "" ) ; } + } else { + strcpy( InitialDirectory, "" ) ; + } SetConfigDirectory( InitialDirectory ) ; - } +} void GotoInitialDirectory( void ) { chdir( InitialDirectory ) ; } void GotoConfigDirectory( void ) { if( ConfigDirectory!=NULL ) chdir( ConfigDirectory ) ; } @@ -4471,6 +4473,9 @@ int Convert2Dir( const char * Directory ) { if( RegQueryInfoKey(hKey,achClass,&cchClassName,NULL,&cSubKeys,&cbMaxSubKey ,&cchMaxClass,&cValues,&cchMaxValue,&cbMaxValueData,&cbSecurityDescriptor,&ftLastWriteTime) == ERROR_SUCCESS ) { if (cSubKeys) for (i=0; i255 ) conf_set_int(conf, CONF_transparencynumber,255) ; + write_setting_s_forced(sesskey, "HostAlt", conf_get_str(conf, CONF_host_alt) ); write_setting_i_forced(sesskey, "TransparencyValue", conf_get_int(conf, CONF_transparencynumber) ) ; write_setting_i_forced(sesskey, "SendToTray", conf_get_int(conf, CONF_sendtotray) ); write_setting_i_forced(sesskey, "Maximize", conf_get_int(conf, CONF_maximize) ); @@ -1017,6 +1018,7 @@ void load_open_settings_forced(char *filename, Conf *conf) { gpps_forced(sesskey, "zDownloadDir", "C:\\", conf, CONF_zdownloaddir ); #endif #ifdef MOD_PERSO + gpps_forced(sesskey, "HostAlt", "", conf, CONF_host_alt ); gppi_forced(sesskey, "TransparencyValue", 0, conf, CONF_transparencynumber ) ; if( conf_get_int( conf, CONF_transparencynumber) < -1 ) conf_set_int( conf,CONF_transparencynumber,-1) ; if( conf_get_int( conf, CONF_transparencynumber) > 255 ) conf_set_int( conf,CONF_transparencynumber,255) ; diff --git a/kitty_win.c b/kitty_win.c index 79fd7ea..bcf2f1d 100644 --- a/kitty_win.c +++ b/kitty_win.c @@ -429,6 +429,17 @@ void debug_logevent( const char *fmt, ... ) { free(buf); } +// Test si un chemin est absolu +bool IsPathAbsolute( const char * path ) { + bool test = false ; + if( path == NULL ) { return false ; } + if( strlen( path ) < 3 ) { return false ; } + if( ((path[0]>='a') && (path[0]<='z')) || ((path[0]>='A') && (path[0]<='Z')) ) + if( path[1]==':' ) + if( (path[2]=='/') || (path[2]=='\\') ) test = true ; + return test ; +} + void PopUpSystemMenu( HWND hwnd, int npos ) { RECT rc ; GetWindowRect( hwnd, &rc ) ; diff --git a/kitty_win.h b/kitty_win.h index 6fd4788..7c5f201 100644 --- a/kitty_win.h +++ b/kitty_win.h @@ -37,6 +37,9 @@ void CheckVersionFromWebSite( HWND hwnd ) ; // Affichage d'un message dans l'event log void debug_logevent( const char *fmt, ... ) ; +// Test si un chemin est absolu +bool IsPathAbsolute( const char * path ) ; + // Affiche le menu system de l'application void PopUpSystemMenu( HWND hwnd, int npos ) ;