libsemanage: Return commit number if save-previous false

Stop overwriting the commit number for the default save-previous flag
setting (false) in semanage.conf.

Allows semodule -v -i <policy> to show the correct commit number.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
This commit is contained in:
Richard Haines 2018-01-22 16:38:11 +00:00 committed by Stephen Smalley
parent 2f26c1db5d
commit f47c291cf8

View File

@ -1740,9 +1740,9 @@ static int semanage_commit_sandbox(semanage_handle_t * sh)
if (!sh->conf->save_previous) {
int errsv = errno;
retval = semanage_remove_directory(backup);
if (retval < 0) {
if (semanage_remove_directory(backup) != 0) {
ERR(sh, "Could not delete previous directory %s.", backup);
retval = -1;
goto cleanup;
}
errno = errsv;