Working with Visual Foxpro and RadiusNT

Marlon Reinaldo Cardoso ( (no email) )
Thu, 24 Apr 1997 01:29:58 -0300

Hello Dale, I would like first to thank you by your answer for my question,
and please if you can, look below and see if I am right.

You wrote:

>>
>> SQL Statement: Select Name, RadAttributeID, Type From RadAttributes
>>
>> SQL Statement: Select ra.Name, rv.Name, rv.Value From RadValues rv,
>RadAttribut
>> es ra Where rv.RadAttributeID = ra.RadAttributeId

>You don't have the dictionary in. You need to populate the above two
>tables with the data from the tables in the Access database.

The tables where populated and with no diferences in the contents of any
field (I did a export from Access 7 and I change the name of the fields to
match the names in the Access table for all the tables in the database)

>> odbc_read_client_info()
>> Allocating Statement...
>>
>> SQL Statement: Select Server, IPAddress, Secret From Servers
>>
>> Client:localhost :127.0.0.1 :localhost
>>
>> Client:200.231.198.165 :200.231.198.165:testing123

>This is going to cause a problem. You are using char, not varcahar,
>here. There should NOT be any spaces in there. For example:

>Client:200.231.198.165:200.231.198.165:testing123

Perfectly right but please see my next comment....

>> Loading users...
>> radius: attribute name Password not found
>> radius: Parse error -95 for user test
>> LOG: radius: Parse error -95 for user test
>>
>> 0 users loaded!

>This is because your are in both mode, and RadiusNT didn't
>find the attrbute name "Password" in the dictionary (thats
>because no dictionary loaded in).

The dictionary is loaded in once that I had populated the tables correctly,
but as far as I believe your program is receiving the data with trailling
spaces, in this case 17 characters of trailling spaces, once that Visual
Foxpro ODBC driver send the full size of the field, not only the filled
part, and probably your program look for "Password" not "Password" plus the
17 trailling spaces to find the value of the field.

I did a test, in which I change the size of the field in my Visual Foxpro
3.0 database to 8 (eight) (which is the size of "Password") and I got:

D:\radius>radius -x15

RadiusNT 1.16.60 2/7/97 Copyright (c) 1996 IEA Software, Inc.
All Rights Reserved, Worldwide

Some portions Copyright (c) 1992 Livingston Enterprises, Inc.
and Copyright (c) 1995 Ascend Communications, Inc.

0) EncryptPasswords: 0
1) IgnoreCase: 0
2) ReqAcctAuth: 0
3) Mode: 2
4) Options: 0
5) Debug: 0
6) ODBCDatasource: Radius
7) DataDirectory: d:\radius\
8) AcctDirectory: d:\radius\acct\
9) UsersFile: users
10) Username:
11) Password:

Param: Debug Level: 15
Initializing Winsock...
ODBC Datasource: 'Radius'...
Allocating ODBC Henv...
Allocating ODBC Connect...
Making ODBC Connection...
Allocating Statement...

SQL Statement: Select Name, RadAttributeID, Type From RadAttributes

SQL Statement: Select ra.Name, rv.Name, rv.Value From RadValues rv,
RadAttribut
es ra Where rv.RadAttributeID = ra.RadAttributeId

odbc_read_client_info()
Allocating Statement...

SQL Statement: Select Server, IPAddress, Secret From Servers

Client:200.231.198.165:200.231.198.165:testing123
Allocating Statement...
Accounting Column 0: 'nasidentifier'
Accounting Column 1: 'nasport'
Accounting Column 2: 'acctsessionid'
Accounting Column 3: 'acctstatustype'
Accounting Column 4: 'calldate'
Accounting Column 5: 'username'
Accounting Column 6: 'acctauthentic'
Accounting Column 7: 'userservice'
Accounting Column 8: 'loginservice'
Accounting Column 9: 'loginhost'
Accounting Column 10: 'acctdelaytime'
Accounting Column 11: 'acctsessiontime'
Accounting Column 12: 'framedprotocol'
Accounting Column 13: 'framedaddress'
Accounting Column 14: 'acctinputoctets'
Accounting Column 15: 'acctoutputoctets'
Accounting Column 16: 'acctinputpackets'
Accounting Column 17: 'acctoutputpackets'
Accounting Column 18: 'nasporttype'
Accounting Column 19: 'clientportdnis'
config_init(): dict_valfind(Lifetime-In-Days) not found.

Loading users...
radius: attribute name User-Service not found
radius: Parse error -95 for user test
0 users loaded!

Radius NT is ready to receive requests!

--Please notice that the attribute name Password was (I think) loaded, so I
took out the line " User-Service = Framed-User" and my users file becames
the following:

test<TAB>Password = "test"
<BLANK LINE>

and nothing else, so I got:

D:\radius>radius -x15

RadiusNT 1.16.60 2/7/97 Copyright (c) 1996 IEA Software, Inc.
All Rights Reserved, Worldwide

