printf("->load_editor()\n");
#endif
- sprintf(entry_temp_file, "/tmp/udXXXXXX");
+#ifdef HAVE_MKSTEMP
+ strcpy(entry_temp_file, LDAP_TMPDIR LDAP_DIRSEP "udXXXXXX");
tmpfd = mkstemp(entry_temp_file);
return(-1);
}
+#else
+ fp = tmpfile();
+ if ( fp == NULL ) {
+ perror("tmpfile");
+ return(-1);
+ }
+#endif
+
fprintf(fp, "## Directory entry of %s\n", Entry.name);
fprintf(fp, "##\n");
fprintf(fp, "## Syntax is:\n");
if (verbose) {
char *p;
- if (( p = strrchr( editor, '/' )) == NULL ) {
+ if (( p = strrchr( editor, *LDAP_DIRSEP )) == NULL ) {
p = editor;
} else {
++p;