Skip to content

Commit

Permalink
cvtsudoers_ldif: display warning on write error
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Nov 11, 2023
1 parent 7e46326 commit 2c06aa3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/sudoers/cvtsudoers_ldif.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,17 @@ convert_sudoers_ldif(const struct sudoers_parse_tree *parse_tree,
goto cleanup;
}

ret = true;

cleanup:
if (seen_users != NULL)
rbdestroy(seen_users, seen_user_free);

(void)fflush(output_fp);
if (!ferror(output_fp))
ret = true;
if (ferror(output_fp)) {
sudo_warn("%s", output_file);
ret = false;
}
if (output_fp != stdout)
fclose(output_fp);

Expand Down

0 comments on commit 2c06aa3

Please sign in to comment.