FTP client downcases file names by default?

All types of networks, network stacks, and protocols supported by OpenVMS.
Post Reply

Topic author
sms
Master
Posts: 317
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

FTP client downcases file names by default?

Post by sms » Wed Dec 21, 2022 7:16 pm

Code: Select all

   This behavior appears to have existed for a long time, but I just
noticed it (when transferring files with mixed-case names between VMS
systems, using a Mac as an intermediate host).  For example:

its $ tcpip show version

  HP TCP/IP Services for OpenVMS Industry Standard 64 Version V5.7 - ECO 5
  on an HP rx2600  (1.50GHz/6.0MB) running OpenVMS V8.4-2L3


its $ ftp proa   ! The Mac.
220 10.0.0.87 FTP server (tnftpd 20100324+GSSAPI) ready.
[...]
FTP> put LOGIN.COM
200 PORT command successful.
150 Opening ASCII mode data connection for 'login.com'.
226 Transfer complete.
local: ITS$DKA0:[SMS]LOGIN.COM;236  remote: login.com

   I don't remember asking for this (unwanted) "help".

   Explicitly specifying the remote name gives the desired result:

FTP> put LOGIN.COM LOGIN.COM
200 PORT command successful.
150 Opening ASCII mode data connection for 'LOGIN.COM'.
226 Transfer complete.
local: ITS$DKA0:[SMS]LOGIN.COM;236  remote: LOGIN.COM
11304 bytes sent in 00:00:00.00 seconds (5.39 Mbytes/s)

   Why is this behavior not the default?  Or controlable?  Or am I
missing something?


   It's annoying enough when the MIME utility ("MIME Version: V1.93")
upcases an e-mail attachment file name when it's extracted.  Then, after
manually correcting that file name, it's still more annoying when the
FTP client downcases it.

[...]
  Attachment: 4
        Content-Type:  image/jpeg
        Content-Disposition:  attachment;
          filename="MACRO-Rosette-color.jpg"
        Content-Transfer-Encoding:  Base64
MIME> ext /att = 4
%MIME-I-SAVEFILE, saving file . . .
MACRO-ROSETTE-COLOR.JPG


its $ rename MACRO-ROSETTE-COLOR.JPG MACRO-Rosette-color.jpg


[...]
FTP> put MACRO-Rosette-color.jpg
200 PORT command successful.
150 Opening BINARY mode data connection for 'macro-rosette-color.jpg'.
226 Transfer complete.
local: ITS$DKA0:[SMS]MACRO-Rosette-color.jpg;1  remote: macro-rosette-color.jpg

(The MIME bonus file, MIME$20200536_MACRO-ROSETTE-COLOR.JPG;1 is also
annoying, of course.)


   Although this demonstration was run on an IA64 system, the same
behavior was observed on x86_64:

v87 $ tcpip show version

  VSI TCP/IP Services for OpenVMS x86_64 Version X6.0
  on a VMware, Inc. running OpenVMS E9.2    

(Where MIME still says, "MIME Version: V1.93".  And a direct VMS-VMS
file transfer hangs on the E9.2 system which I now can't legally use:
SPS-632)
Last edited by mister.moderator on Wed May 24, 2023 3:47 am, edited 1 time in total.

Tags:


tim.stegner
VSI Expert
Valued Contributor
Posts: 55
Joined: Wed Jul 21, 2021 9:14 am
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by tim.stegner » Thu Dec 22, 2022 8:25 am