Some portions Copyright (c) 1992 Livingston Enterprises, Inc.
and Copyright (c) 1995 Ascend Communications, Inc.

0) EncryptPasswords: 0
1) IgnoreCase: 0
2) ReqAcctAuth: 0
3) Mode: 2
4) Options: 0
5) Debug: 0
6) ODBCDatasource: Radius
7) DataDirectory: d:\radius\
8) AcctDirectory: d:\radius\acct\
9) UsersFile: users
10) Username:
11) Password:

Param: Debug Level: 15
Initializing Winsock...
ODBC Datasource: 'Radius'...
Allocating ODBC Henv...
Allocating ODBC Connect...
Making ODBC Connection...
Allocating Statement...

SQL Statement: Select Name, RadAttributeID, Type From RadAttributes

SQL Statement: Select ra.Name, rv.Name, rv.Value From RadValues rv,
RadAttribut
es ra Where rv.RadAttributeID = ra.RadAttributeId

odbc_read_client_info()
Allocating Statement...

SQL Statement: Select Server, IPAddress, Secret From Servers

Client:200.231.198.165:200.231.198.165:testing123
Allocating Statement...
Accounting Column 0: 'nasidentifier'
Accounting Column 1: 'nasport'
Accounting Column 2: 'acctsessionid'
Accounting Column 3: 'acctstatustype'
Accounting Column 4: 'calldate'
Accounting Column 5: 'username'
Accounting Column 6: 'acctauthentic'
Accounting Column 7: 'userservice'
Accounting Column 8: 'loginservice'
Accounting Column 9: 'loginhost'
Accounting Column 10: 'acctdelaytime'
Accounting Column 11: 'acctsessiontime'
Accounting Column 12: 'framedprotocol'
Accounting Column 13: 'framedaddress'
Accounting Column 14: 'acctinputoctets'
Accounting Column 15: 'acctoutputoctets'
Accounting Column 16: 'acctinputpackets'
Accounting Column 17: 'acctoutputpackets'
Accounting Column 18: 'nasporttype'
Accounting Column 19: 'clientportdnis'
config_init(): dict_valfind(Lifetime-In-Days) not found.

Loading users...
User:test
1 users loaded!

Radius NT is ready to receive requests!

--- I open another command window and I run the radlogin to test and I got:

D:\radius>radlogin test test

Checking Radius user test:
0: Time: 281 Auth: Bad

0 Good 1 Bad 281 Avg

D:\radius>

--- In the window where radius was started I got:

radrecv: Request from host c8e7c6a5 code=1, id=1, length=0
NAS-Iden = 127.0.0.1
NAS-Port = Async
User-Nam = "test"
Password = "\261\354\227nK\212&I\347d!\015%D\313X"
rad_authenticate_ODBC()
Password = "\261\354\227nK\212&I\347d!\015%D\313X"
Decrypted Password: test
Allocating Statement...

SQL Statement: Select DateAdd(Day, ma.extension, maExpireDate),
DateAdd(Day, sa
..extension, saExpireDate), sa.AccountID, sa.AccountType, sa.Password,
sa.Login,
sa.Shell From MasterAccounts ma, SubAccounts sa Where (sa.Login='test' or
sa.She
ll='test') AND ma.CustomerID=sa.CustomerID and sa.Active<>0 and
ma.Active<>0

LOG: ODBC: SQLExecDirect Error:
[Microsoft][ODBC Visual FoxPro Driver]SQL: Column 'DAY' is not found.

ODBC: SQLExecDirect Error:
[Microsoft][ODBC Visual FoxPro Driver]SQL: Column 'DAY' is not found.
Sending Reject of id 1 to c8e7c6a5 (200.231.198.165)

Response Time: 231

--- I really think that all the problems are in the trailling spaces which
your software receives, but I don't know how to configure or change or do
anything else to send the data without the trailling spaces, I think that
is even impossible because looking at the Visual Foxpro 3.0 help I got:

If Visual FoxPro data exists in a cursor that originated from remote data,
the data goes back to its original ODBC type when sent to the remote
server. If you send data that originated in Visual FoxPro to the remote
server via SQL pass-through, the following conversions apply.

Visual FoxPro data type ODBC data type
Character SQL_CHAR or SQL_LONGVARCHAR (1)
Currency SQL_DECIMAL
Date SQL_DATE or
SQL_TIMESTAMP (2)
DateTime SQL_TIMESTAMP
Double SQL_DOUBLE
Integer SQL_INTEGER
General SQL_LONGVARBINARY
Logical SQL_BIT
Memo SQL_LONGVARCHAR
Numeric SQL_DOUBLE

---I am asking some persons to know if they can give some help on this
task, but I need to know (first of all) if I am on the right way, and
pleeeeeeeaaaaaaase if you know something about this tell me, I am getting
crazy with this problem.

--- Thanks in advance, and please let me know if I am bothering you.

... another working day, another no sleeping night....

Marlon Cardoso
marlon@globonet.com.br