[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MVS FTP interface (Was: Re: LYNX-DEV Two bugs in Lynx)
From: |
Paul Gilmartin |
Subject: |
Re: MVS FTP interface (Was: Re: LYNX-DEV Two bugs in Lynx) |
Date: |
Fri, 21 Feb 1997 08:50:00 -0700 (MST) |
In a recent note, Jim Spath said:
> Date: Fri, 21 Feb 1997 08:44:59 -0500 (EST)
>
> I put Paul's patches onto the Lynx2-7 set, and accessed the EPA host:
>
> / directory (p1 of
> 2)
> Current directory is /
> __________________________________________________________________________
> #TCPFTP IBM MVS V3R1 at EPAIBM.RTPNC.EPA.GOV, 08:33:04 on 1997/02/21
> __________________________________________________________________________
> * MICSFILE.CLIST
> * MICSFILE.MSGS
> * MICSFILE.PANELS
> * MICSFILE.SKELS
> * MICSFILE.TABLES
> * NFS.DOC
>
> I then retrieved the last file shown here, which is a one-liner. The
> problem that Paul describes, the long delay in starting up, still exists.
> However, this socket level problem is beyond my ken.
>
Do you mean that if you wait long enough, it actually retrieves a file?
I never had that patience. :-)
Since Jim appears to have had more success than I with my patch, I'll post it
here. Maybe someone else has some insight into the "socket level problem".
I note another hazard: There is now available a POSIX compliant feature of
MVS, OpenEdition. The SYST command returns for classic MVS:
ftp> quote syst
215 MVS is the operating system of this server. FTP Server is the C-server.
and for MVS-OE:
ftp> quote syst
215 MVS is the operating system of this server. FTP Server is the C-server
running on OE.
These are too similar! I think I'll complain to the MVS-OE mailing list.
Note that this is not ready for General Availability.
-- gil
===============================================================================
diff -rc ./orig/lynx2-6/WWW/Library/Implementation/HTFTP.c
./lynx2-6/WWW/Library/Implementation/HTFTP.c
*** ./orig/lynx2-6/WWW/Library/Implementation/HTFTP.c Sun Sep 1 20:20:46 1996
--- ./lynx2-6/WWW/Library/Implementation/HTFTP.c Mon Sep 2 09:03:06 1996
***************
*** 179,188 ****
--- 179,191 ----
#define WINDOWS_NT_SERVER 9
#define MS_WINDOWS_SERVER 10
#define MSDOS_SERVER 11
+ #define MVS_SERVER 12
PRIVATE int server_type = GENERIC_SERVER; /* the type of ftp host */
PRIVATE int unsure_type = FALSE; /* sure about the type? */
PRIVATE BOOLEAN use_list = FALSE; /* use the LIST command? */
+ PRIVATE BOOLEAN strict_1738 = FALSE; /* use the strict RFC 1738 path
semantics */
+ PRIVATE BOOLEAN ascii_host = TRUE; /* server filesystem is ASCII */
PRIVATE interrupted_in_next_data_char = FALSE;
***************
*** 860,865 ****
--- 863,870 ----
(strncmp(response_text+4, "VM ", 3) == 0)) {
server_type = CMS_SERVER;
use_list = TRUE;
+ strict_1738 = TRUE;
+ ascii_host = FALSE;
if (TRACE)
fprintf(stderr, "HTFTP: Treating as CMS server.\n");
***************
*** 895,900 ****
--- 900,912 ----
if (TRACE)
fprintf(stderr, "HTFTP: Treating as MS Windows server.\n");
+ } else if (strncmp(response_text+4, "MVS ", 4) == 0) {
+ server_type = MVS_SERVER;
+ strict_1738 = TRUE;
+ ascii_host = FALSE;
+ if (TRACE)
+ fprintf(stderr, "HTFTP: Ugh! Treating as MVS server.\n");
+
} else {
server_type = GENERIC_SERVER;
if (TRACE)
***************
*** 1734,1739 ****
--- 1746,1756 ----
while (*cp && isspace(*cp))
cp++;
if (!(*cp)) {
+ /** CMS directories appear with no dot in NLST. **/
+ if (!use_list) {
+ StrAllocCopy(entry_info->type, "Directory");
+ return;
+ }
/** If we don't have more, we've misparsed. **/
FREE(entry_info->filename);
FREE(entry_info->type);
***************
*** 2292,2298 ****
char * p = strrchr(filename, '/'); /* Find the lastslash. */
char *cp;
! if (server_type == CMS_SERVER) {
StrAllocCopy(lastpath, filename); /* Use absolute path for CMS. */
} else {
StrAllocCopy(lastpath, p+1); /* Take slash off the beginning. */
--- 2309,2315 ----
char * p = strrchr(filename, '/'); /* Find the lastslash. */
char *cp;
! if (strict_1738) {
StrAllocCopy(lastpath, filename); /* Use absolute path for CMS. */
} else {
StrAllocCopy(lastpath, p+1); /* Take slash off the beginning. */
***************
*** 2628,2649 ****
char *type = NULL;
char *cp;
- if (server_type == CMS_SERVER) {
- /** If the unescaped path has a %2f, reject it as illegal. - FM **/
- if (((cp = strstr(filename, "%2")) != NULL) &&
- TOUPPER(cp[2]) == 'F') {
- FREE(fname);
- init_help_message_cache(); /* to free memory */
- NETCLOSE(control->socket);
- control->socket = -1;
- if (TRACE) {
- fprintf(stderr,
- "HTFTP: Rejecting path due to illegal escaped slash.\n");
- }
- return -1;
- }
- }
-
if (!*filename) {
StrAllocCopy(filename, "/");
type = "D";
--- 2645,2650 ----
***************
*** 2678,2686 ****
fprintf(stderr, "HTFTP: type=%s\n", type);
}
}
! HTUnEscape(filename);
! if (TRACE)
! fprintf(stderr, "HTFTP: UnEscaped %s\n", filename);
if (filename[1] == '~') {
/*
** Check if translation of HOME as tilde is supported,
--- 2679,2691 ----
fprintf(stderr, "HTFTP: type=%s\n", type);
}
}
!
! if (!strict_1738) {
! HTUnEscape(filename);
! if (TRACE)
! fprintf(stderr, "HTFTP: UnEscaped %s\n", filename);
! }
!
if (filename[1] == '~') {
/*
** Check if translation of HOME as tilde is supported,
***************
*** 2751,2757 ****
(format_out == WWW_SOURCE ||
format_out == HTAtom_for("www/download") ||
format_out == HTAtom_for("www/dump")) &&
! (server_type != CMS_SERVER))
binary = TRUE;
if (!binary && type && *type == 'I') {
/*
--- 2756,2762 ----
(format_out == WWW_SOURCE ||
format_out == HTAtom_for("www/download") ||
format_out == HTAtom_for("www/dump")) &&
! ascii_host)
binary = TRUE;
if (!binary && type && *type == 'I') {
/*
***************
*** 2989,2994 ****
--- 2994,3000 ----
}
break;
}
+ case MVS_SERVER:
case CMS_SERVER:
{
/*
***************
*** 3003,3008 ****
--- 3009,3015 ----
(0 == strncasecomp(filename+1, "anonymou.", 9) &&
strchr(filename+1, '/') == NULL)) {
if (filename[1] != '\0') {
+ HTUnEscape(filename);
sprintf(command, "CWD %s%c%c", (filename+1), CR, LF);
status = response(command);
if (status != 2) {
***************
*** 3035,3040 ****
--- 3042,3048 ----
/** Otherwise, go to appropriate directory and adjust filename **/
while ((cp = strchr(filename, '/')) != NULL) {
*cp++ = '\0';
+ HTUnEscape(filename);
sprintf(command, "CWD %s%c%c", filename, CR, LF);
status = response(command);
if (status == 2) {
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;
Re: MVS FTP interface (Was: Re: LYNX-DEV Two bugs in Lynx), Foteos Macrides, 1997/02/20