Hello,

We are currently getting some interesting accounting packets that are
coming in with User-Name of NULL.  We would like to use rlm_rewrite to
change all NULL usernames to something else.

We are running freebsd 4.8 with freeradius .9.

Here is what I setup so far.

        attr_rewrite noname {
                attribute = User-Name
                searchin = packet
                searchfor = *
                replacewith = "ihavenoname"
                ignore_case = yes
                new_attribute = no
                max_matches = 10
                append = no
        }

* we have tried
"NULL"
"[^*$]"
"[^\\000$]"

Then in the accounting section we added noname

accounting {
        noname
        acct_unique
        detail1
        detail2
}


However, it doesn't seem to match when we send a User-Name attribute
with a NULL value.  We tried it with radclient and sent
User-Name=""
User-Name=" "

The message we get is

rlm_attr_rewrite: Attribute User-Name string value NULL or of zero length
  modcall[accounting]: module "nodomain" returns noop

I'm guessing that rlm_rewrite can't change a NULL User-Name setting
because its looking for something to change to something else.

We also gave a shot with preproxy_users, but it doesn't seem to be picked
up.  Is that enabled in freeradius .9?

DEFAULT
        User-Name := "ihavenoname"

The rlm_rewrite does work with a valid User-Name

rlm_attr_rewrite: Changed value for attribute User-Name from 'a' to
'ihavenoname'
  modcall[accounting]: module "nodomain" returns ok

This was sending an accounting packet with User-Name of a.

Any ideas of anything else we could try, or perhaps a recent cvs snapshot?

Thanks

Dustin Doris

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to