Re: how to restrict access of FIFO-pipes to two dedicated processes?

From: bine (sabine.hubrig-schaumburg_at_sungard.de)
Date: 04/21/04


Date: 21 Apr 2004 08:18:07 -0700

those who know me have no need of my name <not-a-real-address@usa.net> wrote in message news:<m1llkunv01.gnus@usa.net>...
> ... or you can use the classic solution of
> removing the file after the reader (gzip) has it open -- neither are atomic
> so there is still a period of time which is vulnerable.
>
> an example of the later, which should executed via a single call to the
> shell is:
>
> mknod apipe$$ p ; gzip -1 < apipe$$ > apipe$$.gz & rm -f apipe$$
>
> i've used $$ so that the same program running more than one at a time will
> not destroy each other's files. whether that's appropriate you will have
> to decide.

Nice try :-)
unfortunately in that case I get a file named like the apipe$$ written
by the WRITING process, instead of the packed version apipe$$.gz which
I wanted.
I tried the above not as currently needed out of COBol, byt directly
in a script where we do the same for some time already, were we gzip a
dumpfile which is written out of oracle's exp[ort], which I would have
made more secure as well if I'd found a solution. In that case I don't
even have a chance to "rm" the "file" after the export starts until
it's finished (if I don't use another script looking for the file and
doing the rm which might not work, I'll experiment a bit with that).
But for my current problem I might try the "rm" out of my COBol after
the OPEN OUTPUT statement and look what happens, if COBol still can
WRITE into a nonvisible "file=pipe" and gzip still can read and nobody
else is lead into temptation because nobody knows of that file, that
would be a stunning solution.

Thanks anyway so far,
bine
----------------------------------------------------------------------
The goal of science is to build better mousetraps,
The goal of nature is to build better mice !



Relevant Pages

  • Re: Getting File Name from a ksh script
    ... I MF Cobol it doesn't like that and tries to use the file in the ... > Here's the script ... 01 Relative-Record. ... the current Client/Facility setting. ...
    (comp.lang.cobol)
  • Re: Getting File Name from a ksh script
    ... >> We're in the process of converting from Compaq Cobol to MF Cobol. ... >> Here's the script ... > 01 Relative-Record. ...
    (comp.lang.cobol)
  • Re: [OT] Text editors Re: Great SWT Program
    ... very good, if quirky, work horse, very reliable and remarkably ... script, with the completed command nicely formatted and placed in your ... if you're counting programming languages too (and the ... mention of COBOL suggests you are), Fortran is still a going ...
    (comp.lang.java.programmer)
  • Re: Discussions of COBOL philospphy
    ... (I know from my own experience that nobody associates OO with COBOL and I ... Someone with a negative opinion of Cobol cannot be enthusiastic about using it, ... work in a language he respects. ...
    (comp.lang.cobol)
  • Re: Discussions of COBOL philospphy
    ... Unfortunately, the COBOL innovations have been overtaken by events, and, ... nobody is interested in whether COBOL can do it or not. ... Someone with a negative opinion of Cobol cannot be enthusiastic about ... work in a language he respects. ...
    (comp.lang.cobol)