what are your settings for parse style and that DECC logical that controls case sensitivity? (it's around here somewhere...)


Topic author
sms
Master
Posts: 317
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by sms » Thu Dec 22, 2022 10:20 am

Code: Select all

> what are your settings for parse style [...]

   As that RENAME command and the
"local: ITS$DKA0:[SMS]MACRO-Rosette-color.jpg;1" message would suggest:

its $ show proc /parse

22-DEC-2022 08:20:15.38   User: SMS              Process ID:   20200536
                          Node: ITS              Process name: "_FTA5:"
 
Parse Style: Extended

   But, of course, the FTP client (and the MIME utility) are not DCL,
and these commands are FTP client (or MIME) commands, not DCL commands.

> [...] and that DECC logical that controls case sensitivity? (it's
> around here somewhere...)

   Per the advice from "HELP CRTL Feature_Logical_Names":

          o  Do not set C RTL feature logical names for the system.
             Set them only for the applications that need them,
             because other applications including OpenVMS components
             depend on the default behavior of these logical names.

I never intentionally touch those logical names (outside of a program,
using decc$feature_set_value(), et al.)

its $ show logi decc$*
[...]
(LNM$SYSTEM_TABLE)

  "DECC$CRTLMAP" = "SYS$SHARE:DECC$SHR"
  "DECC$SHR_AV" = "DECC$SHR"
[...]

See, for example, [.vms]vms.c in the Info-ZIP Zip or UnZip sources.


   But, in another (unrelated) surprise, I see that _one_ of my SYSTEM
sessions (the one where I do most of the admin work) _does_ have some
such noise:

ITS $ show logi decc$*

(LNM$PROCESS_TABLE)

  "DECC$EFS_CASE_PRESERVE" = "ENABLED"
  "DECC$EFS_CASE_SPECIAL" = "ENABLED"
  "DECC$EFS_CHARSET" = "ENABLED"
  "DECC$FILE_SHARING" = "ENABLED"
[...]
(LNM$SYSTEM_TABLE)

  "DECC$CRTLMAP" = "SYS$SHARE:DECC$SHR"
  "DECC$SHR_AV" = "DECC$SHR"
[...]

   I claim that I had nothing (intentional) to do with setting those
names in the process table.  (I had to look up DECC$FILE_SHARING to see
what it does.)  I've now cleared those manually.  The first suspect I
spotted was APACHE$COMMON:[000000]APACHE$SETUP.COM, where I see:

$ Define /NoLog DECC$EFS_CASE_PRESERVE  ENABLED
$ Define /NoLog DECC$EFS_CASE_SPECIAL   ENABLED
$ Define /NoLog DECC$EFS_CHARSET        ENABLED
$ Define /NoLog DECC$FILE_SHARING       ENABLED

   How that might have gotten run out of its usual context is anyone's
guess, but I'd vote for a better blade guard on that stuff.  (For
example, one might set that stuff in the C code, not in the DCL.  I know
where there's some example code which does that.)

   In any case (yuk-yuk-yuk), the session where I was using the FTP
client (and the MIME utility) was a different one (user: SMS), not the
one with the unexpected DECC$<whatever> logical names set.


tim.stegner
VSI Expert
Valued Contributor
Posts: 55
Joined: Wed Jul 21, 2021 9:14 am
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by tim.stegner » Thu Dec 22, 2022 10:57 am

have to check, in order to disregard. i'll have out stack SQA guy give it a whirl, then see what the stack team thinks. thx.


Topic author
sms
Master
Posts: 317
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by sms » Thu Dec 22, 2022 1:11 pm

Code: Select all

> [...] give it a whirl, [...]

   Be my guest, and thanks.  Wake me if any questions arise.  Remember,
for the FTP client, the complaint involved PUT from VMS to non-VMS.  PUT
from VMS-to-VMS seems to preserve the original case, regardless of the
user-specified file spec.  For example:

its $ ftp its
[...]
FTP> cd vsi
250-CWD command successful.
250 New default directory is ITS$DKA0:[SMS.VSI]
FTP> put LOGIN.com
200 TYPE set to IMAGE.
200 PORT command successful.
150 Opening data connection for ITS$DKA0:[SMS.VSI]LOGIN.COM;1 (10.0.0.140,62822)
226 Transfer complete.
local: ITS$DKA0:[SMS]LOGIN.COM;236  remote: LOGIN.COM
[...]
FTP> show status
211-FTP Server Status.
211-SITE set to +VMS+.
[...]

   I haven't explored all the combinations of GET/PUT, VMS/non-VMS,
ODS<whichever>, and so on, so I wouldn't bet against other oddities
hiding elsewhere.

   When ODS2 was the only file system on VMS, so all file names were
all-upper-case, and (practically) all UNIX file names were
all-lower-case, this sort of behavior might have made more sense.  But
times have changed (on both ends).  And, regardless, it should always be
possible to disable any such name "adjustment", even when it is (often)
a good idea.  (For MIME, on the other hand, I see no excuse.)
Last edited by sms on Thu Dec 22, 2022 1:13 pm, edited 1 time in total.


tim.stegner
VSI Expert
Valued Contributor
Posts: 55
Joined: Wed Jul 21, 2021 9:14 am
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by tim.stegner » Fri Dec 23, 2022 8:47 am

Steve,
Turns out your title states the case: Per section 2.8.3 & 2.16 of the VSI TCP/IP Services for OpenVMS User's Guide, the default behavior for VMS to UNIX (and thus MacOS, as it's OpenBSD) is for the remote file name to be lowercase. Unless you explicitly specify the remote file name in your preferred case.

