Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in latest changes from Frank #254

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions kermit/k95/ck_crp.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ static char * tmpstring = NULL;
#ifdef CRYPT_DLL
int cmd_quoting = 0;

#ifdef OS2
/* Copied from ckctel.c */
char *
#ifdef CK_ANSIC
tel_unk(int opt) /* "UNKNOWN-%u" string. */
#else
tel_unk(opt) int opt;
#endif /* CK_ANSIC */
{
/* 2024-03-27 SMS. Added (decimal) value to "UNKNOWN" messages. */
static char val_str[ 20];
sprintf(val_str, "UNKNOWN-%u", opt);
return(val_str);
}
#endif /* OS2 */

#ifndef TELOPT_MACRO
int
telopt_index(opt) int opt; {
Expand Down
35 changes: 34 additions & 1 deletion kermit/k95/ck_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,11 @@ ssl_http_init(hostname) char * hostname;
#endif /* NOHTTP */

char *
#ifdef CK_ANSIC
ssl_get_dNSName(SSL *ssl)
#else
ssl_get_dNSName(ssl) SSL * ssl;
#endif /* CK_ANSIC */
{
static char *dns = NULL;
X509 *server_cert = NULL;
Expand Down Expand Up @@ -2732,7 +2736,12 @@ ssl_get_dNSName(ssl) SSL * ssl;
}

char *
ssl_get_commonName(ssl) SSL * ssl; {
#ifdef CK_ANSIC
ssl_get_commonName(SSL *ssl)
#else
ssl_get_commonName(ssl) SSL * ssl;
#endif /* CK_ANSIC */
{
static char name[256];
int name_text_len;
int err;
Expand Down Expand Up @@ -2761,7 +2770,11 @@ ssl_get_commonName(ssl) SSL * ssl; {
}

char *
#ifdef CK_ANSIC
ssl_get_issuer_name(SSL *ssl)
#else
ssl_get_issuer_name(ssl) SSL * ssl;
#endif /* CK_ANSIC */
{
static char name[256];
X509 *server_cert;
Expand All @@ -2781,7 +2794,11 @@ ssl_get_issuer_name(ssl) SSL * ssl;
}

char *
#ifdef CK_ANSIC
ssl_get_subject_name(SSL *ssl)
#else
ssl_get_subject_name(ssl) SSL * ssl;
#endif /* CK_ANSIC */
{
static char name[256];
X509 *server_cert;
Expand Down Expand Up @@ -3030,7 +3047,11 @@ ssl_verify_crl(int ok, X509_STORE_CTX *ctx)
}

char *
#ifdef CK_ANSIC
tls_userid_from_client_cert(SSL *ssl)
#else
tls_userid_from_client_cert(ssl) SSL * ssl;
#endif /* CK_ANSIC */
{
/* DavidG 2022-09-05: On Windows and OS/2, X509_to_user is expected to be
* provided by a user-supplied DLL as described here:
Expand Down Expand Up @@ -4023,7 +4044,11 @@ ck_tn_tls_negotiate(VOID)
}

int
#ifdef CK_ANSIC
ck_ssl_incoming(int fd)
#else
ck_ssl_incoming(fd) int fd;
#endif /* CK_ANSIC */
{
/* if we are not running in debug then any error
* stuff from SSL debug *must* not go down
Expand Down Expand Up @@ -4194,7 +4219,11 @@ ck_ssl_incoming(fd) int fd;
}

int
#ifdef CK_ANSIC
ck_ssl_outgoing(int fd)
#else
ck_ssl_outgoing(fd) int fd;
#endif /* CK_ANSIC */
{
int timo = 2000;

Expand Down Expand Up @@ -4371,7 +4400,11 @@ ck_ssl_outgoing(fd) int fd;

#ifndef NOHTTP
int
#ifdef CK_ANSIC
ck_ssl_http_client(int fd, char *hostname)
#else
ck_ssl_http_client(fd, hostname) int fd; char * hostname;
#endif /* CK_ANSIC */
{
int timo = 2000;

Expand Down
84 changes: 78 additions & 6 deletions kermit/k95/ckcdeb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1405,9 +1405,6 @@ extern int errno; /* fdc 1 November 2022 */
#else /* def __ALPHA */
#ifdef __ia64
#define VMS64
#ifndef VMSI64
#define VMSI64 /* See ckvtio.c. Pointless now? */
#endif /* ndef VMSI64 */
#else /* def __ia64 */
#ifdef __x86_64
#define VMS64
Expand Down Expand Up @@ -2705,15 +2702,24 @@ _PROTOTYP( void bleep, (short) );

#ifndef NOFLOAT

#ifdef __alpha /* Why only __alpha? Other 64-bit systems? */
#define FLT_NOT_DBL /* (See also ckclib.c:ckround()). */
#else /* def __alpha */
#ifdef VMS64
#define FLT_NOT_DBL /* Was testing only __alpha below. */
#endif /* def VMS64 */
#endif /* def __alpha [else] */

#ifndef CKFLOAT
#ifdef __alpha
#ifdef FLT_NOT_DBL /* 2024-05-16 SMS. Use instead of __alpha. */
/* Don't use double on 64-bit platforms -- bad things happen */
/* "double" on 64-bit platforms typically means 128-bit? Do we care?*/
#define CKFLOAT float
#define CKFLOAT_S "float"
#else
#else /* def FLT_NOT_DBL */
#define CKFLOAT double
#define CKFLOAT_S "double"
#endif /* __alpha */
#endif /* def FLT_NOT_DBL [else] */
#endif /* CKFLOAT */

#ifndef NOGFTIMER /* Floating-point timers */
Expand Down Expand Up @@ -6438,6 +6444,72 @@ extern int _flsbuf(char c,FILE *stream);
* obsolete value, which is why NAMX_C_MAXRSS is used instead.
*/

/* Maximum length for a simple filename, not counting \0 at end. */
/*
Define maximum length for a file name if not already defined.
NOTE: This applies to a path segment (directory or file name),
not the entire path string, which can be CKMAXPATH bytes long.
*/

/* On VMS, this is ill-defined, and depends on the file system:
* ODS2: 39.39 + version (;32767), so 84.
* ODS5: 238 + version (;32767), so 233.
*/
#ifndef CKMAXNAM
#ifdef VMS
#ifdef NAML$C_BID
#define CKMAXNAM 233 /* ODS5 possible. */
#else
#define CKMAXNAM 84 /* ODS5 unknown. */
#endif /* def NAML$C_BID */
#else /* def VMS */
/* Non-VMS definitions moved here from ckufio.c. with MAXNAMLEN -> CKMAXNAM. */

#ifndef CKMAXNAM /* If MAXNAMLEN is defined, then use that. */
#ifdef MAXNAMLEN
#define CKMAXNAM MAXNAMLEN
#endif /* def MAXNAMLEN */
#endif /* ndef CKMAXNAM */

#ifdef QNX
#ifdef _MAX_FNAME
#define CKMAXNAM _MAX_FNAME
#else
#define CKMAXNAM 48
#endif /* _MAX_FNAME */
#else
#ifndef CKMAXNAM
#ifdef sun
#define CKMAXNAM 255
#else
#ifdef FILENAME_MAX
#define CKMAXNAM FILENAME_MAX
#else
#ifdef NAME_MAX
#define CKMAXNAM NAME_MAX
#else
#ifdef _POSIX_NAME_MAX
#define CKMAXNAM _POSIX_NAME_MAX
#else
#ifdef _D_NAME_MAX
#define CKMAXNAM _D_NAME_MAX
#else
#ifdef DIRSIZ
#define CKMAXNAM DIRSIZ
#else
#define CKMAXNAM 14
#endif /* DIRSIZ */
#endif /* _D_NAME_MAX */
#endif /* _POSIX_NAME_MAX */
#endif /* _POSIX_NAME_MAX */
#endif /* NAME_MAX */
#endif /* FILENAME_MAX */
#endif /* sun */
#endif /* CKMAXNAM */
#endif /* QNX */

#endif /* def VMS [else] */

/* Maximum length for the name of a tty device */
#ifndef DEVNAMLEN
#define DEVNAMLEN CKMAXPATH
Expand Down
16 changes: 12 additions & 4 deletions kermit/k95/ckcfns.c
Original file line number Diff line number Diff line change
Expand Up @@ -6399,16 +6399,24 @@ nxtstatus(
}
break;
case 7: {
extern int maxnam;
debug(F101,"nxtstatus case","",7);
sprintf((char *)funcbuf," Filename length limit: %d\n", maxnam);
#ifdef CKMAXNAM
sprintf((char *)funcbuf,
" Filename length limit: %d\n", CKMAXNAM);
#else
*funcbuf = '\0';
#endif /* def CKMAXNAM [else] */
break;
}
case 8: {
extern int maxpath;
debug(F101,"nxtstatus case","",8);
#ifdef CKMAXPATH
sprintf((char *)funcbuf,
" Pathname length limit: %d\n\n", maxpath);
" Pathname length limit: %d\n\n", CKMAXPATH);
#else
*funcbuf = '\0';
#endif /* def CKMAXPATH [else] */

break;
}
default:
Expand Down
2 changes: 1 addition & 1 deletion kermit/k95/ckclib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,7 @@ ckround(fpnum,places,obuf,obuflen)
}
}
if (minus) number--; /* Back up to minus sign, if any. */
#ifdef __alpha
#ifdef FLT_NOT_DBL
sscanf(number,"%f",&value); /* Convert back to floating point */
#else
sscanf(number,"%lf",&value); /* Convert back to floating point */
Expand Down
15 changes: 9 additions & 6 deletions kermit/k95/ckcmai.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* ckcmai.c - Main program for C-Kermit plus some miscellaneous functions */

#define EDITDATE "06 Feb 2024" /* Last edit date dd mmm yyyy */
#define EDITNDATE "20240206" /* Keep them in sync */
/* Tue Feb 6 11:41:35 2024 */
#define EDITDATE "5 Jun 2024" /* Last edit date dd mmm yyyy */
#define EDITNDATE "20240605" /* Keep them in sync */
/* Wed Jun 5 13:44:42 2024 */
/*
As of 27 September 2022 BETATEST is defined in ckcdeb.h, not here,
because it's also used in other modules.
Expand Down Expand Up @@ -104,9 +104,9 @@ int offtsize = 0; /* Size of OFF_T */
Macintosh), just C-Kermit for each platform (except the original Mac).
*/
char *ck_s_ver = "10.0"; /* C-Kermit version string */
char *ck_s_edit = "408"; /* Edit number (for Debian package) */
char *ck_s_xver = "10.0.408"; /* eXtended version string */
long ck_l_ver = 1000408L; /* C-Kermit version number */
char *ck_s_edit = "413"; /* Edit number (for Debian package) */
char *ck_s_xver = "10.0.413"; /* eXtended version string */
long ck_l_ver = 1000413L; /* C-Kermit version number */
char *ck_s_name = "C-Kermit"; /* Name of this program */
char *ck_s_who = ""; /* Where customized, "" = not. */
char *ck_patch = ""; /* Patch info, if any. */
Expand Down Expand Up @@ -1357,6 +1357,9 @@ int deblog = 0, /* Debug log is open */
dest = DEST_D, /* Destination for packet data */
zchkod = 0, /* zchko() should work for dirs too? */
zchkid = 0, /* zchki() should work for dirs too? */
#ifdef VMS
vms_text = VMSTFS, /* VMS text file dflt fmt: Stream_LF */
#endif /* VMS */

/* If you change this, also see struct ptab above... */

Expand Down
25 changes: 22 additions & 3 deletions kermit/k95/ckcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -13966,7 +13966,12 @@ static int rlog_oob( CHAR *, int );
#include "ckcfnp.h" /* Prototypes (must be last) */

int
fwdx_create_listen_socket(screen) int screen; {
#ifdef CK_ANSIC
fwdx_create_listen_socket(int screen)
#else
fwdx_create_listen_socket(screen) int screen;
#endif /* CK_ANSIC */
{
#ifdef NOPUTENV
return(-1);
#else /* NOPUTENV */
Expand Down Expand Up @@ -14046,7 +14051,12 @@ fwdx_create_listen_socket(screen) int screen; {


int
fwdx_open_client_channel(channel) int channel; {
#ifdef CK_ANSIC
fwdx_open_client_channel(int channel)
#else
fwdx_open_client_channel(channel) int channel;
#endif /* CK_ANSIC */
{
char * env;
struct sockaddr_in saddr;
#ifdef FWDX_UNIX_SOCK
Expand Down Expand Up @@ -14465,7 +14475,12 @@ fwdx_open_server_channel() {
}

int
fwdx_close_channel(channel) int channel; {
#ifdef CK_ANSIC
fwdx_close_channel(int channel)
#else
fwdx_close_channel(channel) int channel;
#endif /* CK_ANSIC */
{
int i,fd;

for ( i=0; i<MAXFWDX ; i++ ) {
Expand Down Expand Up @@ -14531,8 +14546,12 @@ fwdx_close_all() {
#endif /* socket_read */

int
#ifdef CK_ANSIC
fwdx_write_data_to_channel(int channel, char *data, int len)
#else
fwdx_write_data_to_channel(channel, data, len)
int channel; char * data; int len;
#endif /* CK_ANSIC */
{
int sock, count, length = len, i;

Expand Down
9 changes: 7 additions & 2 deletions kermit/k95/ckcpro.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
char *wartv = "Wart Version 2.17, 04 February 2024 ";

char *protv = /* -*-C-*- */
"C-Kermit Protocol Module 10.0.169, 3 Feb 2024";
"C-Kermit Protocol Module 10.0.170, 21 Mar 2024";

int kactive = 0; /* Kermit protocol is active */
/*
Expand Down Expand Up @@ -3785,7 +3785,12 @@ _PROTOTYP( int pxyz, (int) );
1: Extended GET processed OK - wait for another.
*/
static int
sgetinit(reget,xget) int reget, xget; { /* Server end of GET command */
#ifdef CK_ANSIC
sgetinit(int reget, int xget)
#else
sgetinit(reget,xget) int reget, xget;
#endif /* CK_ANSIC */
{ /* Server end of GET command */
char * fs = NULL; /* Pointer to filespec */
int i, n, done = 0;
#ifdef PIPESEND
Expand Down
Loading
Loading