pppd-2.5_plugins_radius_bug.plaintext

Peter Developer <[email protected]>
Newsgroups gmane.linux.ppp
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.