Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2001 17:02:21 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Axel Scheepers <axel@beheer2.iae.nl>
Cc:        freebsd-security@FreeBSD.org
Subject:   Re: Warnings while compiling Samba
Message-ID:  <20010515170221.K11592@ringworld.oblivion.bg>
In-Reply-To: <20010515155130.D40513@beheer2.iae.nl>; from axel@beheer2.iae.nl on Tue, May 15, 2001 at 03:51:31PM %2B0200
References:  <3AFFE661.5D6015EA@comune.arzignano.vi.it> <20010514162605.C3213@petra.hos.u-szeged.hu> <3B012DB2.DF11CF12@gmx.net> <20010515155130.D40513@beheer2.iae.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

G'luck,
Peter

-- 
What would this sentence be like if pi were 3?

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010515170221.K11592>