Path: utzoo!utgpu!water!watmath!clyde!bellcore!tness7!killer!pollux!dalsqnt!rpp386!pigs!haugj From: haugj@pigs.UUCP (John F. Haugh II) Newsgroups: comp.bugs.sys5 Subject: Re: /etc/link problem via /etc/mvdir Summary: Sorry to disagree with Brandon ... Message-ID: <143@pigs.UUCP> Date: 6 Jun 88 16:39:27 GMT References: <532@etn-rad.UUCP> <7850@ncoast.UUCP> Organization: Big "D" Home for Wayward Hackers Lines: 46 In article <7850@ncoast.UUCP>, allbery@ncoast.UUCP (Brandon S. Allbery) writes: > As quoted from <532@etn-rad.UUCP> by markus@etn-rad.UUCP (Markus Richardson): > +--------------- > | I did something dangerous/stupid but only realized it after the fact. > | my . directory looked something like: > | dir1/ dir2/ dir3/ dir4/ dir5/ dir6/ dir7/ dir8/ dir9/ > | > | I entered '/etc/mvdir * dir9' thinking (ala /bin/mv) that /etc/mvdir > | and /etc/link would be smart enough to catch that I was trying to > | link a directory (namely dir9) to itself. Well, after no error message I > | got alittle panicky and of course did a /bin/ls. Nothing in the . directory! > +--------------- > > Check the man pages. /etc/link is a pure link(2) with NO CHECKING WHATSOEVER > -- it is a tool for repairing a filesystem, NOT intended for general use. > -- > Brandon S. Allbery, moderator of comp.sources.misc The /etc/mvdir I have does not support multiple arguments so I obviously don't have the same version as Markus is talking about. However, the version which I have will not permit a directory to be moved into another IF the two source is a prefix of the destination. For example, mvdir /etc /etc fails with the message 'arguments have common path'. /etc/mvdir is attempting to move /etc to /etc/etc and finds that /etc is a path prefix of /etc/etc. The comparision is on a textual basis, so the test fails for any case where the path contains directories such as `/etc/../etc' or even `/etc/.'. None the less, even these cases are detectable and any deviation from `expected' behavior should be documented, or any paths containing `.' or `..' should be disallowed. /etc/mvdir can work without suprizes if properly coded. In both my case and Markus', the program is broken. The user should never be expected to do with `right' thing without first being warned about what the `wrong' thing is. - John. -- The Beach Bum Big "D" Home for Wayward Hackers UUCP: ...!killer!rpp386!jfh jfh@rpp386.uucp :SMAILERS "You are in a twisty little maze of UUCP connections, all alike" -- fortune