Thread View: comp.bugs.sys5
4 messages
4 total messages
Started by Markus Richardson
Sat, 21 May 1988 01:23
/etc/link problem via /etc/mvdir
Author: Markus Richardson
Date: Sat, 21 May 1988 01:23
Date: Sat, 21 May 1988 01:23
24 lines
1442 bytes
1442 bytes
I did something dangerous/stupid but only realized it after the fact.
(I'm sure I've heard that one before :-)
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!
Needless to say, I could not locate the directories and associated files
until I did a /etc/fsck. They all turned out to be UNREFerenced. What the
heck happened? If it matters, I am running SysV.2 on a Plexus.
--
Markus N. Richardson
Research and Development
Eaton Corporation IMSD
31717 La Tienda Drive
Westlake Village, CA 91359
{ voder,ihnp4,trwrb,scgvaxd,jplgodo }!wlbr!etn-rad!markus
wlbr!etn-rad!markus@etn-wlv.eaton.com
Re: /etc/link problem via /etc/mvdir
Author: ~XT4103000~Marc Mengel~C25~G25~6...
Date: Mon, 23 May 1988 14:07
Date: Mon, 23 May 1988 14:07
26 lines
1330 bytes
1330 bytes
In article <532@etn-rad.UUCP> markus@etn-rad.UUCP (Markus Richardson) writes:
>I did something dangerous/stupid but only realized it after the fact.
>...
>I entered '/etc/mvdir * dir9'
>...
>Needless to say, I could not locate the directories and associated files
>until I did a /etc/fsck. They all turned out to be UNREFerenced. What the
>heck happened? If it matters, I am running SysV.2 on a Plexus.
I assume you moved dir9 into itself, i.e.
link("dir9","dir9/dir9");
link("dir9/dir9/..", "dir9");
unlink("dir9");
Thereby generating a circular reference (hence the ref count on dir9
was still 1 after the whole proceeding, so no warnings about removing
the last link to a non-empyt directory).
And some people wonder why linking/unlinking directories requires
root permissions under Sys V...
--
Marc Mengel
attmail!mmengel
...!{moss|lll-crg|mtune|ihnp4}!cuuxb!mmengel
Re: /etc/link problem via /etc/mvdir
Author: Brandon S. Allbery
Date: Wed, 01 Jun 1988 03:19
Date: Wed, 01 Jun 1988 03:19
27 lines
1881 bytes
1881 bytes
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.
Moral: be VERY careful when using /etc/mvdir, /etc/link, or /etc/unlink:
these programs deliberately violate the rules which are intended to maintain
the "directed acyclic graph" which is the Unix filesystem, and using them
without caution will cause massive disasters.
(SVR3'ers can ignore the warning about "mvdir", I think: any system which
implements mkdir(2) and rmdir(2) as primitives should be able to handle
moving directories around a filesystem. But Plexii run SVR2.)
--
Brandon S. Allbery, moderator of comp.sources.misc
{well!hoptoad,uunet!marque,cbosgd,sun!mandrill}!ncoast!allbery
Delphi: ALLBERY MCI Mail: BALLBERY
Re: /etc/link problem via /etc/mvdir
Author: John F. Haugh II
Date: Mon, 06 Jun 1988 16:39
Date: Mon, 06 Jun 1988 16:39
46 lines
2644 bytes
2644 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads