mirror of
https://github.com/samba-team/samba.git
synced 2025-07-11 00:59:11 +03:00
replace: Fix use of mktemp
mktemp always returns the template, so checking for NULL doesn't cactch any error. Errors are reported by turning the template into an empty string. Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Thu Apr 26 16:14:24 CEST 2012 on sn-devel-104
This commit is contained in:
@ -412,8 +412,8 @@ int rep_mkstemp(char *template)
|
|||||||
{
|
{
|
||||||
/* have a reasonable go at emulating it. Hope that
|
/* have a reasonable go at emulating it. Hope that
|
||||||
the system mktemp() isn't completely hopeless */
|
the system mktemp() isn't completely hopeless */
|
||||||
char *p = mktemp(template);
|
mktemp(template);
|
||||||
if (!p)
|
if (template[0] == 0)
|
||||||
return -1;
|
return -1;
|
||||||
return open(p, O_CREAT|O_EXCL|O_RDWR, 0600);
|
return open(p, O_CREAT|O_EXCL|O_RDWR, 0600);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user