Tagging the 0.74.4.3 release of the KiTTY project.

This commit is contained in:
cyd01
2021-01-06 23:52:58 +01:00
parent 2d1b66aa3f
commit 6388f577ad
14 changed files with 178 additions and 33 deletions
+12 -7
View File
@@ -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);
+1
View File
@@ -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) \
+2
View File
@@ -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) ;
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -1 +1 @@
2
3
+15
View File
@@ -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:
+1 -1
View File
@@ -1 +1 @@
0.74.4.2
0.74.4.3
+27 -22
View File
@@ -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; i<cSubKeys; i++) {
cbName = MAX_KEY_LENGTH;
retCode = RegEnumKeyEx(hKey, i, achKey, &cbName, NULL, NULL, NULL, &ftLastWriteTime) ;
ExportSubKeyToFile( HKEY_CURRENT_USER, buffer, achKey, ConfigDirectory, "Proxies" ) ;
}
}
RegCloseKey( hKey ) ;
+96
View File
@@ -481,6 +481,7 @@ return 1 ;
RegDeleteValue( hSubKey, "WinSCPProtocol" ) ;
RegDeleteValue( hSubKey, "SFTPConnect" ) ;
RegDeleteValue( hSubKey, "PSCPOptions" ) ;
RegDeleteValue( hSubKey, "PSCPShell" ) ;
RegDeleteValue( hSubKey, "PSCPRemoteDir" ) ;
RegDeleteValue( hSubKey, "WinSCPOptions" ) ;
RegDeleteValue( hSubKey, "WinSCPRawSettings" ) ;
@@ -499,6 +500,7 @@ return 1 ;
RegDeleteValue( hSubKey, "FailureReconnect" ) ;
RegDeleteValue( hSubKey, "Scriptfile" ) ;
RegDeleteValue( hSubKey, "ScriptfileContent" ) ;
RegDeleteValue( hSubKey, "HostAlt" ) ;
RegDeleteValue( hSubKey, "TransparencyValue" ) ;
RegDeleteValue( hSubKey, "TermXPos" ) ;
RegDeleteValue( hSubKey, "TermYPos" ) ;
@@ -545,6 +547,12 @@ return 1 ;
RegDeleteValue( hSubKey, "ScriptTimeout" ) ;
RegDeleteValue( hSubKey, "ScriptWait" ) ;
RegDeleteValue( hSubKey, "ScriptHalt" ) ;
RegDeleteValue( hSubKey, "SSHTunnelInTitle" ) ;
RegDeleteValue( hSubKey, "SCPAutoPwd" ) ;
RegDeleteValue( hSubKey, "NoFocusReporting" ) ;
RegDeleteValue( hSubKey, "LinesAtAScroll" ) ;
RegDeleteValue( hSubKey, "DisableAltGr" ) ;
RegDeleteValue( hSubKey, "ProxySelection" ) ;
//RegDeleteValue( hSubKey, "" ) ;
RegCloseKey(hSubKey) ;
}
@@ -645,6 +653,94 @@ void TestRegKeyOrCopyFromPuTTY( HKEY hMainKey, char * KeyName ) {
}
}
// Exporte une clé de registre dans un fichier au format PuTTY ( name\value\ )
int ExportSubKeyToFile( HKEY hkey, const char *subkey, const char *keyname, const char *maindir, const char *subdir ) {
char *fullkey, *fullpath ;
FILE *fp;
HKEY hKey;
int retCode, i;
unsigned char lpData[1024], unlpData[1024] ;
TCHAR achClass[MAX_PATH] = TEXT(""), achValue[MAX_VALUE_NAME] ;
DWORD cchClassName = MAX_PATH, cSubKeys=0, cbMaxSubKey, cchMaxClass, cValues, cchMaxValue, cbMaxValueData, cbSecurityDescriptor, cchValue = MAX_VALUE_NAME , dwDataSize, lpType;
FILETIME ftLastWriteTime;
if( subkey!=NULL ) {
if( keyname!=NULL ) {
fullkey = (char*) malloc( strlen(subkey)+strlen(keyname)+2 ) ;
sprintf( fullkey, "%s\\%s", subkey, keyname ) ;
} else {
fullkey = (char*) malloc( strlen(subkey)+1 ) ;
sprintf( fullkey, "%s", subkey ) ;
}
} else {
fullkey = (char*) malloc( strlen(keyname)+1 ) ;
sprintf( fullkey, "%s", keyname ) ;
}
if( maindir!=NULL ) {
if( subdir!=NULL ) {
fullpath = (char*) malloc( strlen(maindir)+strlen(subdir)+strlen(keyname)+3 ) ;
sprintf( fullpath, "%s\\%s\\%s", maindir, subdir, keyname ) ;
} else {
fullpath = (char*) malloc( strlen(maindir)+strlen(keyname)+2 ) ;
sprintf( fullpath, "%s\\%s", maindir, keyname ) ;
}
} else {
fullpath = (char*) malloc( strlen(subdir)+strlen(keyname)+2 ) ;
sprintf( fullpath, "%s\\%s", subdir, keyname ) ;
}
if( (fp=fopen(fullpath,"wb"))==NULL ) { free( fullpath ) ; free( fullkey ) ; return 1 ; }
if( RegOpenKeyEx( HKEY_CURRENT_USER, TEXT(fullkey), 0, KEY_READ, &hKey) != ERROR_SUCCESS ) { free( fullpath ) ; free( fullkey ) ; return 2 ; }
if( RegQueryInfoKey(hKey,achClass,&cchClassName,NULL,&cSubKeys,&cbMaxSubKey
,&cchMaxClass,&cValues,&cchMaxValue,&cbMaxValueData,&cbSecurityDescriptor,&ftLastWriteTime) == ERROR_SUCCESS ) {
retCode = ERROR_SUCCESS ;
if(cValues) for (i=0, retCode=ERROR_SUCCESS; i<cValues; i++) {
cchValue = MAX_VALUE_NAME;
achValue[0] = '\0';
if( (retCode = RegEnumValue(hKey, i, achValue, &cchValue, NULL, NULL,NULL,NULL) ) == ERROR_SUCCESS ) {
char *buffer=NULL;
dwDataSize = 1024 ;
RegQueryValueEx( hKey, TEXT( achValue ), 0, &lpType, lpData, &dwDataSize ) ;
switch ((int)lpType) {
case REG_BINARY:
buffer = (char*) malloc( strlen( achValue ) + 50 ) ;
sprintf( buffer, "%s\\", achValue ) ;
itoa((u_int)(lpData[0]),buffer+strlen(buffer), 10);
strcat(buffer,".");
itoa((u_int)(lpData[1]),buffer+strlen(buffer),10);
strcat(buffer,".");
itoa((u_int)(lpData[2]),buffer+strlen(buffer),10);
strcat(buffer,".");
itoa((u_int)(lpData[3]),buffer+strlen(buffer),10);
strcat( buffer, "\\" ) ;
break;
case REG_DWORD:
buffer = (char*) malloc( strlen( achValue ) + 13 ) ;
sprintf( buffer, "%s\\", achValue ) ;
itoa(*(int*)(lpData),buffer+strlen(buffer),10) ;
strcat( buffer, "\\" ) ;
break;
case REG_EXPAND_SZ:
case REG_MULTI_SZ:
case REG_SZ:
mungestr( (const char*)lpData, (char*)unlpData ) ;
buffer = (char*) malloc( strlen( achValue ) + strlen( (char*)unlpData ) + 3 ) ;
sprintf( buffer, "%s\\%s\\", achValue, unlpData ) ;
break;
}
if( buffer!=NULL ) { fprintf(fp,"%s\r\n",buffer) ; free( buffer ) ; }
}
}
}
fclose( fp );
free( fullpath ) ;
free( fullkey ) ;
return 0 ;
}
/******
+5 -1
View File
@@ -62,5 +62,9 @@ void InitRegistryAllSessions( HKEY hMainKey, LPCTSTR lpSubKey, char * SubKeyName
// Permet d'initialiser toutes les sessions avec des valeurs contenu dans un fichier kitty.ses.updt
void InitAllSessions( HKEY hMainKey, LPCTSTR lpSubKey, char * SubKeyName, char * filename ) ;
// Exporte une clé de registre dans un fichier au format PuTTY ( name\value\ )
void mungestr( const char *in, char *out ) ;
int ExportSubKeyToFile( HKEY hkey, const char *subkey, const char *keyname, const char *maindir, const char *subdir ) ;
#endif
+1
View File
@@ -303,6 +303,7 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) {
/* Basic options */
fprintf( fp, "host=%s\n", conf_get_str(conf,CONF_host) ) ;
fprintf( fp, "host_alt=%s\n", conf_get_str(conf,CONF_host_alt) ) ;
fprintf( fp, "port=%d\n", conf_get_int(conf,CONF_port) ) ;
fprintf( fp, "protocol=%d\n", conf_get_int(conf,CONF_protocol) ) ;
fprintf( fp, "addressfamily=%d\n", conf_get_int(conf,CONF_addressfamily) ) ;
+2
View File
@@ -390,6 +390,7 @@ void save_open_settings_forced(char *filename, 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_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) ;
+11
View File
@@ -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 ) ;
+3
View File
@@ -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 ) ;