[15498] in Athena Bugs
Re: sun4 8.1.9: snoop requires root
daemon@ATHENA.MIT.EDU (John Hawkinson)
Sun Sep 14 14:35:02 1997
Date: Sun, 14 Sep 1997 14:34:58 -0400
To: bugs@MIT.EDU
In-Reply-To: "[15497] in Athena Bugs"
From: John Hawkinson <jhawk@MIT.EDU>
| Here's a proof of concept that it works fine if we stop
| it from calling getuid():
|
| #!/bin/sh
| /afs/athena.mit.edu/project/gnu/bin/gdb --nx << EOF
...
Oops, it ocurred to me that this probably should have been done in
adb. Unfortunately this is a little less portable, making assumptions
about SPARC calling conventions because there's no equivalent of "finish":
#!/bin/sh
comment=""
adb snoop << EOF
main:b ${comment:+"Break at main."}
:r $@ ${comment:+"Start the program with args"}
geteuid:b ${comment:+"Break at geteuid()"}
:c ${comment:+"Continue"}
<o7+8:b ${comment:+"Break at the return from geteuid()"}
:c ${comment:+"Continue"}
0>o0 ${comment:+"Zero geteuid()'s return"}
:R ${comment:+"Detach"}
EOF
--jhawk