Re: debugging/tracing a setuid program

2023-05-08 Thread Mouse
> [...] openat() [...]. It's detected by autoconf on the -6 chroot on > -8 while -6 doesn't implement it. As I wrote back on 2009-11-20 [%], such configuration scripts are [] very hard to sandbox (at best you end up configuring the software to run in the sandbox), which is exact

Re: debugging/tracing a setuid program

2023-05-08 Thread Edgar Fuß
I haven't investigated this further, but it worked to ktrace -p and revealed openat() as the culprit. It's detected by autoconf on the -6 chroot on -8 while -6 doesn't implement it.

Re: debugging/tracing a setuid program

2023-05-05 Thread Mouse
>> (a) I'd say it shouldn't stop ktracing > I suspect it stops as soon as sudo calls setuid. (a) If it does that when the trace was set by root, I call that a bug. (b) Even if so, it shouldn't stop partway through an operation. /~\ The ASCII Mouse \ / Ribbon Campaign

Re: debugging/tracing a setuid program

2023-05-05 Thread Emmanuel Dreyfus
On Fri, May 05, 2023 at 08:29:41PM +0200, Edgar Fuß wrote: > > (a) I'd say it shouldn't stop ktracing > I suspect it stops as soon as sudo calls setuid. I have been using it for years like Der Mouse suggested: $ su # ktrace -di su -l manu $ sudo apachectl graceful The full trace is recorded: 28

Re: debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
> (a) I'd say it shouldn't stop ktracing I suspect it stops as soon as sudo calls setuid.

Re: debugging/tracing a setuid program

2023-05-05 Thread Mouse
>> As root, ktrace -i the shell (or other process) it's started by. > That gives me a ktrace that stops in the middle of the GIO where sudo > is reading the sudoers file. That...well, I have trouble seeing that as anything less than a bug. (a) I'd say it shouldn't stop ktracing and (b) I *definite

Re: debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
> As root, ktrace -i the shell (or other process) it's started by. That gives me a ktrace that stops in the middle of the GIO where sudo is reading the sudoers file.

Re: debugging/tracing a setuid program

2023-05-05 Thread Mouse
> I have an interesting problem: How do you debug or ktrace a setuid > binary that exhibits the problem only when run as non-root? As root, ktrace -i the shell (or other process) it's started by. If you can change its code, have it ktrace itself on startup. (And if that changes the behaviour, go

debugging/tracing a setuid program

2023-05-05 Thread Edgar Fuß
I have an interesting problem: How do you debug or ktrace a setuid binary that exhibits the problem only when run as non-root? (Specifically, this is sudo built for NetBSD-6 via kver in a chroot on -8 failing to read the timestamp files on real -6. When called as root, it doesn't use the timest