On Thu, 13 Jul 2006 09:03:29 -0700
"Roderick A. Anderson" <[EMAIL PROTECTED]> wrote:

> Corey Wright wrote:
> > On Wed, 12 Jul 2006 14:53:51 -0700
> > "Roderick A. Anderson" <[EMAIL PROTECTED]> wrote:
> > 
> > 
> >>Is there a neat trick to un-hashify a guest?
> > 
> > 
> > find / -type f \
> > | while read FILE; do
> >     cp -av ${FILE} ${FILE}.remove-hashification
> >     rm ${FILE}
> >     mv ${FILE}.remove-hashification ${FILE}
> >   done
> > 
> > that's just an example, but should convey the idea well enough.
> 
> Will this work from both inside and outside the guest?  It a filesystem 
> thing being exploited ( utilized probably sounds better ) by
> Linux-Vserver?

yes, copying a file, "deleting" the original, and moving (or copying) the
copy back, will work in both the context of the host & guests, as it is a
mechanism based on the filesystem and not namespaces.

the above can be done more selectively/intelligently by insuring a file is
immutable and unlinkable using either showattr and/or lsattr.

by analyzing my hashified files (confirmed with "ls -i"):

if (showattr ${FILE} | grep ^....ui. >/dev/null); then
  echo copy, rm, and mv
fi

or

if (showattr ${FILE} | grep ^....i............ >/dev/null); then
  echo copy, rm, and mv
fi

i'm not sure which, if any, is correct to find an immutable-but-unlinkable
file created in the process of hashifying as documentation on the subject
is scarce and i don't feel like reading/reverse-engineering the source code.

but that should give you a good jump start on the subject.

corey
-- 
[EMAIL PROTECTED]
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver

Reply via email to