Re: Warnings while compiling Samba

From: Peter Pentchev (
Date: 05/15/01

Date: Tue, 15 May 2001 17:02:21 +0300
From: Peter Pentchev <>
To: Axel Scheepers <>

On Tue, May 15, 2001 at 03:51:31PM +0200, Axel Scheepers wrote:
> Well, man mkstemp brings me the the man page of mkstemp so I guess i'ts save
> to just replace the mktemp call with mkstemp. I don't have the time right now
> to look into the source so I can't be 100% sure about this... anyone?

'man mkstemp' brings up the manual page for mktemp(3), mkstemp(3), mkstemps(3)
and mkdtemp(3) functions. Just one look at the prototypes, though, should
tell you that the mktemp() and mkstemp() functions are NOT equivalent -
mktemp() returns a char *, mkstemp() returns an int.

Further down the manpage describes that mktemp() and mkstemp() really do
return different objects - mktemp() returns the filename of the new file
(which it does not create), mkstemp() actually creates the file and returns
a file descriptor.

It is only with difficulty that I can imagine a situation in which
the mkstemp() return value could be used as if it were returned by mktemp() -
programs using mktemp() expect a pointer to a string, while mkstemp() returns
a small integer. An attempt to create a file with that "name" would most
probably result in an immediate segmentation fault or bus error.


What would this sentence be like if pi were 3?
To Unsubscribe: send mail to
with "unsubscribe freebsd-security" in the body of the message