the system one is broken.
if (!lname) {
return 1;
}
- fd = smb_mkstemp(lname);
+ fd = mkstemp(lname);
if (fd == -1) {
d_printf("failed to create temporary file for more\n");
return 1;
}
/* now create the file */
- fd = smb_mkstemp(path);
+ fd = mkstemp(path);
if (fd == -1) {
DEBUG(0,("setup_out_fd: Failed to create file %s. (%s)\n",
#endif
}
-/*****************************************************************
- Possibly replace mkstemp if it is broken.
-*****************************************************************/
-
-int smb_mkstemp(char *name_template)
-{
-#if HAVE_SECURE_MKSTEMP
- return mkstemp(name_template);
-#else
- /* have a reasonable go at emulating it. Hope that
- the system mktemp() isn't completly hopeless */
- char *p = mktemp(name_template);
- if (!p)
- return -1;
- return open(p, O_CREAT|O_EXCL|O_RDWR, 0600);
-#endif
-}
-
/*****************************************************************
malloc that aborts with smb_panic on fail or zero size.
*****************************************************************/
flen = strlen(file_contents);
- fd = smb_mkstemp(tmpname);
+ fd = mkstemp(tmpname);
if (fd == -1) {
DEBUG(0,("create_local_private_krb5_conf_for_domain: smb_mkstemp failed,"
" for file %s. Errno %s\n",
}
/* Open the add and mod ldif files */
- if (!(r->add_file = fdopen(smb_mkstemp(r->add_name),"w"))) {
+ if (!(r->add_file = fdopen(mkstemp(r->add_name),"w"))) {
DEBUG(1, ("Could not open %s\n", r->add_name));
status = NT_STATUS_UNSUCCESSFUL;
goto done;
}
- if (!(r->mod_file = fdopen(smb_mkstemp(r->mod_name),"w"))) {
+ if (!(r->mod_file = fdopen(mkstemp(r->mod_name),"w"))) {
DEBUG(1, ("Could not open %s\n", r->mod_name));
status = NT_STATUS_UNSUCCESSFUL;
goto done;
/* we have a job entry - now create the spool file */
slprintf(pjob.filename, sizeof(pjob.filename)-1, "%s/%s%.8u.XXXXXX",
path, PRINT_SPOOL_PREFIX, (unsigned int)jobid);
- pjob.fd = smb_mkstemp(pjob.filename);
+ pjob.fd = mkstemp(pjob.filename);
if (pjob.fd == -1) {
if (errno == EACCES) {
if (!name) {
goto done;
}
- fd = smb_mkstemp(name);
+ fd = mkstemp(name);
if (fd == -1) {
DEBUG(1, ("can't open message file %s: %s\n", name,
return;
}
- tmpfd = smb_mkstemp(fname);
+ tmpfd = mkstemp(fname);
if (tmpfd == -1) {
reply_unixerror(req, ERRDOS, ERRnoaccess);
END_PROFILE(SMBctemp);
NULL, /* pinfo */
&sbuf); /* psbuf */
- /* close fd from smb_mkstemp() */
+ /* close fd from mkstemp() */
close(tmpfd);
if (!NT_STATUS_IS_OK(status)) {
}
/* Create a temporary filename for this share. */
- tmpfd = smb_mkstemp(full_path_tmp);
+ tmpfd = mkstemp(full_path_tmp);
if (tmpfd == -1) {
d_fprintf(stderr, "net usershare add: cannot create tmp file %s\n",