Re: Using username@example.com and plain username
On Tue, September 18, 2012 17:34, Arran Cudbard-Bell wrote:
On 18 Sep 2012, at 22:22, "Kriston" <me@kriston.net> wrote:
I have users who log in as "username@example.com" and just as "username". How do I append @example.com only to those users who don't have @example.com already? I have a fairly generic FreeRADIUS 2.1.10 installation that connects to a MySQL server.
I've tried a number of different things in dialup.conf but none have worked.
Example 1: sql_user_name = "{%{Stripped-User-Name}:-%{User-Name}}@{%{Realm}:-example.com}"
This results in a string in the SQL queries for User-Name that looks like "=7B:-username=7D@=7B:-example.com=7D".
Look at all those lonely lonely left hand curly braces, don't you think they might appreciate another character to snuggle up to? What do you think that character might be?
While this comment is clever, would you provide a corrected example?
Example 2: I have also tried regular expressions like this: if ( %{User-Name} !~ /.example\.com/i) { sql_user_name = "%{User-Name}@example.com" } But this one results in a blank string for in the SQL queries that use sql_user_name.
I'm open to any and all comments.
Read man unlang, stop inventing syntax.
Why not post the correct syntax and show us? This mailing list could be so much more useful if people could provide actual answers instead of invectives. Reading the archives makes me feel embarrassed for the rest of the FreeRADIUS project. Kriston
Kriston wrote:
While this comment is clever, would you provide a corrected example?
See the default configuration files. There are HUNDREDS of examples.
Why not post the correct syntax and show us?
Because we did. The default configuration and documentation contains hundreds of examples of the correct syntax.
This mailing list could be so much more useful if people could provide actual answers instead of invectives. Reading the archives makes me feel embarrassed for the rest of the FreeRADIUS project.
Your concern is touching. You clearly care so much about the project that you can't be bothered to read the documentation so that you can use it correctly. The "sql_user_name" entry YOU EDITED contained a correct example. The "man ulang" documentation you were pointed to describes the syntax in detail. Can you explain how you took a WORKING EXAMPLE, and butchered it so badly? Hint: If you're too lazy to look at the existing examples, and read the existing documentation... them we're too lazy to "cut & paste" examples for you. Alan DeKok.
Kriston, You'll find that Alan and the rest of the volunteers who maintain the code base and the mailing list can be remarkably friendly and helpful, IFF the questions come from a place of obviously having read the documentation and tried the suggested process first. Snarkiness happens, but only when said documented processes and examples seem to have been ignored. After working your way through the wiki and the in-code documentation, perhaps you could contribute some ideas about how the existing materials could be make more useful to you. I'm sure that would be welcome... particularly if you offered to help :) Steve Lovaas ________________________________________ From: freeradius-users-bounces+steven.lovaas=colostate.edu@lists.freeradius.org [freeradius-users-bounces+steven.lovaas=colostate.edu@lists.freeradius.org] on behalf of Alan DeKok [aland@deployingradius.com] Sent: Tuesday, September 18, 2012 6:48 PM To: FreeRadius users mailing list Subject: Re: Using username@example.com and plain username Kriston wrote:
While this comment is clever, would you provide a corrected example?
See the default configuration files. There are HUNDREDS of examples.
Why not post the correct syntax and show us?
Because we did. The default configuration and documentation contains hundreds of examples of the correct syntax.
This mailing list could be so much more useful if people could provide actual answers instead of invectives. Reading the archives makes me feel embarrassed for the rest of the FreeRADIUS project.
Your concern is touching. You clearly care so much about the project that you can't be bothered to read the documentation so that you can use it correctly. The "sql_user_name" entry YOU EDITED contained a correct example. The "man ulang" documentation you were pointed to describes the syntax in detail. Can you explain how you took a WORKING EXAMPLE, and butchered it so badly? Hint: If you're too lazy to look at the existing examples, and read the existing documentation... them we're too lazy to "cut & paste" examples for you. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 19 Sep 2012, at 00:20, Kriston <me@kriston.net> wrote:
On Tue, September 18, 2012 17:34, Arran Cudbard-Bell wrote:
On 18 Sep 2012, at 22:22, "Kriston" <me@kriston.net> wrote:
I have users who log in as "username@example.com" and just as "username". How do I append @example.com only to those users who don't have @example.com already? I have a fairly generic FreeRADIUS 2.1.10 installation that connects to a MySQL server.
I've tried a number of different things in dialup.conf but none have worked.
Example 1: sql_user_name = "{%{Stripped-User-Name}:-%{User-Name}}@{%{Realm}:-example.com}"
This results in a string in the SQL queries for User-Name that looks like "=7B:-username=7D@=7B:-example.com=7D".
Look at all those lonely lonely left hand curly braces, don't you think they might appreciate another character to snuggle up to? What do you think that character might be?
While this comment is clever, would you provide a corrected example?
Phil Mayers has now done that. I mean come on, every other variable expansion begins with %{. The default example that you edited even shows the correct syntaxt: https://github.com/alandekok/freeradius-server/blob/master/raddb/sql/mysql/d...
Example 2: I have also tried regular expressions like this: if ( %{User-Name} !~ /.example\.com/i) { sql_user_name = "%{User-Name}@example.com" } But this one results in a blank string for in the SQL queries that use sql_user_name.
I'm open to any and all comments.
Read man unlang, stop inventing syntax.
Why not post the correct syntax and show us?
Why don't you go read man unlang and post the correct syntax? :) -Arran
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Kriston -
Lovaas,Steven