Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 1996 11:30:39 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        jonny@gaia.coppe.ufrj.br (Joao Carlos Mendes Luis)
Cc:        terry@lambert.org, garth@dogbert.systems.sa.gov.au, questions@freefall.freebsd.org
Subject:   Re: int link(const int inode, const char *name2)
Message-ID:  <199606251830.LAA00258@phaeton.artisoft.com>
In-Reply-To: <199606250318.AAA19340@mailhost.coppe.ufrj.br> from "Joao Carlos Mendes Luis" at Jun 25, 96 00:18:21 am

next in thread | previous in thread | raw e-mail | index | archive | help
> // Ghah.
> // 
> // You could manually mung the directory.
> 
> This will create a reference, but does not increment the inode refcount.

Yes.  You will need to fsck it to recover the link count.  As long as
the blocks are not reused, you are fine.


> // If you were root and manually munged the directory it used to live in
> // by using a binary editor on the block device (assuming it wasn't truncated
> 
> Can still be done, if you edit the block device to change the file's
> inode and increment refcount.

The refcount is not relevent for reques if the freemap is not modified.
After you have written the data and synced tha machine, you crash it
with the power switch and bring it up in single user for the fsck.


> // and nothing was created in its slot), then all you'd have to do is adjust
> // the end pointer:
> ...
> // It is easy to damage an FS this way.
> 
> Sure !  This is not child's play.  :)

Probably better to write a program that includes the real headers and
use it to hack the FS.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606251830.LAA00258>