|
From: Tom T. <Tom...@sa...> - 2005-12-09 21:55:47
|
[Hmm, looks like I didn't include the test pgm the first time]
Consider the test program "fe.c" below. If I do cc -g fe.c and then =
valgrind --trace-children=3Dno a.out
=3D=3D4014=3D=3D Conditional jump or move depends on =
uninitialised value(s)
=3D=3D4014=3D=3D at 0x40063D: main (fe.c:12)
This is inside the child! Is that appropriate?
What I am really trying to do is exec a set-user-id program. Currently =
valgrind fails with EACCES but I prefer that it instead print a warning =
and then just exec the program untraced (which is what "truss"-type =
commands do).
Thanks much for considering this,
Tom Truscott
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>
#include <unistd.h>
int main()
{
int uninit;
switch(fork())
{
case -1: perror("fork"); return 1;
case 0: /* child */
if (uninit) printf("child: bletch\n");
execl("/bin/su", "su", NULL);
perror("execl");
return 1;
}
printf("parent: sleeping\n");
sleep(10);
return 0;
}
|
|
From: Tom H. <to...@co...> - 2005-12-11 15:00:52
|
In message <E7713D602248164BA45AA01734A1F5A105E0C7D8@MERC27.na.sas.com>
"Tom Truscott" <Tom...@sa...> wrote:
> [Hmm, looks like I didn't include the test pgm the first time]
>
> Consider the test program "fe.c" below. If I do cc -g fe.c and then valgrind --trace-children=no a.out
>
> ==4014== Conditional jump or move depends on uninitialised value(s)
> ==4014== at 0x40063D: main (fe.c:12)
>
> This is inside the child! Is that appropriate?
Yes - the option is misnamed. It actually controls whether valgrind
retains control on exec. The fork is always followed on both sides.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|