summaryrefslogtreecommitdiff
path: root/libtac/lib/acct_s.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtac/lib/acct_s.c')
-rw-r--r--libtac/lib/acct_s.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libtac/lib/acct_s.c b/libtac/lib/acct_s.c
index f297530..c1de720 100644
--- a/libtac/lib/acct_s.c
+++ b/libtac/lib/acct_s.c
@@ -79,12 +79,17 @@ int tac_acct_send(int fd, int type, const char *user, char *tty,
tb.flags=(u_char) type;
tb.authen_method=tac_authen_method;
tb.priv_lvl=tac_priv_lvl;
- if (strcmp(tac_login,"chap") == 0) {
- tb.authen_type=TAC_PLUS_AUTHEN_TYPE_CHAP;
- } else if(strcmp(tac_login,"login") == 0) {
- tb.authen_type=TAC_PLUS_AUTHEN_TYPE_ASCII;
+ if (tac_login == NULL) {
+ /* default to PAP */
+ tb.authen_type = TAC_PLUS_AUTHEN_TYPE_PAP;
} else {
- tb.authen_type=TAC_PLUS_AUTHEN_TYPE_PAP;
+ if (strcmp(tac_login,"chap") == 0) {
+ tb.authen_type=TAC_PLUS_AUTHEN_TYPE_CHAP;
+ } else if(strcmp(tac_login,"login") == 0) {
+ tb.authen_type=TAC_PLUS_AUTHEN_TYPE_ASCII;
+ } else {
+ tb.authen_type=TAC_PLUS_AUTHEN_TYPE_PAP;
+ }
}
tb.authen_service=tac_authen_service;
tb.user_len=user_len;