I could put in an enhancement request if you like?

User avatar

arne_v
Master
Posts: 308
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: FTP client downcases file names by default?

Post by arne_v » Fri Dec 23, 2022 9:22 am

The behavior sort of makes sense on an ODS-2 disk. On VMS everything was forced upper case. On *nix most files are lower case. It seems likely that most people would want the upper case names converted to lower case.

ODS-5 is different. If something is all upper case, then the VMS user has decided that the file name should be upper case. And then it makes sense to keep it that way.

I am not arguing that the behavior should be determined by the VMS ODS level - that would be confusing for many users.

If you did make an enhancement then how would it work? A logical TCPIP$FTP_PUT_PRESERVE_CASE or?
Arne
arne@vajhoej.dk
VMS user since 1986


Topic author
sms
Master
Posts: 317
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by sms » Fri Dec 23, 2022 1:29 pm

Code: Select all

> [...] VSI TCP/IP Services for OpenVMS User's Guide, [...]

   Thanks.  That was educational.  I doubt that I've looked at the
manual for a long time.  Most likely, I was relying on reasonable
expectations and the FTP client on-line HELP, which might best be
described as horrible.

   Looking again at the FTP HELP, I see under PUT > Examples:

        o  File names are copied in lowercase.

   I wouldn't have looked under "Examples" for that kind of information.

   I also didn't see anything in the FTP HELP about the /[NO]LOWERCASE
option.

   I also didn't see anything in the FTP HELP about TCPIP$FTPINIT and/or
SYS$LOGIN:TCPIP$FTPINIT.INI, which was news to me.

   Perhaps the main message here is that the FTP HELP needs much work
before it has much value.

> I could put in an enhancement request if you like?

   Sure.  Some way to change the /[NO]LOWERCASE default would be good,
so that the user wouldn't need to specify it on every PUT command.  And
whatever the command might be (ENABLE/DISABLE LOWERCASE?), the user
could add it to his (newly discovered/created) FTPINIT file.  (And
another line in the SHOW STATUS report, I assume?)

   Also valuable-to-know would be whether "UNIX" in all the
documentation really means "UNIX" (or UNIX(-like)), or does it mean any
non-VMS OS (or FTP server), or VMS-Plus mode disabled, or ...


> [...] A logical TCPIP$FTP_PUT_PRESERVE_CASE or?

   _or_, please.  Now that we've discovered the FTPINIT file, there's no
need (or any good reason, I claim) to drag in logical names.


tim.stegner
VSI Expert
Valued Contributor
Posts: 55
Joined: Wed Jul 21, 2021 9:14 am
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by tim.stegner » Fri Dec 23, 2022 1:59 pm

I like the idea of a 'mode' switch as well, but i'm not the developer. Logicals are easy to implement. Don't expect a fast response; the stack team has a bunch of other priorities.


Topic author
sms
Master
Posts: 317
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: FTP client downcases file names by default?

Post by sms » Fri Dec 23, 2022 2:47 pm

Code: Select all

> [...] Don't expect a fast response; [...]

   Fear not.  I try to maintain low expectations (in the hope of
pleasant surprises).  Thanks again.

Post Reply