More secure version of mkstemp() please?

Is it possible to obtain a version of mkstemp.o that would open a
temporary file with 0600 permissions rather than 0644 ?

I need it for a sudo, (current sudo is v1.6.8p6), with the mkstemp()
available in /usr/lib/unix3[r|s].lib (Watcom v10.6B+SecPatch) it’s
sudoedit opens a sensitive file in a world-readable folder as a
world-readable one.

Tony.

PS
May I call umask() to set the the default permissions prior to calling
mkstemp() as a workaround? Will mkstemp() follow them or will try to set
it’s own permissions?

On Sun, 08 May 2005 23:29:37 +0400, Tony <mts.spb.suxx@mail.ru> wrote:

Is it possible to obtain a version of mkstemp.o that would open a
temporary file with 0600 permissions rather than 0644 ?
Yet another reason to use ‘vi’ - it was my current editor’s fault, not

mkstemp()'s.
‘vi’ keeps a file as 0600, sorry for such a mistake!

mkstemp() from Watcom C v10.6B+SecPatch opens a file as 0600 - just as it
should be.

Tony.