Tuesday, March 3, 2020

[389-commits] [389-ds-base] branch 389-ds-base-1.3.10 updated: Issue 50920 - cl-dump exit code is 0 even if command fails with invalid arguments

This is an automated email from the git hooks/post-receive script.

spichugi pushed a commit to branch 389-ds-base-1.3.10
in repository 389-ds-base.

The following commit(s) were added to refs/heads/389-ds-base-1.3.10 by this push:
new 0ba1a6c Issue 50920 - cl-dump exit code is 0 even if command fails with invalid arguments
0ba1a6c is described below

commit 0ba1a6c95d1146be55837bf903924ea86466e75f
Author: Simon Pichugin <spichugi@redhat.com>
AuthorDate: Fri Feb 28 14:29:06 2020 +0100

Issue 50920 - cl-dump exit code is 0 even if command fails with invalid arguments

Description of problem:
When running the cl-dump.pl script with invalid arguments, the exit code is always 0,
even if an error message is reported.

Fix Description:
Pass the return code to the end of the #main.
Change CI test accordingly.

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

Reviewed by: vashirov, mreynolds (Thanks!)
---
ldap/admin/src/scripts/cl-dump.pl | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ldap/admin/src/scripts/cl-dump.pl b/ldap/admin/src/scripts/cl-dump.pl
index 2e7f204..e56c803 100755
--- a/ldap/admin/src/scripts/cl-dump.pl
+++ b/ldap/admin/src/scripts/cl-dump.pl
@@ -101,16 +101,17 @@ $version = "Directory Server Changelog Dump - Version 1.0";
}

if (!$opt_i) {
- &cl_dump_and_decode;
+ $rc = &cl_dump_and_decode;
}
elsif ($opt_c) {
- &grep_csn ($opt_i);
+ $rc = &grep_csn ($opt_i);
}
else {
- &cl_decode ($opt_i);
+ $rc = &cl_decode ($opt_i);
}

close (OUTPUT);
+ exit($rc);
}

# Validate the parameters
@@ -209,6 +210,7 @@ sub cl_dump_and_decode
&print_header ($replica, "Not Found") if !$gotldif;
}
$conn->close;
+ return 0;
}

sub print_header
@@ -260,6 +262,7 @@ sub grep_csn
printf OUTPUT "; $modts" if $modts;
printf OUTPUT ")\n";
}
+ return 0;
}

sub csn_to_string
@@ -316,4 +319,5 @@ sub cl_decode
/^\s*(\S+)\s*\n/;
$encoded .= $1;
}
+ return 0;
}

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment