}
vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_user_name);
- if (vp && vp->vp_length == 0) {
+ if (!vp) {
RDEBUG("No User-Name, replying with Authentication-GetUser");
request->reply->code = FR_TACACS_CODE_AUTH_GETUSER;
-
} else {
RDEBUG("User-Name = %pV, replying with Authentication-GetPass", &vp->data);
request->reply->code = FR_TACACS_CODE_AUTH_GETPASS;
DECODE_FIELD_UINT8(attr_tacacs_authentication_service, pkt->authen_start.authen_service);
/*
- * Decode 4 fields, based on their "length"
+ * Decode 3 fields, based on their "length"
+ * user and rem_addr are optional - indicated by zero length
*/
p = body;
- DECODE_FIELD_STRING8(attr_tacacs_user_name, pkt->authen_start.user_len);
+ if (pkt->authen_start.user_len > 0) DECODE_FIELD_STRING8(attr_tacacs_user_name,
+ pkt->authen_start.user_len);
DECODE_FIELD_STRING8(attr_tacacs_client_port, pkt->authen_start.port_len);
- DECODE_FIELD_STRING8(attr_tacacs_remote_address, pkt->authen_start.rem_addr_len);
+ if (pkt->authen_start.rem_addr_len > 0) DECODE_FIELD_STRING8(attr_tacacs_remote_address,
+ pkt->authen_start.rem_addr_len);
/*
* Check the length on the various
/*
* Decode 3 fields, based on their "length"
+ * rem_addr is optional - indicated by zero length
*/
p = body;
DECODE_FIELD_STRING8(attr_tacacs_user_name, pkt->author_req.user_len);
DECODE_FIELD_STRING8(attr_tacacs_client_port, pkt->author_req.port_len);
- DECODE_FIELD_STRING8(attr_tacacs_remote_address, pkt->author_req.rem_addr_len);
+ if (pkt->author_req.rem_addr_len > 0) DECODE_FIELD_STRING8(attr_tacacs_remote_address,
+ pkt->author_req.rem_addr_len);
/*
* Decode 'arg_N' arguments (horrible format)