On Wed, Dec 29, 2021 at 2:14 PM Douglas McIlroy
<douglas.mcilroy(a)dartmouth.edu> wrote:
what was the
last Unix version
that let users make arbitrary links, such that the file system was no
longer a DAG? I recall in v6 days hearing that earlier Unix allowed
this, and that cleanup (via icheck and friends) got to be near
impossible.
From v1 on (I'm not sure about PDP-7 Unix) only the superuser could do
that, so what you heard strikes me as urban legend. Perhaps some
installations abused root privilege to scramble the file system, but I
certainly didn't see that happen in Research systems.
I recall doing this on some system via a lesser-known flag to `ln`.
But I believe that a) you had to be root, and b) fsck sure was unhappy
after the fact. I gather it was one of those, "wizard sysadmin invokes
the deep magic from single user mode to fix the filesystem" and like
other such arcana was mostly for dealing with seriously perverse
failure modes, possibly in concert with the `unlink` command.
https://www.freebsd.org/cgi/man.cgi?query=ln&apropos=0&sektion=0&am…
says that the `-f` flag to `ln` would force a hard link to a directory
on (at least) SunOS 4.1.3.
The 4.3BSD man page has this gem: "Hard links may not refer to
directories (unless the proper incantations are supplied) and may not
span file systems." And indeed, a quick look at /usr/src/bin/ln.c on a
VAX running 4.3 shows that it has an undocumented `-f` flag:
presumably the "proper incantation" mentioned in the man page.
- Dan C.