warnings on compile
Kenichi Okuyama
okuyamak at dd.iij4u.or.jp
Fri Dec 15 04:55:30 GMT 2000
>>>>> "ACT" == Anders C Thorsen <anders at aae.wisc.edu> writes:
>> I don't think we really need mktemp() at all.
>> # Do we really/truely? Where??
ACT> Oh well.. As long as mktemp() is used safely, why not continue to
ACT> do so.
Because of three reason.
1) The fact that we are using safely, this doesn't mean we are
proven to keep using them safely even from now on.
2) We are really using mktemp() inside smbd_mktemp() like this:
i ) get filename using mktemp().
ii) look at the filename, to see if there's no ':' characters.
iii) If we have them, try changing the character to different
character and see if we have such filename under use or not,
until we find pattern not being used.
iv) return that filename.
As you can see, this function named "smbd_mktemp()" is really
mktemp() of our own. WE ALREADY HAVE MADE MKTEMP OF OUR OWN.
Returned value of mktemp() being UNIQUE, is not being kept
because we change it inside smbd_mktemp().
What I'm saying is that it's nonsense to keep using mktemp()
inside this function, especially when many implementation
claiming that "mktemp() is unsafe."
Why should we bother about this warning/errors when
using mktemp() is not a good idea from beginning.
3) Most of the place where smbd_mktemp() is being called,
can be replaced with something we may call "smbd_mkstemp()".
We can keep our "safe-guard" inside smbd_mkstemp(), to make
our implementation more secure. So, we don't need mktemp()
anyway.
I know that re-inventing a "Wheel" is nonsense. I agree with you.
But "Steeling Wheel" is not "Wheel". So, we should invent "Steeling
Wheel". We should not create "Steeling Wheel" from "Wheel".
----
Kenichi Okuyama at Tokyo Research Lab, IBM-Japan, Co.
More information about the samba-technical
mailing list