Dmitry Marakasov writes: > * 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`. Cool, this works great :) . > 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. So, we're going with ptrace way, lets hope this way is foolproof :) . Thanks -- Ashish Shukla
pgp4YUYqe8cYg.pgp
Description: PGP signature