[Patch] Pre-Acct-Type dict value registration
Hi, all I noticed that there might be codes missing in modules.c for Pre-Acct-Type. This will crash the radiusd server if thre is pre-acct sub-list in radiusd.conf. The patch is created for FreeRADIUS-1.1.2, I've tested it against FreeRADIUS-1.1.6. Best regards, Lv Zheng Index: freeradius-1.1.2/src/main/modules.c =================================================================== --- freeradius-1.1.2.orig/src/main/modules.c 2007-04-26 06:02:03.000000000 +0800 +++ freeradius-1.1.2/src/main/modules.c 2007-04-26 06:02:32.000000000 +0800 @@ -497,6 +497,8 @@ dval = dict_valbyname(PW_AUTH_TYPE, cf_section_name2(cs)); } else if (comp == RLM_COMPONENT_AUTZ) { dval = dict_valbyname(PW_AUTZ_TYPE, cf_section_name2(cs)); + } else if (comp == RLM_COMPONENT_PREACCT) { + dval = dict_valbyname(PW_PRE_ACCT_TYPE, cf_section_name2(cs)); } else if (comp == RLM_COMPONENT_ACCT) { dval = dict_valbyname(PW_ACCT_TYPE, cf_section_name2(cs)); } else if (comp == RLM_COMPONENT_SESS) { ============================================= Soliton Network Systems (Shanghai) Co., Ltd. EMAIL: lv.zheng@soliton.com.cn =============================================
Lv Zheng wrote:
I noticed that there might be codes missing in modules.c for Pre-Acct-Type. This will crash the radiusd server if thre is pre-acct sub-list in radiusd.conf.
I don't see why you need such a patch. It's possible to set "Acct-Type" during pre-accounting because it runs before accounting. But it's no use to set "Pre-Acct-Type" because it is the first section to be processed. That's why if you set "Pre-Acct-Type" during pre-accounting, it's already too late. I think there is some confusion because the section "authorize" works differently. The server runs the section twice if "Auth-Type" has been set. -- Nicolas Baradakis
Nicolas Baradakis wrote:
Lv Zheng wrote:
I noticed that there might be codes missing in modules.c for Pre-Acct-Type. This will crash the radiusd server if thre is pre-acct sub-list in radiusd.conf.
I don't see why you need such a patch. It's possible to set "Acct-Type" during pre-accounting because it runs before accounting. But it's no use to set "Pre-Acct-Type" because it is the first section to be processed. That's why if you set "Pre-Acct-Type" during pre-accounting, it's already too late.
I think there is some confusion because the section "authorize" works differently. The server runs the section twice if "Auth-Type" has been set.
Thank you for pointing out this. The code is useless. The requirement is coming from our QCs, when they were to create a Pre-Acct-Type sub-list through some configuration APIs (based on libradius & libradiusd), the libradiusd crashed. So we need this for the modified libradiusd (according to your statement, there should be a better way to avoid this). Thx & rgds / Lv Zheng
Lv Zheng wrote:
The requirement is coming from our QCs, when they were to create a Pre-Acct-Type sub-list through some configuration APIs (based on libradius & libradiusd), the libradiusd crashed. So we need this for the modified libradiusd (according to your statement, there should be a better way to avoid this).
There is no libradiusd. The bug is in your code, not in FreeRADIUS. If your company is developing a product based on modifying the FreeRADIUS source code, then the GPL license MUST be followed. There will be no exceptions. That is, any code using "libradiusd" MUST be GPL'd. If you're not willing to GPL it, then you CANNOT use the GPL code in FreeRADIUS, and you CANNOT use libradiusd. Alan DeKok.
Alan DeKok wrote:
If your company is developing a product based on modifying the FreeRADIUS source code, then the GPL license MUST be followed. There will be no exceptions.
"libradiusd" is also a part of my win32 FreeRADIUS port. Modules are calling APIs exported by it. I'm planning to publish this win32-FreeRADIUS variation under GPL. I wish it would be useful for FreeRADIUS users.
That is, any code using "libradiusd" MUST be GPL'd. If you're not willing to GPL it, then you CANNOT use the GPL code in FreeRADIUS, and you CANNOT use libradiusd.
It is sad to me, I really had a funny toy for FreeRADIUS, but I also built it upon software modules that are not owned by me... Best regards, Lv Zheng
Lv Zheng wrote:
"libradiusd" is also a part of my win32 FreeRADIUS port.
Why? I don't understand. The server is Posix, and almost everything should build as part of MingW. There's very little that needs to be done to port it to Windows.
Modules are calling APIs exported by it.
Which is already done in the server. Is there a particular need for a library under Windows?
I'm planning to publish this win32-FreeRADIUS variation under GPL. I wish it would be useful for FreeRADIUS users.
Since FreeRADIUs is under the GPL, I would say also that the variant has to be distributed under the GPL.
That is, any code using "libradiusd" MUST be GPL'd. If you're not willing to GPL it, then you CANNOT use the GPL code in FreeRADIUS, and you CANNOT use libradiusd.
It is sad to me, I really had a funny toy for FreeRADIUS, but I also built it upon software modules that are not owned by me...
That doesn't really matter. ANY company or individual who is distributing a product based on FreeRADIUS code in a "libradiusd" MUST release the full source code to their application under the GPL, OR stop using the FreeRADIUS source code. If this product is distributed anywhere in the world, then the FreeRADIUS developers *will* enforce their copyright. I suggest you inform your superiors that it may not be legal to sell the product you have built. This limitation has obvious business impacts. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
participants (4)
-
Alan DeKok -
Alan Dekok -
Lv Zheng -
Nicolas Baradakis