From: Alan T. DeKok Date: Tue, 3 Sep 2019 17:57:16 +0000 (-0400) Subject: don't save exit / quit / secret / etc. in history file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a3d83d7b2588232e4746699ea80e0ffd2c8a499;p=thirdparty%2Ffreeradius-server.git don't save exit / quit / secret / etc. in history file --- diff --git a/src/modules/proto_control/radmin.c b/src/modules/proto_control/radmin.c index f095ed9c33e..ecc1691a696 100644 --- a/src/modules/proto_control/radmin.c +++ b/src/modules/proto_control/radmin.c @@ -995,11 +995,6 @@ int main(int argc, char **argv) if (!*line) goto next; - if (!quiet) { - add_history(line); - write_history(history_file); - } - if (strcmp(line, "reconnect") == 0) { if (do_connect(&sockfd, file, server) < 0) exit(EXIT_FAILURE); goto next; @@ -1049,6 +1044,20 @@ int main(int argc, char **argv) } else if (len == FR_CONDUIT_FAIL) { fprintf(stderr, "Failed running command\n"); exit_status = EXIT_FAILURE; + + } else if (len == FR_CONDUIT_PARTIAL) { + fprintf(stdout, "WARNING: Ignoring partial command.\n"); + + } else { + /* + * Add only successful commands to the history. + * + * Don't add exit / quit / secret / etc. + */ + if (!quiet) { + add_history(line); + write_history(history_file); + } } /*