Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Dec 2008 15:19:06 +0300
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        Ashish Shukla =?utf-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksg==?= <wahjava.ml@gmail.com>
Cc:        "Andrew W. Nosenko" <andrew.w.nosenko@gmail.com>, FreeBSD Ports Mailing List <freebsd-ports@freebsd.org>
Subject:   Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
Message-ID:  <20081213121906.GA81902@hades.panopticon>
In-Reply-To: <86wse5wb9m.fsf@chateau.d.lf>
References:  <20081210181125.GA86341@hades.panopticon> <87zlj3heor.fsf@chateau.d.lf> <20081210223522.GA6367@hades.panopticon> <87vdtrhb6r.fsf@chateau.d.lf> <20081211082325.GA6167@hades.panopticon> <6161f3180812110156n43803ee9s88443b6777bd0743@mail.gmail.com> <20081211113556.GA7422@hades.panopticon> <87vdtqls4g.fsf@chateau.d.lf> <20081212103827.GD7422@hades.panopticon> <86wse5wb9m.fsf@chateau.d.lf>

next in thread | previous in thread | raw e-mail | index | archive | help
* Ashish Shukla =E0=A4=86=E0=A4=B6=E0=A5=80=E0=A4=B7 =E0=A4=B6=E0=A5=81=E0=
=A4=95=E0=A5=8D=E0=A4=B2 (wahjava.ml@gmail.com) wrote:

> > No. If there's DESTDIR, you don't need to log writes to it, as you
> > can just use `find` to see what's there after installation as in
> > quote below. The idea is that if we log all writes to the fulesystem
> > during port installation, we don't need intermediate directory at
> > all.
>=20
> Okay, so if we go with your approach, then can you tell me how do you
> plan to go about logging writes to filesystem with your .so which you'r=
e
> planning to preload as you mentioned in one of your mails in this threa=
d ?

The idea is to redefine functions that execute syscalls which will
modify the filesystem add add loging there. Here's a test code
http://www.amdmi3.ru/files/ldpreload.c. Compile it into shared lib
and run `LD_PRELOAD=3Dpath_to_lib.so someapp`.

It turned out to be not the best solution as it relies on environment
heavily, and some apps may clear the environment (scons does this
by default), or call syscalls via syscall(), instead of libc wrapper,
thus it's not reliable enough.

Another way is ptrace, which should intercept syscalls without fail.

--=20
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru



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