Closed tsutsui closed 2 years ago
ktrace login: login.ktrace.log
It looks silently exit after writing /var/log/wtmp
via login(3) in libutil?
https://github.com/tsutsui/netbsd-src/blob/e68096389f0dc5327ebdd92871273b86a7a75b38/usr.bin/login/login.c#L1020-L1031
https://github.com/tsutsui/netbsd-src/blob/e68096389f0dc5327ebdd92871273b86a7a75b38/lib/libutil/login.c#L66-L69
because the following geteuid(2)
is not recoreded:
https://github.com/tsutsui/netbsd-src/blob/e68096389f0dc5327ebdd92871273b86a7a75b38/usr.bin/login/login.c#L545-L564
After dumb printf debugging, it turns out login(1)
properly invokes a shell but /bin/csh
silently exits.
Probably this is due to signal issue mentioned in #15.
In NetBSD 3.x days root login shell was /bin/csh
so changing it to /bin/sh
(as these days) works around.
I'm not sure why ktrace(1)
doesn't log all syscalls on invoking a user shell,
but maybe the ktrace logging is terminated around setusercontext(3)
etc.
The default shell for root has been changed to /bin/sh
as trunk in https://github.com/tsutsui/netbsd-src/commit/be7b63daeeb9407e42b3db950085ba6bd6ee319a
see what's going on: https://www.youtube.com/watch?v=xtp4LDtDgxc