* Ashish Shukla आशीष शुक्ल (wahjava...@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.
> 
> 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're
> planning to preload as you mentioned in one of your mails in this thread ?

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=path_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.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ru    http://www.amdmi3.ru
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to