linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Developer <developer@isp.bg>
To: linux-ppp@vger.kernel.org
Subject: pppd-2.5_plugins_radius_bug.plaintext
Date: Fri, 21 Apr 2023 18:12:21 +0300	[thread overview]
Message-ID: <bc6a5031-f533-d8ca-cb2d-3d5329091a07@isp.bg> (raw)

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.


                 reply	other threads:[~2023-04-21 15:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc6a5031-f533-d8ca-cb2d-3d5329091a07@isp.bg \
    --to=developer@isp.bg \
    --cc=linux-ppp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).