Dnia 2013-09-04, o godz. 23:45:44 Kent Fredric <kentfred...@gmail.com> napisał(a):
> On 4 September 2013 21:59, Michał Górny <mgo...@gentoo.org> wrote: > > > And how are you going to implement this? I doubt that fd/vt input has > > any sort of 'writing process id' indicator. > > > > > Though granted, my other post is not going to be useful on a line-by-line > basis. > > The obvious easy approach is have an exec launcher of some kind that > launches processes with IO redirected to an intermediary process that > simply prepends arbitrary strings to every line sent to them, prior to > those processes piping the data to the final aggregate output. > > But this would require large amounts of pipe work and fork+ipc magic. > > Its surely doable, I recall seeing parts of paludis that do stuff like this. > > Just those pipes are inherently easy to break in my experience. That's my point. There's no simple way of doing such a thing, and any 'hard' way involves a lot of fragile hacks and assumptions. And more of that, more likely it will actually break something that relies on at least some sanity of host. I can't really imagine going anywhere without another LD_PRELOAD library. Then, I don't know if platforms other than Linux have any tools for proper chaining of LD_PRELOAD (think of sandbox). That's just one issue. Then, think of pipes. Some programs use stdin/stdout to communicate, maybe even stderr. You need to know which handles you can actually touch and which not. That should be fairly easy to achieve but still I suspect it would be fragile. -- Best regards, Michał Górny
signature.asc
Description: PGP signature