[28824] in CVS-changelog-for-Kerberos-V5
krb5 commit: Fix kadmin script mode command-not-found error
daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Feb 27 18:58:49 2015
Date: Fri, 27 Feb 2015 18:56:56 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201502272356.t1RNuuaY019695@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/9c491320f72f1e07f87c1cf5b7671505f3526891
commit 9c491320f72f1e07f87c1cf5b7671505f3526891
Author: Greg Hudson <ghudson@mit.edu>
Date: Thu Feb 26 15:02:37 2015 -0500
Fix kadmin script mode command-not-found error
In ss_wrapper.c, if ss_execute_command() returns an error, we should
call ss_perror() with *args as the third argument and not request
(which is NULL). Expand out the conditional into three commented
branches for greater clarity, since the error-handling is no longer
identical for the ss_execute_command() and ss_execute_line() cases.
ticket: 7991
src/kadmin/cli/ss_wrapper.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/kadmin/cli/ss_wrapper.c b/src/kadmin/cli/ss_wrapper.c
index d9a1d8f..776c383 100644
--- a/src/kadmin/cli/ss_wrapper.c
+++ b/src/kadmin/cli/ss_wrapper.c
@@ -49,17 +49,25 @@ main(int argc, char *argv[])
ss_perror(sci_idx, retval, _("creating invocation"));
exit(1);
}
- if (request == NULL && *args == NULL) {
- (void)ss_listen(sci_idx);
- } else {
- if (request != NULL)
- code = ss_execute_line(sci_idx, request);
- else
- code = ss_execute_command(sci_idx, args);
+
+ if (*args != NULL) {
+ /* Execute post-option arguments as a single script-mode command. */
+ code = ss_execute_command(sci_idx, args);
+ if (code) {
+ ss_perror(sci_idx, code, *args);
+ exit_status = 1;
+ }
+ } else if (request != NULL) {
+ /* Execute the -q option as a single interactive command. */
+ code = ss_execute_line(sci_idx, request);
if (code != 0) {
ss_perror(sci_idx, code, request);
exit_status = 1;
}
+ } else {
+ /* Prompt for commands. */
+ (void)ss_listen(sci_idx);
}
+
return quit() ? 1 : exit_status;
}
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5