Skip to content

Commit

Permalink
Don't output SET LOGIN PROMPT and PASSWORD in script
Browse files Browse the repository at this point in the history
If no login prompt or password has been set.

Fixes #281 (K95 bug 797)
  • Loading branch information
davidrg committed Nov 14, 2024
1 parent 1115a87 commit 6178f22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions doc/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ by OpenSSH on modern versions of windows, add the command
* Fixed emacs turning off mouse reporting when started
* Fixed K95G hanging when closing the window or using File->Exit with when
a connection is active and GUI dialogs are turned off
* Fixed K95 bug 797: Dialer generated connection scripts will no longer include
`SET LOGIN PROMPT` or `SET LOGIN PASSWORD` commands if those fields do not
have a value as this broke the use of the standard login.ksc script.

### Other Source Changes
* Fixed a selection of build warnings, and improved compatibility with the
Expand Down
12 changes: 7 additions & 5 deletions kermit/dialer/kconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6166,10 +6166,12 @@ GenerateScript( KD_LIST_ITEM * entry, KD_CONFIG * config,
int anonymous = !stricmp(entry->_userid,"anonymous") ||
!stricmp(entry->_userid,"ftp");

if ( entry->_password && !anonymous ) {
if ( !entry->_prompt_for_password )
sprintf(tmp, "set login password {%s}", entry->_password );
else {
if ( entry->_password
&& (strlen(entry->_password) > 0 || entry->_prompt_for_password)
&& !anonymous ) {
if ( !entry->_prompt_for_password ) {
sprintf(tmp, "set login password {%s}", entry->_password);
} else {
/* Prompt for Password */
ZIL_ICHAR password[PASSWD_SZ];
ZIL_UINT8 ok=0;
Expand All @@ -6188,7 +6190,7 @@ GenerateScript( KD_LIST_ITEM * entry, KD_CONFIG * config,
OUTFILE(BuildOutStr(buf, "", tmp));
OUTFILE("set command quoting on\n");
}
if ( entry->_prompt ) {
if ( entry->_prompt && strlen(entry->_prompt) > 0) {
sprintf(tmp, "set login prompt {%s}", entry->_prompt);
OUTFILE(BuildOutStr(buf, "", tmp));
}
Expand Down

0 comments on commit 6178f22

Please sign in to comment.