#50064 Ticket 50063 - Crash after attempting to restore a single backend
Closed 3 years ago by spichugi. Opened 5 years ago by mreynolds.
mreynolds/389-ds-base ticket50063  into  master

@@ -5292,6 +5292,11 @@ 

      }

  

      /* now smash everything else in the db/ dir */

+     if (priv->dblayer_home_directory == NULL){

+         slapi_log_err(SLAPI_LOG_ERR, "dblayer_delete_database_ex",

+                       "dblayer_home_directory is NULL, can not proceed\n");

+         return -1;

+     }

      dirhandle = PR_OpenDir(priv->dblayer_home_directory);

      if (!dirhandle) {

          slapi_log_err(SLAPI_LOG_ERR, "dblayer_delete_database_ex", "PR_OpenDir (%s) failed (%d): %s\n",

Description:

While we do not support backup/restore of individual backends it should not crash the server either. PR_OpenDir will crash if the file name is NULL, so this fix just prevents the crash by returning an error if the file/dir name is NULL.

https://pagure.io/389-ds-base/issue/50063

Reviewed by: ?

Is there a possibility of a test case for this ?It doesn't seem hard to write.

Regardless, ack to the C patch. In the event of no test, please open a ticket so we do it shortly.

@firstyear - well we removed the ability to perform these types of backup/restores. So I don't really know if it is reproducible anymore (at least not how it was discovered). This was kind of sanity fix to make sure some other code path would not cause the crash.

The patch looks good to me as well.
But I do not understand how we get to the situation that priv->dblayer_home_directory or/and priv->li_directory are NULL.

The patch looks good to me as well.
But I do not understand how we get to the situation that priv->dblayer_home_directory or/and priv->li_directory are NULL.

Yeah I am not sure, and it might be impossible to get into this situation now that you can not do backups/restore of single backend, but better to be safe than sorry...

rebased onto d36f796

5 years ago

Pull-Request has been merged by mreynolds

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3123

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata