Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
From: Sebastian Andersson (bofhdiegeekdie.com)
Date: Tue May 15 2001 - 06:25:39 CDT
On Mon, 14 May 2001, Len Budney wrote:
> I'm interested in wrapping a program such that (1) users cannot run
> the program without the wrrapper, and (2) the program ends up running
> with the uid/gid of the caller.
Maybe you could let the wrapper start a new process, let the child detach
from the parent (fork(); fork()), attach to the parent with ptrace,
let the parent exec the new program and then inject code to
getuid(setuid()) before the new process starts to execute for real?
After that, detach the parent and exit the child.