Tagging the 0.74.4.2 release of the KiTTY project.

This commit is contained in:
cyd01
2021-01-05 19:40:17 +01:00
parent 3d0137720e
commit 2d1b66aa3f
26 changed files with 204 additions and 89 deletions
+50 -4
View File
@@ -10,9 +10,7 @@
#include "dialog.h"
#include "storage.h"
#ifdef MOD_PROXY
#include "kitty_proxy.h"
#endif
#ifdef MOD_RUTTY
#include "script.h"
#endif /* rutty */
@@ -27,6 +25,47 @@ int GetReadOnlyFlag(void) ;
#ifdef MOD_ZMODEM
#define ATOFFSET(data, offset) ( (void *) ( (char *)(data) + (offset) ) )
#endif
#ifdef MOD_PROXY
#include "kitty_proxy.h"
void proxy_selection_handler(union control *ctrl, dlgparam *dlg, void *data, int event) {
int i, j;
Conf *conf = (Conf *)data;
if (event == EVENT_REFRESH) {
/* Fetching this once at the start of the function ensures we
* remember what the right value is supposed to be when
* operations below cause reentrant calls to this function. */
char * oldproxy = conf_get_str(conf, CONF_proxyselection);
dlg_update_start(ctrl, dlg);
dlg_listbox_clear(ctrl, dlg);
for (i = 0; i < lenof(proxies); i++) {
if( proxies[i].name==NULL ) break ;
dlg_listbox_addwithid(ctrl, dlg, proxies[i].name, proxies[i].val);
}
for (i = j = 0; i < lenof(proxies); i++) {
if( proxies[i].name==NULL ) break ;
if ( !strcmp(oldproxy,proxies[i].name) ) {
dlg_listbox_select(ctrl, dlg, i);
break;
}
j++;
}
if (i == lenof(proxies)) { /* an unsupported setting was chosen */
dlg_listbox_select(ctrl, dlg, 0);
oldproxy = NULL;
}
dlg_update_done(ctrl, dlg);
if( oldproxy!=NULL ) conf_set_str(conf, CONF_proxyselection, oldproxy); /* restore */
} else if (event == EVENT_SELCHANGE) {
int i = dlg_listbox_index(ctrl, dlg);
if (i < 0)
i = 0;
else
i = dlg_listbox_getid(ctrl, dlg, i);
conf_set_str(conf, CONF_proxyselection, proxies[i].name);
}
}
#endif
#define PRINTER_DISABLED_STRING "None (printing disabled)"
@@ -3434,7 +3473,7 @@ if( !GetPuttyFlag() ) {
}
if (!midsession) {
if (!midsession /*||midsession*/ ) {
/*
* The Connection/Proxy panel.
*/
@@ -4019,6 +4058,13 @@ 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
@@ -1572,6 +1572,7 @@ NORETURN void cleanup_exit(int);
X(INT, NONE, scp_auto_pwd) \
X(BOOL, NONE, no_focus_rep) /* totally disable mouse reporting */ \
X(INT, NONE, scrolllines) /* Options for Scroll Lines per Wheel */ \
X(BOOL, NONE, ssh_tunnel_print_in_title) /* print dynamic port number in window title */ \
/* #endif */ \
/* #ifdef MOD_PROXY */ \
X(STR, NONE, proxyselection) /* Options for proxy selection */ \
+2
View File
@@ -931,6 +931,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf)
write_setting_i(sesskey, "SCPAutoPwd", conf_get_int(conf, CONF_scp_auto_pwd));
write_setting_b(sesskey, "NoFocusReporting", conf_get_bool(conf, CONF_no_focus_rep));
write_setting_i(sesskey, "LinesAtAScroll", conf_get_int(conf, CONF_scrolllines));
write_setting_b(sesskey, "SSHTunnelInTitle", conf_get_bool(conf, CONF_ssh_tunnel_print_in_title));
#endif
#ifdef MOD_PORTKNOCKING
write_setting_s(sesskey, "PortKnocking", conf_get_str(conf, CONF_portknockingoptions) );
@@ -1601,6 +1602,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
gppi(sesskey, "SCPAutoPwd", 0, conf, CONF_scp_auto_pwd);
gppb(sesskey, "NoFocusReporting", true, conf, CONF_no_focus_rep);
gppi(sesskey, "LinesAtAScroll", -1, conf, CONF_scrolllines);
gppb(sesskey, "SSHTunnelInTitle", false, conf, CONF_ssh_tunnel_print_in_title);
#endif
#ifdef MOD_PORTKNOCKING
gpps(sesskey, "PortKnocking", "", conf, CONF_portknockingoptions );
+1
View File
@@ -26,6 +26,7 @@ typedef struct agent_key {
#ifdef MOD_PERSO
#include "kitty.h"
void SetSSHConnected( int flag );
void debug_logevent( const char *fmt, ... ) ;
size_t iso8859_1_to_utf8(char *content, size_t max_size) ; // Latin-1 = iso8859-1
size_t utf8_to_iso8859_15(char *const output, const char *const input, const size_t length) ; // Latin-9 = iso8859-15
char bufpass[1024]="";
+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,1
#define BINARY_VERSION 0,74,4,2
#define SOURCE_COMMIT "unavailable"
+2 -2
View File
@@ -241,7 +241,7 @@ plink.exe: agentf.o aqsync.o \
winnpc.o winnps.o winpgntc.o winplink.o winproxy.o \
winsecur.o winser.o winshare.o winstore.o wintime.o winucs.o \
winx11.o x11fwd.o \
adb.o kitty_registry.o kitty_commun.o kitty_ssh.o kitty_store.o kitty_tools.o
adb.o kitty_registry.o kitty_commun.o kitty_proxy.o kitty_ssh.o kitty_store.o kitty_tools.o
$(CC) $(LDFLAGS) -o $@ -Wl,-Map,plink.map agentf.o aqsync.o \
be_all_s_plink.o \
be_misc.o callback.o cmdline.o conf.o cproxy.o \
@@ -265,7 +265,7 @@ plink.exe: agentf.o aqsync.o \
winmiscs.o winnet.o winnohlp.o winnoise.o winnojmp.o \
winnpc.o winnps.o winpgntc.o winplink.o winproxy.o \
winsecur.o winser.o winshare.o winstore.o wintime.o winucs.o \
adb.o kitty_registry.o kitty_commun.o kitty_ssh.o kitty_store.o kitty_tools.o \
adb.o kitty_registry.o kitty_commun.o kitty_proxy.o kitty_ssh.o kitty_store.o kitty_tools.o \
../../base64/base64.a ../../bcrypt/bcrypt.a ../../mini/mini.a \
winx11.o x11fwd.o -ladvapi32 -lcomdlg32 -lgdi32 -limm32 \
-lole32 -lshell32 -luser32 \
+1 -1
View File
@@ -63,7 +63,7 @@ BEGIN
VALUE "FileVersion", TEXTVER
#endif
#if (defined MOD_PERSO) && (!defined FLJ)
VALUE "ProductVersion", TEXTVER " - Additional features on KiTTY That's all folks! by 9bis.com, 2005-2020"
VALUE "ProductVersion", TEXTVER " - Additional features on KiTTY That's all folks! by 9bis.com, 2005-2021"
#else
VALUE "ProductVersion", TEXTVER
#endif
+1 -1
View File
@@ -1 +1 @@
1
2
+1 -1
View File
@@ -217,7 +217,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
ICON IDI_MAINICON_0,IDC_STATIC,7,7,30,20
LTEXT "",IDA_VERSION,45,7,198,8
LTEXT "Copyright \251 2005-2020",IDC_STATIC,45,19,78,8
LTEXT "Copyright \251 2005-2021",IDC_STATIC,45,19,78,8
LTEXT "9bis software - https://www.9bis.net/kitty",
IDC_WEBPAGE,45,31,145,8
LTEXT "Contact:",IDC_STATIC,45,43,46,8
+1 -1
View File
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg,
#if (defined MOD_PERSO) && (!defined FLJ)
//static const char MESSAGE[] = "";
static const char MESSAGE[] = " KiTTY software is developed by Cyd for 9bis.com, copyright \251 2005-2020, thanks to Leo for bcrypt and mini libraries, thanks to all contributors " ;
static const char MESSAGE[] = " KiTTY software is developed by Cyd for 9bis.com, copyright \251 2005-2021, thanks to Leo for bcrypt and mini libraries, thanks to all contributors " ;
static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
+7
View File
@@ -7514,6 +7514,7 @@ static void wintw_set_title(TermWin *tw, const char *title_in) {
}
if( GetProtectFlag() ) if( strstr(buffer, " (PROTECTED)")==NULL ) { strcat( buffer, " (PROTECTED)" ) ; }
if( conf_get_bool(conf, CONF_alwaysontop) ) if( strstr(buffer, " (ONTOP)")==NULL ) { strcat( buffer, " (ONTOP)" ) ; }
if( conf_get_bool(conf, CONF_ssh_tunnel_print_in_title) ) if( strstr(buffer, " (SOCKS: ")==NULL ) { make_title( fmt, " (SOCKS: %s)", "%%d") ; strcat( buffer, fmt ) ; }
set_title_internal( tw, buffer ) ;
free(title);
free(buffer);
@@ -8148,6 +8149,9 @@ static void process_clipdata(HGLOBAL clipdata, bool unicode)
clipboard_contents = snewn(clipboard_length + 1, wchar_t);
memcpy(clipboard_contents, p, clipboard_length * sizeof(wchar_t));
clipboard_contents[clipboard_length] = L'\0';
#ifdef MOD_PERSO
if( (GetPasteSize()==0) || (clipboard_length<=GetPasteSize()) || MessageBox(NULL,"Clipboard content is very large.\nAre you sure ?","Confirmation",MB_YESNO|MB_ICONWARNING)==IDYES )
#endif
term_do_paste(term, clipboard_contents, clipboard_length);
}
} else {
@@ -8161,6 +8165,9 @@ static void process_clipdata(HGLOBAL clipdata, bool unicode)
clipboard_contents, i);
clipboard_length = i - 1;
clipboard_contents[clipboard_length] = L'\0';
#ifdef MOD_PERSO
if( (GetPasteSize()==0) || (clipboard_length<=GetPasteSize()) || MessageBox(NULL,"Clipboard content is very large.\nAre you sure ?","Confirmation",MB_YESNO|MB_ICONWARNING)==IDYES )
#endif
term_do_paste(term, clipboard_contents, clipboard_length);
}
}
+5
View File
@@ -551,6 +551,11 @@ int main(int argc, char **argv)
else
return 1;
}
#ifdef MOD_PROXY
if( GetProxySelectionFlag() ) {
LoadProxyInfo( conf, conf_get_str(conf,CONF_proxyselection) ) ;
}
#endif
#ifdef MOD_PORTKNOCKING
ManagePortKnocking(conf_get_str(conf,CONF_host),conf_get_str(conf,CONF_portknockingoptions));
#endif
+4
View File
@@ -398,6 +398,10 @@ void del_settings(const char *sessionname)
char *p, *p2;
if( GetReadOnlyFlag() ) return ;
if( (strstr( sessionname, " [" )==sessionname)&&(sessionname[strlen(sessionname)-1]==']') ) {
if( !strcmp(sessionname," [..]") ) {
MessageBox(NULL,"It is not allowed to delete .. directory","Error",MB_OK|MB_ICONERROR) ;
return ;
}
// La session a purger est un folder
p = snewn(3 * strlen(sessionname) + 1, char);
strcpy( p, sessionname+2 ) ;
Binary file not shown.
+1 -1
View File
@@ -49,5 +49,5 @@ BEGIN
NOTEPAD_FILE_FILTER "Text files, (*.txt, *.ini)|*.txt;*.ini|C/C++ files, (*.c, *.cpp, *.h, *.rc)|*.c;*.cpp;*.h;*.rc|Script files, (*.ksh, *.sh)|*.ksh;*.sh\0SQL files, (*.sql)|*.sql|All files, (*.*)|*.*\0"
NOTEPAD_STR_LICENCE " mNotepad 1.0\nwritten by Cyd, 2020, for the Telnet/SSH client TTY"
NOTEPAD_STR_LICENCE " mNotepad 1.0\nwritten by Cyd, 2021, for the Telnet/SSH client TTY"
END
+1 -1
View File
@@ -1 +1 @@
0.74.4.1
0.74.4.2
+23 -2
View File
@@ -93,6 +93,11 @@ char * PasteCommand = NULL ;
static int PasteCommandFlag = 0 ;
int GetPasteCommandFlag(void) { return PasteCommandFlag ; }
// paste size limit (number of characters). Above the limit a confirmation is requested. (0 means unlimited)
static int PasteSize = 0 ;
int GetPasteSize(void) { return PasteSize ; }
void SetPasteSize( const int size ) { PasteSize = size ; }
// Flag de gestion de la fonction hyperlink
#ifdef FLJ
int HyperlinkFlag = 1 ;
@@ -4385,6 +4390,7 @@ int Convert2Dir( const char * Directory ) {
sprintf( buffer, "%s\\Commands", Directory ) ; DelDir( buffer) ; MakeDirTree( Directory, "Commands", "Commands" ) ;
sprintf( buffer, "%s\\Launcher", Directory ) ; DelDir( buffer) ; MakeDirTree( Directory, "Launcher", "Launcher" ) ;
sprintf( buffer, "%s\\Folders", Directory ) ; DelDir( buffer) ; MakeDirTree( Directory, "Folders", "Folders" ) ;
sprintf( buffer, "%s\\Commands", Directory ) ; DelDir( buffer) ; MakeDirTree( Directory, "Commands", "Commands" ) ;
sprintf( buffer, "%s\\Sessions", Directory ) ; DelDir( buffer) ; {
if(!MakeDir( buffer )) MessageBox(NULL,"Unable to create directory for storing sessions","Error",MB_OK|MB_ICONERROR);
@@ -4456,7 +4462,21 @@ int Convert2Dir( const char * Directory ) {
}
RegCloseKey( hKey ) ;
}
#ifdef MOD_PROXY
sprintf( buffer, "%s\\Proxies", Directory ) ; DelDir( buffer) ; if( !MakeDir( buffer ) ) {
MessageBox(NULL,"Unable to create directory for storing proxies definition","Error",MB_OK|MB_ICONERROR) ;
}
sprintf( buffer, "%s\\Proxies", TEXT(PUTTY_REG_POS) ) ;
if( RegOpenKeyEx( HKEY_CURRENT_USER, TEXT(buffer), 0, KEY_READ, &hKey) == ERROR_SUCCESS ) {
if( RegQueryInfoKey(hKey,achClass,&cchClassName,NULL,&cSubKeys,&cbMaxSubKey
,&cchMaxClass,&cValues,&cchMaxValue,&cbMaxValueData,&cbSecurityDescriptor,&ftLastWriteTime) == ERROR_SUCCESS ) {
if (cSubKeys) for (i=0; i<cSubKeys; i++) {
}
}
RegCloseKey( hKey ) ;
}
#endif
if( delkeyflag ) { RegDelTree (HKEY_CURRENT_USER, TEXT(PUTTY_REG_PARENT) ) ; }
return 0;
@@ -5192,7 +5212,8 @@ void LoadParameters( void ) {
if( !stricmp( buffer, "NO" ) ) MouseShortcutsFlag = 0 ;
if( !stricmp( buffer, "YES" ) ) MouseShortcutsFlag = 1 ;
}
if( ReadParameter( INIT_SECTION, "paste", buffer ) ) { if( !stricmp( buffer, "YES" ) ) PasteCommandFlag = 1 ; }
if( ReadParameter( INIT_SECTION, "paste", buffer ) ) { if( !stricmp( buffer, "YES" ) ) PasteCommandFlag = 1 ; }
if( ReadParameter( INIT_SECTION, "pastesize", buffer ) ) { if( atoi(buffer)>0 ) SetPasteSize( atoi(buffer) ) ; }
if( ReadParameter( INIT_SECTION, "PSCPPath", buffer ) ) {
if( existfile( buffer ) ) {
if( PSCPPath!=NULL) { free(PSCPPath) ; PSCPPath = NULL ; }
+4
View File
@@ -136,6 +136,10 @@ extern char * ScriptCommand ;
extern char * PasteCommand ;
int GetPasteCommandFlag(void) ;
// paste size limit (number of characters). Above the limit a confirmation is requested. (0 means unlimited)
int GetPasteSize(void) ;
void SetPasteSize( const int size ) ;
// Flag de gestion de la fonction hyperlink
extern int HyperlinkFlag ;
int GetHyperlinkFlag(void) ;
+3
View File
@@ -137,6 +137,9 @@ mouseshortcuts=yes
; paste: enable/disable one line at a time feature in paste action (useful on slow servers only)
paste=no
; pastesize: paste size limit (number of characters). Above the limit a confirmation is requested. (0 means unlimited)
;pastesize=0
; PlinkPath: the full path to the plink.exe (or klink.exe) binary
;PlinkPath=
+1 -1
View File
@@ -578,7 +578,7 @@ LRESULT CALLBACK Launcher_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
case WM_COMMAND: {//Commandes du menu
switch( LOWORD(wParam) ) {
case IDM_ABOUT:
MessageBox(hwnd," TTY Launcher\nSession launcher for TTY terminal emulator\n(c), 2009-2020","About", MB_OK ) ;
MessageBox(hwnd," TTY Launcher\nSession launcher for TTY terminal emulator\n(c), 2009-2021","About", MB_OK ) ;
break ;
case IDM_QUIT:
ResShell = Shell_NotifyIcon(NIM_DELETE, &TrayIcone) ;
+57 -71
View File
@@ -3,6 +3,7 @@
#include "kitty_tools.h"
#include "kitty_registry.h"
#include "kitty_proxy.h"
#include "kitty_store.h"
#include "dialog.h"
#include "storage.h"
#include <sys/types.h>
@@ -17,51 +18,8 @@ void SetProxySelectionFlag( const int flag ) { ProxySelectionFlag = flag ; }
void debug_logevent( const char *fmt, ... ) ;
#define MAX_PROXY 100
struct Proxies {
char *name;
int val;
} proxies[MAX_PROXY] ;
struct Proxies proxies[MAX_PROXY] ;
void proxy_selection_handler(union control *ctrl, dlgparam *dlg, void *data, int event) {
int i, j;
Conf *conf = (Conf *)data;
if (event == EVENT_REFRESH) {
/* Fetching this once at the start of the function ensures we
* remember what the right value is supposed to be when
* operations below cause reentrant calls to this function. */
char * oldproxy = conf_get_str(conf, CONF_proxyselection);
dlg_update_start(ctrl, dlg);
dlg_listbox_clear(ctrl, dlg);
for (i = 0; i < lenof(proxies); i++) {
if( proxies[i].name==NULL ) break ;
dlg_listbox_addwithid(ctrl, dlg, proxies[i].name, proxies[i].val);
}
for (i = j = 0; i < lenof(proxies); i++) {
if( proxies[i].name==NULL ) break ;
if ( !strcmp(oldproxy,proxies[i].name) ) {
dlg_listbox_select(ctrl, dlg, i);
break;
}
j++;
}
if (i == lenof(proxies)) { /* an unsupported setting was chosen */
dlg_listbox_select(ctrl, dlg, 0);
oldproxy = NULL;
}
dlg_update_done(ctrl, dlg);
if( oldproxy!=NULL ) conf_set_str(conf, CONF_proxyselection, oldproxy); /* restore */
} else if (event == EVENT_SELCHANGE) {
int i = dlg_listbox_index(ctrl, dlg);
if (i < 0)
i = 0;
else
i = dlg_listbox_getid(ctrl, dlg, i);
conf_set_str(conf, CONF_proxyselection, proxies[i].name);
}
}
void InitProxyList(void) {
HKEY hKey ;
int i,j;
@@ -129,10 +87,16 @@ int LoadProxyInfo( Conf * conf, const char * name ) {
debug_logevent( "Load proxy \"%s\" definition", name ) ;
if( (IniFileFlag == SAVEMODE_REG)||(IniFileFlag == SAVEMODE_FILE) ) {
HKEY hKey ;
sprintf( buffer, "%s\\Proxies\\%s", PUTTY_REG_POS, name ) ;
sprintf( buffer, "%s\\Proxies\\", PUTTY_REG_POS ) ;
char *b = (char*)malloc(4*strlen(name)+1);
mungestr(name,b);
strcat(buffer,b);
free(b);
if( RegOpenKeyEx( HKEY_CURRENT_USER, buffer, 0, KEY_READ, &hKey) != ERROR_SUCCESS ) return 0;
char lpData[4096] ;
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyExcludeList", lpData ) ) { conf_set_str( conf, CONF_proxy_exclude_list, lpData ) ; }
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyExcludeList", lpData ) ) {
conf_set_str( conf, CONF_proxy_exclude_list, lpData ) ;
}
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyDNS", lpData ) ) {
int i=atoi(lpData);
conf_set_int(conf, CONF_proxy_dns, (i+1)%3);
@@ -142,30 +106,15 @@ int LoadProxyInfo( Conf * conf, const char * name ) {
} else { conf_set_bool( conf, CONF_even_proxy_localhost, true ) ;
}
}
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyMethod", lpData ) ) {
conf_set_int(conf, CONF_proxy_type, atoi(lpData) ) ;
if (conf_get_int(conf, CONF_proxy_type) == -1) {
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyType", lpData ) ) {
int i = atoi(lpData) ;
if (i == 0)
conf_set_int(conf, CONF_proxy_type, PROXY_NONE);
else if (i == 1)
conf_set_int(conf, CONF_proxy_type, PROXY_HTTP);
else if (i == 3)
conf_set_int(conf, CONF_proxy_type, PROXY_TELNET);
else if (i == 4)
conf_set_int(conf, CONF_proxy_type, PROXY_CMD);
else {
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxySOCKSVersion", lpData ) ) {
i = atoi(lpData);
if (i == 5)
conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS5);
else
conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS4);
} else { conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS5); }
}
} else { conf_set_int(conf, CONF_proxy_type, PROXY_NONE); }
}
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyMethod", lpData ) ) {
int i = atoi(lpData) ;
if (i == 0) conf_set_int(conf, CONF_proxy_type, PROXY_NONE);
else if (i == 1) conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS4) ;
else if (i == 2) conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS5) ;
else if (i == 3) conf_set_int(conf, CONF_proxy_type, PROXY_HTTP) ;
else if (i == 4) conf_set_int(conf, CONF_proxy_type, PROXY_TELNET) ;
else if (i == 5) conf_set_int(conf, CONF_proxy_type, PROXY_CMD) ;
else conf_set_int(conf, CONF_proxy_type, PROXY_NONE) ;
}
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyHost", lpData ) ) { conf_set_str( conf, CONF_proxy_host, lpData ) ; }
if( GetValueData(HKEY_CURRENT_USER, buffer, "ProxyPort", lpData ) ) { conf_set_int( conf, CONF_proxy_port, atoi(lpData) ) ; }
@@ -180,7 +129,44 @@ int LoadProxyInfo( Conf * conf, const char * name ) {
mungestr( name, filename ) ;
sprintf( fullpath, "%s\\Proxies\\%s", ConfigDirectory, filename ) ;
if( existfile(fullpath) ) {
FILE *fp;
if( (fp=fopen(fullpath,"r")) != NULL ) {
char buf2[MAX_VALUE_NAME]="";
while( fgets(buffer,MAX_VALUE_NAME,fp)!=NULL ) {
if( ReadPortableValue(buffer, "ProxyExcludeList", buf2, MAX_VALUE_NAME) ) {
conf_set_str( conf, CONF_proxy_exclude_list, buf2 ) ;
} else if( ReadPortableValue(buffer, "ProxyDNS", buf2, MAX_VALUE_NAME) ) {
int i=atoi(buf2);
conf_set_int(conf, CONF_proxy_dns, (i+1)%3);
} else if( ReadPortableValue(buffer, "ProxyLocalhost", buf2, MAX_VALUE_NAME) ) {
if( atoi(buf2) == 0 ) { conf_set_bool( conf, CONF_even_proxy_localhost, false ) ;
} else { conf_set_bool( conf, CONF_even_proxy_localhost, true ) ;
}
} else if( ReadPortableValue(buffer, "ProxyMethod", buf2, MAX_VALUE_NAME) ) {
int i = atoi(buf2) ;
if (i == 0) conf_set_int(conf, CONF_proxy_type, PROXY_NONE);
else if (i == 1) conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS4) ;
else if (i == 2) conf_set_int(conf, CONF_proxy_type, PROXY_SOCKS5) ;
else if (i == 3) conf_set_int(conf, CONF_proxy_type, PROXY_HTTP) ;
else if (i == 4) conf_set_int(conf, CONF_proxy_type, PROXY_TELNET) ;
else if (i == 5) conf_set_int(conf, CONF_proxy_type, PROXY_CMD) ;
else conf_set_int(conf, CONF_proxy_type, PROXY_NONE) ;
} else if( ReadPortableValue(buffer, "ProxyHost", buf2, MAX_VALUE_NAME) ) {
conf_set_str( conf, CONF_proxy_host, buf2 ) ;
} else if( ReadPortableValue(buffer, "ProxyPort", buf2, MAX_VALUE_NAME) ) {
conf_set_int( conf, CONF_proxy_port, atoi(buf2) ) ;
} else if( ReadPortableValue(buffer, "ProxyUsername", buf2, MAX_VALUE_NAME) ) {
conf_set_str( conf, CONF_proxy_username, buf2 ) ;
} else if( ReadPortableValue(buffer, "ProxyPassword", buf2, MAX_VALUE_NAME) ) {
conf_set_str( conf, CONF_proxy_password, buf2 ) ;
} else if( ReadPortableValue(buffer, "ProxyTelnetCommand", buf2, MAX_VALUE_NAME) ) {
conf_set_str( conf, CONF_proxy_telnet_command, buf2 ) ;
} else if( ReadPortableValue(buffer, "ProxyLogToTerm", buf2, MAX_VALUE_NAME) ) {
conf_set_int( conf, CONF_proxy_log_to_term, atoi(buf2) ) ;
}
}
fclose(fp);
}
}
free( filename ) ;
}
+8 -1
View File
@@ -1,9 +1,16 @@
#ifndef KITTY_PROXY
#define KITTY_PROXY
#define MAX_PROXY 100
struct Proxies {
char *name;
int val;
};
extern struct Proxies proxies[MAX_PROXY] ;
int GetProxySelectionFlag() ;
void SetProxySelectionFlag( const int flag ) ;
int LoadProxyInfo( Conf * conf, const char * name ) ;
void proxy_selection_handler(union control *ctrl, dlgparam *dlg, void *data, int event) ;
void InitProxyList(void) ;
int LoadProxyInfo( Conf * conf, const char * name ) ;
#endif
+3 -1
View File
@@ -586,6 +586,7 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) {
fprintf( fp, "scp_auto_pwd=%d\n", conf_get_int(conf, CONF_scp_auto_pwd));
fprintf( fp, "no_focus_rep=%d\n", conf_get_bool(conf,CONF_no_focus_rep) ) ;
fprintf( fp, "scrolllines=%d\n", conf_get_int(conf,CONF_scrolllines) ) ;
fprintf( fp, "ssh_tunnel_print_in_title=%d\n", conf_get_bool(conf,CONF_ssh_tunnel_print_in_title) ) ;
#endif
#ifdef MOD_PRINTCLIP
fprintf( fp, "printclip=%d\n", conf_get_int(conf,CONF_printclip) ) ;
@@ -677,7 +678,8 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) {
if( AutoCommand!= NULL ) fprintf( fp, "AutoCommand=%s\n", AutoCommand ) ;
if( ScriptCommand!= NULL ) fprintf( fp, "ScriptCommand=%s\n", ScriptCommand ) ;
if( PasteCommand!= NULL ) fprintf( fp, "PasteCommand=%s\n", PasteCommand ) ;
fprintf( fp, "PasteCommandFlag=%d\n", PasteCommandFlag );
fprintf( fp, "PasteCommandFlag=%d\n", PasteCommandFlag ) ;
fprintf( fp, "PasteSize=%d\n", GetPasteSize() ) ;
if( ScriptFileContent!= NULL ) {
char * pst = ScriptFileContent ;
fprintf( fp, "ScriptFileContent=" ) ;
+2
View File
@@ -434,6 +434,7 @@ void save_open_settings_forced(char *filename, Conf *conf) {
write_setting_i_forced(sesskey, "SCPAutoPwd", conf_get_int(conf, CONF_scp_auto_pwd));
write_setting_b_forced(sesskey, "NoFocusReporting", conf_get_bool(conf, CONF_no_focus_rep));
write_setting_i_forced(sesskey, "LinesAtAScroll", conf_get_int(conf, CONF_scrolllines));
write_setting_b_forced(sesskey, "SSHTunnelInTitle", conf_get_bool(conf, CONF_ssh_tunnel_print_in_title));
#endif
#ifdef MOD_PORTKNOCKING
write_setting_s_forced(sesskey, "PortKnocking", conf_get_str(conf, CONF_portknockingoptions) );
@@ -1069,6 +1070,7 @@ void load_open_settings_forced(char *filename, Conf *conf) {
gppi_forced(sesskey, "SCPAutoPwd", 0, conf, CONF_scp_auto_pwd);
gppb_forced(sesskey, "NoFocusReporting", true, conf, CONF_no_focus_rep);
gppi_forced(sesskey, "LinesAtAScroll", 5, conf, CONF_scrolllines);
gppb_forced(sesskey, "SSHTunnelInTitle", false, conf, CONF_ssh_tunnel_print_in_title);
#endif
#ifdef MOD_PORTKNOCKING
gpps_forced(sesskey, "PortKnocking", "", conf, CONF_portknockingoptions );
+22
View File
@@ -726,3 +726,25 @@ void SettingTest( void ) {
}
*/
bool ReadPortableValue(const char *buffer, const char * name, char * value, const int maxlen) {
bool test = false ;
if( (buffer==NULL) || (name==NULL) ) { return false ; }
if( (strlen(buffer)==0) || (strlen(name)==0) ) { return false ; }
if( maxlen<=0 ) { return false ; }
char *b = (char*)malloc(strlen(name)+2), *pst ;
sprintf(b,"%s\\",name) ;
if( strstr(buffer,b)==buffer ) {
pst = (char*)buffer + strlen(b) ;
test = true ;
value[0]='\0';
if( strlen(pst)>1 )
if( (strlen(pst)<=maxlen) && (pst[strlen(pst)-2]=='\\') ) {
memcpy( value, pst, strlen(pst)-2 ) ;
value[strlen(pst)-2] = '\0' ;
}
unmungestr( value, value, MAX_VALUE_NAME ) ;
}
free(b) ;
return test ;
}
+2
View File
@@ -67,3 +67,5 @@ int loadPath() ;
char * GetSessPath( void ) ;
bool SessPathIsInitial( void ) ;
bool IsThereDefaultSessionFile( void ) ;
bool ReadPortableValue(const char *buffer, const char * name, char * value, const int maxlen) ;