diff --git a/src/tacacs/bash_tacplus/bash_tacplus.c b/src/tacacs/bash_tacplus/bash_tacplus.c index 82f57c724c7d..85756de31981 100644 --- a/src/tacacs/bash_tacplus/bash_tacplus.c +++ b/src/tacacs/bash_tacplus/bash_tacplus.c @@ -471,8 +471,9 @@ int on_shell_execve (char *user, int shell_level, char *cmd, char **argv) fprintf(stdout, "%s not authorized by TACACS+ with given arguments, not executing\n", cmd); break; default: + // when command reject by server, authorization will failed immediately fprintf(stdout, "%s authorize failed by TACACS+ with given arguments, not executing\n", cmd); - break; + return ret; } if ((tacacs_ctrl & AUTHORIZATION_FLAG_LOCAL) == 0) {