~ubuntu-branches/ubuntu/saucy/389-ds-base/saucy

« back to all changes in this revision

Viewing changes to ldap/servers/slapd/config.c

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2013-02-06 18:06:31 UTC
  • mfrom: (11.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130206180631-h6ldv3k506hmm46e
Tags: 1.3.0.2-0ubuntu2
debian/*: Fix time stamps due to clock skew (FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
        char *buf = 0;
166
166
        char *lastp = 0;
167
167
        char *entrystr = 0;
 
168
        char tmpfile[MAXPATHLEN+1];
168
169
 
169
170
        if (NULL == configdir) {
170
171
                slapi_log_error(SLAPI_LOG_FATAL,
173
174
        }
174
175
        PR_snprintf(configfile, sizeof(configfile), "%s/%s", configdir,
175
176
                                CONFIG_FILENAME);
176
 
        if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
177
 
        {
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,
183
 
                                        CONFIG_FILENAME);
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);
190
 
                        } else {
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 */
195
 
                        }
196
 
                } else {
197
 
                        slapi_log_error(SLAPI_LOG_FATAL, "config",
198
 
                                "The backup configuration file %s does not exist, either.\n",
199
 
                                tmpfile);
200
 
                        return rc; /* Fail */
201
 
                }
 
177
        PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
 
178
                                        CONFIG_FILENAME);
 
179
        if ( (rc = dse_check_file(configfile, tmpfile)) == 0 ) {
 
180
                PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.bak", configdir,
 
181
                                        CONFIG_FILENAME);
 
182
                rc = dse_check_file(configfile, tmpfile);
202
183
        }
 
184
 
203
185
        if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
204
186
        {
205
187
                PRErrorCode prerr = PR_GetError();