Bug#330670: A suggested method for fakeroot to handle open and chroot

2005-10-08 Thread Shachar Shemesh
Clint Adams wrote:

As things stand, most of the cross-platform work we need to do can be
copied, almost verbatim, from strace.



Have you started any code?
  

Sadly, no. I doubt I'll have time for that in the near future, much
though I'd like to :-(



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#330670: A suggested method for fakeroot to handle open and chroot

2005-10-02 Thread Clint Adams
 As things stand, most of the cross-platform work we need to do can be
 copied, almost verbatim, from strace.

Have you started any code?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#330670: A suggested method for fakeroot to handle open and chroot

2005-09-29 Thread Shachar Shemesh
Package: fakeroot
Version: 1.2.10
Severity: wishlist

Revise the method in which fakeroot communicates with the faked daemon:
- The library will not override any of the libc symbols. Instead, a
  syscall type table is held inside.
- During the preload stage, fakeroot opens a socket/whatever to the
  daemon, and asks it to ptrace the process. It also passes the daemon
  the address of the symbol table.
- The daemon knows what socket number the process uses to communicate
  with it (probably a high value to avoid collision. We'll assume it's
  510).
- Whenever a write with fd 510 is registered at the debugging
  daemon, the content is pulled from the process memory and placed in
  the appropriate registers. This allows the library to perform system
  calls directly.
- (Almost) any other syscall is redirected to the library for
  interception and possibly replacement.

Advantages:
- Can intercept open without races.
- Can emulate chroot.
- Can emulate root for statically linked and non-standard executeables.
- Can kill all faked processes when the daemon is killed.
- Can emulate a no-LD_PRELOAD environment (remove variable on SO load,
  restore it upon execve). Also - can make sure that our LD_PRELOAD is
  always first.

Disadvantages:
- Performance? Probably not serious, as only syscalls will ever trigger a
  ptrace breakpoint.
- Will probably cause problems for recursive debuggers (i.e. - cannot
  run strace inside fakeroot).

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=en_US, LC_CTYPE=he_IL (charmap=ISO-8859-8)

Versions of packages fakeroot depends on:
ii  libc6   2.3.2.ds1-22 GNU C Library: Shared libraries an

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#330670: A suggested method for fakeroot to handle open and chroot

2005-09-29 Thread Clint Adams
 - During the preload stage, fakeroot opens a socket/whatever to the
   daemon, and asks it to ptrace the process. It also passes the daemon
   the address of the symbol table.

Is there a reason to preload a library for this instead of having a
program which establishes communication with faked and then ptraces its
child?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#330670: A suggested method for fakeroot to handle open and chroot

2005-09-29 Thread Shachar Shemesh
Clint Adams wrote:

- During the preload stage, fakeroot opens a socket/whatever to the
  daemon, and asks it to ptrace the process. It also passes the daemon
  the address of the symbol table.



Is there a reason to preload a library for this instead of having a
program which establishes communication with faked and then ptraces its
child?
  

It's theoretically possible to do it without a preload, but some things
become much more difficult:

1. Without a local agent, i.e. - without our code running in the
program's context, several things become much more difficult and
platform dependent. Things like changing parameters, calling the syscall
and then changing the results back are somewhat hairy to do from another
process. Things like turning a single syscall into several become an
exercise in agility that will be very hard to perform in a
cross-platform way.

2. Making sure we remain attached after fork and exec isn't trivial
(though possible, I guess).


As things stand, most of the cross-platform work we need to do can be
copied, almost verbatim, from strace.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]