Hello Qiao,
With more recent versions of gcc, extensions/trace.c generates this warning:
$ make extensions
...
gcc -Wall -g -shared -rdynamic -o trace.so trace.c -fPIC -DX86_64 -DLZO -DSNAPPY
-DGDB_7_6
/tmp/ccSOIphT.o: In function 'ftrace_show':
/root/crash.git/extensions/trace.c:1560: warning: the use of 'mktemp' is
dangerous, better use 'mkstemp'
...
$
I've attached an untested patch that replaces the mktemp() call with mkstemp().
I believe the only behavioral difference is that mkstemp() will create the file
automatically with permissions 600 and open flags of O_EXCL, whereas it is
currently being opened with permissions 644 and flags (O_WRONLY | O_CREAT | O_TRUNC).
Can you either ACK the patch, or address the warning as you would prefer?
Thanks,
Dave