pppd-2.5_plugins_radius_bug.plaintext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Sorry for My English, it's not My native language.

I use pppd with FreeRADIUS server for pppoe server.

In DEBIAN 11 Linux with, I noticed these messages in /var/daemon.log:

RADIUS: Can't read config file /etc/radiusclient/radiusclient.conf

The problem is in: pppd/plugins/radius/config.c file.

In function:
int rc_read_config(char *filename)
between rows 236 to 260 we have:
|switch (option->type) {|
|    case OT_STR:|
|    if (set_option_str(filename, line, option, p) < 0)|
|            fclose(configfd);|
|            return (-1);|
|        break;|
|    case OT_INT:|
|        if (set_option_int(filename, line, option, p) < 0)|
|            fclose(configfd);|
|            return (-1);|
|        break;|
|    case OT_SRV:|
|        if (set_option_srv(filename, line, option, p) < 0)|
|            fclose(configfd);|
|            return (-1);|
|        break;|
|    case OT_AUO:|
|        if (set_option_auo(filename, line, option, p) < 0)|
|            fclose(configfd);|
|            return (-1);|
|    break;|
|        default:|
|        fatal("rc_read_config: impossible case branch!");|
|        abort();|
|}|

Operators after if is python like syntax, but this is C/C++

It must be:
|switch (option->type) {|
|    case OT_STR:|
|        if (set_option_str(filename, line, option, p) < 0) {|
|            fclose(configfd);|
|            return (-1);|
|    }|
|break;|
|    case OT_INT:|
|        if (set_option_int(filename, line, option, p) < 0) {|
|            fclose(configfd);|
|            return (-1);|
|        }|
|        break;|
|    case OT_SRV:|
|        if (set_option_srv(filename, line, option, p) < 0) {|
|            fclose(configfd);|
|            return (-1);|
|        }|
|        break;|
|    case OT_AUO:|
|        if (set_option_auo(filename, line, option, p) < 0) {|
|            fclose(configfd);|
|            return (-1);|
|        }|
|        break;|
|    default:|
|        fatal("rc_read_config: impossible case branch!");|
|        abort();|
|}|

with out curly braces operator: return(-1) is executed immediately in first iteration,

independent of if result(true or false).

and config file is not reading never.

After fix this problem all work fine!

I hope this post will save someone time.




[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux