174
175
PR_snprintf(configfile, sizeof(configfile), "%s/%s", configdir,
175
176
CONFIG_FILENAME);
176
if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
178
/* the "real" file does not exist; see if there is a tmpfile */
179
char tmpfile[MAXPATHLEN+1];
180
slapi_log_error(SLAPI_LOG_FATAL, "config",
181
"The configuration file %s does not exist\n", configfile);
182
PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
184
if ( PR_GetFileInfo( tmpfile, &prfinfo ) == PR_SUCCESS ) {
185
rc = PR_Rename(tmpfile, configfile);
186
if (rc == PR_SUCCESS) {
187
slapi_log_error(SLAPI_LOG_FATAL, "config",
188
"The configuration file %s was restored from backup %s\n",
189
configfile, tmpfile);
191
slapi_log_error(SLAPI_LOG_FATAL, "config",
192
"The configuration file %s was not restored from backup %s, error %d\n",
193
configfile, tmpfile, rc);
194
return rc; /* Fail */
197
slapi_log_error(SLAPI_LOG_FATAL, "config",
198
"The backup configuration file %s does not exist, either.\n",
200
return rc; /* Fail */
177
PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
179
if ( (rc = dse_check_file(configfile, tmpfile)) == 0 ) {
180
PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.bak", configdir,
182
rc = dse_check_file(configfile, tmpfile);
203
185
if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
205
187
PRErrorCode prerr = PR_GetError();