From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6482d0ae6dcb1b4c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-06 13:38:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!ps01-chi1!news.webusenet.com!cyclone1.gnilink.net!wn11feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!12.120.28.17!attla2!ip.att.net!usc.edu!newspeer.cts.com!galanthis.cts.com!127.0.0.1.MISMATCH!not-for-mail Sender: kst@king.cts.com Newsgroups: comp.lang.ada Subject: Re: if file exist References: <3d9245da.259420486@news.cis.dfn.de> <3D933A6B.5000105@cogeco.ca> <8db3d6c8.0209270247.5bf07ae5@posting.google.com> <3D94D418.5010604@attbi.com> <3D9E0091.18314F2E@ebox.tninet.se> From: Keith Thompson Date: 06 Oct 2002 13:35:21 -0700 Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 NNTP-Posting-Host: 209.68.192.180 X-Trace: 1033936521 nntp.cts.com 321 209.68.192.180 Xref: archiver1.google.com comp.lang.ada:29546 Date: 2002-10-06T13:35:21-07:00 List-Id: Robert A Duff writes: [...] > I'm not sure what the second command is attempting to do, but I'm pretty > sure that on Unix systems, if you have no access to directory "dir" > (i.e., rwx bits all zero), then you can't find out whether a given file > name exists in dir. E.g., "ls dir/exists" and "ls dir/not-exists" will > both produce the same error message, even though exists exists and > not-exists does not. Attempting to run a directory as a command will > cause an error, too, so I don't see how the second command causes a > security flaw. Please explain the 'ls `dirname filename`'. I think you missed the backticks and/or the fact that "dirname" is a Unix command that prints a given filename with the trailing component removed. (It's a litle confusing; "dirname" is a literal command name, and "filename" substitutes for the actual name of some file.) So the command ls `dirname /etc/motd` expands (well, contracts actually) to ls /etc -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Schroedinger does Shakespeare: "To be *and* not to be"