> Probably there's a "dusty deck" somewhere whose inexcusably clever
> author relied on the behavior

Well, you can certainly see some JCL somewhere where there is for example

// SET DSN1=SOME.PDS(FOO)

And there are a bunch of references to DSN=&DSN1, most of which really "want" 
the member qualification, but one of which is a DISP=(OLD,DELETE) that is in 
fact working as the coder intended. If I had coded that I don't think I would 
consider it inexcusably clever.

IIRC they did fix another trap for the unwary. A program opens DD1 as an output 
SAM dataset. Someone executes the program and codes //DD1 DD DSN=SOME.PDS, when 
what they really meant was SOME.PDS(FOO). IIRC back in the good old days MVS 
would overwrite the directory of SOME.PDS, with the obvious negative 
consequences. I think they fixed that and the described scenario now fails. I 
will leave testing it as an exercise for the reader.

> Shell doesn't know what's a file and what's a switch.  

Well, if it is expanding pax * to pax file file file file could it not 
recognize that one such file looked a heck of a lot like a switch?

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Paul Gilmartin
Sent: Thursday, November 5, 2020 12:42 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Gwyn's Maxim (was: FSUM7197 pax ...)

https://opensource.com/business/14/12/linux-philosophy

On Thu, 5 Nov 2020 06:46:15 -0800, Charles Mills wrote:

>What the heck were the UNIX designers thinking when they allowed the casual 
>creation of a filename of -x? There may be a legitimate reason why someone 
>would want to create a file named -x but if so, then *they* should be made to 
>jump through some small hoop and "escape" the name in some way. The innocent 
>victim who stumbles into this situation should not be the one made to jump 
>through hoops. Will UNIX allow the creation of a file named "rm *"? That could 
>have some interesting side effects.
>
Even worse, a file named "-rf *".

This resembles the plaint of a JCL novice who has just encountered, painfully,
the astonishing behavior of:
    //SYSUT1 DD DSN=&SYSUID..PDS(MEMBER),DISP=(OLD,DELETE)

That should be fixed for DYNALLOC, JCL, TSO, globally by making the
TU for member mutex with the TU for delete.  Who volunteers to bell
the RFE cat?

Probably there's a "dusty deck" somewhere whose inexcusably clever
author relied on the behavior and whose heirs haven't access to the
source.

>How did I inadvertently create a file named -x? I had a pax command 
>
>pax -wzvf /my/archive.pax *
>
>I had an error that I thought might be solved by -x os390. Looking at the 
>above command I forgot that /my/archive.pax "went with" the -f and coded
>
>pax -wzvf -x os390 /my/archive.pax *
>    ...
>Heck, if the shell is going to expand the * then it could generate a warning 
>"hey, did you know that one of your files has a name that looks just like a 
>switch?"
>
Shell doesn't know what's a file and what's a switch.  That's the
responsibility of the utility, even as JCL shouldn't know what PARM means:
     //STEP  EXEC  PGM=BPXBATCH,PARM='sudo rm -rf /'

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to