attr filter "attrsfile" -> "file"

Arran Cudbard-Bell a.cudbardb at freeradius.org
Wed Jan 9 12:23:37 CET 2013


On 9 Jan 2013, at 10:20, Brian Candler <B.Candler at pobox.com> wrote:

> On Tue, Jan 08, 2013 at 09:53:00AM -0500, Alan DeKok wrote:
>>> attrfilter {
>>> 	authorize {
>>> 		file =
>>> 	}
>>> 	preacct {
>>> 		file = 
>>> 	}
>>> }
>> 
>>  or even:
>> 
>> attrfilter {
>> 	authorize.file = ...
>> 	preacct.file = ...
>> 
>> }
>> 
>>  Which is nice, but doesn't fit the subsection paradigm.
> 
> Are you planning to change other modules this way? For example, rlm_files
> has

Yes, rlm_detail and fastusers shold be changed too.

> 
> usersfile
> acctusersfile
> preproxy_usersfile
> auth_usersfile
> postproxy_usersfile
> postauth_usersfile
> 
> I don't see what's wrong with this myself, apart from the missing underscore
> in acctusersfile not being consistent with the rest.

Nothing, except the fact that there's no way to infer the correct config item name.

If we switch to use section.file, you know that if any module that reads or writes to a file you can always do:

authorize {
	file = <foo>
}

Also if you see that the example has:

authorize {
	file = <foo>
}

and 

authenticate {
	file = <foo>
}

you can assume there's going to be

postauth {
	file = <foo>
}

That's the point of making things consistent, so you don't have to waste time referring to the man pages and documentation.

Also adding a module specific prefix to 'file' is wrong. You know what type of file it is by the module section it's declared in. The only place this would be of use would be in a completely flat namespace.

Maybe Cistron had a flat namespace (I don't know),  but FreeRADIUS certainly doesn't now. It's pointless keeping the prefixes everywhere, it just makes it harder to infer the correct config item name.

-Arran







More information about the Freeradius-Devel mailing list