- Ustrncpy(opts, "header", sizeof(opts)-1);
- Ustrncpy(client_ip, dcc_ip_option, sizeof(client_ip)-1);
- /* If the dcc_client_ip is not provided use the
- * sender_host_address or 127.0.0.1 if it is NULL */
- DEBUG(D_acl)
- debug_printf("DCC: my_ip_option = %s - client_ip = %s - sender_host_address = %s\n", dcc_ip_option, client_ip, sender_host_address);
- if(!(Ustrcmp(client_ip, ""))){
- /* Do we have a sender_host_address or is it NULL? */
- if(sender_host_address){
- Ustrncpy(client_ip, sender_host_address, sizeof(client_ip)-1);
- } else {
- /* sender_host_address is NULL which means it comes from localhost */
- Ustrncpy(client_ip, dcc_default_ip_option, sizeof(client_ip)-1);
- }
+ Ustrncpy(opts, dccifd_options, sizeof(opts)-1);
+ /* if $acl_m_dcc_override_client_ip is set use it */
+ if (((override_client_ip = expand_string(US"$acl_m_dcc_override_client_ip")) != NULL) &&
+ (override_client_ip[0] != '\0')) {
+ Ustrncpy(client_ip, override_client_ip, sizeof(client_ip)-1);
+ DEBUG(D_acl)
+ debug_printf("DCC: Client IP (overridden): %s\n", client_ip);
+ }
+ else if(sender_host_address) {
+ /* else if $sender_host_address is available use that? */
+ Ustrncpy(client_ip, sender_host_address, sizeof(client_ip)-1);
+ DEBUG(D_acl)
+ debug_printf("DCC: Client IP (sender_host_address): %s\n", client_ip);
+ }
+ else {
+ /* sender_host_address is NULL which means it comes from localhost */
+ Ustrncpy(client_ip, dcc_default_ip_option, sizeof(client_ip)-1);
+ DEBUG(D_acl)
+ debug_printf("DCC: Client IP (default): %s\n", client_ip);