Opened 13 years ago

Closed 12 years ago

#33546 closed enhancement (fixed)

freeradius: add mysql variant

Reported by: hackdefendr (HackDefendr) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: haspatch Cc:
Port: freeradius

Description

Freeradius will not build with MySQL support automatically. I am forced to put in configure.args-append manually.

checking for mysql_init in -lmysqlclient_r... no
configure: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=<path>.
checking for mysql/mysql.h... no
configure: WARNING: MySQL headers not found. Use --with-mysql-include-dir=<path>.
configure: WARNING: silently not building rlm_sql_mysql.
configure: WARNING: FAILURE: rlm_sql_mysql requires: libmysqlclient_r mysql.h.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h

Created patch for Portfile...testing and verification info:


Checking variant mysql successfully added to Portfile

# port info freeradius
freeradius @2.1.9, Revision 1 (sysutils)
Variants:             kerberos, mysql, (-)universal

Confirming MySQL detected by configure

=== configuring in ./drivers/rlm_sql_mysql (/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_freeradius/freeradius/work/freeradius-server-2.1.9/src/modules/rlm_sql/./drivers/rlm_sql_mysql)
configure: running /bin/sh ./configure '--prefix=/opt/local'  '--host=x86_64-apple-darwin11.3.0' '--build=x86_64-apple-darwin11.3.0' '--with-modules=rlm_sql' '--with-mysql-lib-dir=/opt/local/lib/mysql5/mysql' '--with-mysql-include-dir=/opt/local/include/mysql5' '--without-rlm_krb5' '--with-openssl-includes=/opt/local/include/openssl' '--with-openssl-libraries=/opt/local/lib' '--with-system-libtool' 'build_alias=x86_64-apple-darwin11.3.0' 'host_alias=x86_64-apple-darwin11.3.0' '--enable-ltdl-install=no' --cache-file=/dev/null --srcdir=.
checking for x86_64-apple-darwin11.3.0-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for mysql_config... no
checking for pthread_create in -lpthread... yes
checking for mysql_init in -lmysqlclient_r... yes
checking for mysql/mysql.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h

Post make, confirming SQL module built successfully

x ./opt/local/lib/rlm_sql_mysql-2.1.9.la
x ./opt/local/lib/rlm_sql_mysql-2.1.9.so
x ./opt/local/lib/rlm_sql_mysql.a
x ./opt/local/lib/rlm_sql_mysql.la
x ./opt/local/lib/rlm_sql_mysql.so

Testing proper SQL module linking using: radiusd -X

rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to radius@localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql_mysql: Starting connect to MySQL server for #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql_mysql: Starting connect to MySQL server for #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql_mysql: Starting connect to MySQL server for #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql_mysql: Starting connect to MySQL server for #4
rlm_sql (sql): Connected new DB handle, #4
rlm_sql (sql): Processing generate_sql_clients
rlm_sql (sql) in generate_sql_clients: query is SELECT id, nasname, shortname, type, secret, server FROM nas
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql (sql): Released sql socket id: 4

Running required radtest to verify test user

$ radtest sqltest testpwd localhost 1812 testing123
Sending Access-Request of id 246 to 127.0.0.1 port 1812
	User-Name = "sqltest"
	User-Password = "testpwd"
	NAS-IP-Address = 192.168.1.4
	NAS-Port = 1812
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=246, length=20

Further confirming SQL module success via radiusd debug output

rad_recv: Access-Request packet from host 127.0.0.1 port 55590, id=246, length=59
	User-Name = "sqltest"
	User-Password = "testpwd"
	NAS-IP-Address = 192.168.1.4
	NAS-Port = 1812
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "sqltest", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[eap] No EAP-Message, not doing EAP
++[eap] returns noop
[sql] 	expand: %{User-Name} -> sqltest
[sql] sql_set_user escaped user --> 'sqltest'
rlm_sql (sql): Reserving sql socket id: 3
[sql] 	expand: SELECT id, username, attribute, value, op           FROM radcheck           WHERE username = '%{SQL-User-Name}'           ORDER BY id -> SELECT id, username, attribute, value, op           FROM radcheck           WHERE username = 'sqltest'           ORDER BY id
WARNING: Found User-Password == "...".
WARNING: Are you sure you don't mean Cleartext-Password?
WARNING: See "man rlm_pap" for more information.
[sql] User found in radcheck table
[sql] 	expand: SELECT id, username, attribute, value, op           FROM radreply           WHERE username = '%{SQL-User-Name}'           ORDER BY id -> SELECT id, username, attribute, value, op           FROM radreply           WHERE username = 'sqltest'           ORDER BY id
[sql] 	expand: SELECT groupname           FROM radusergroup           WHERE username = '%{SQL-User-Name}'           ORDER BY priority -> SELECT groupname           FROM radusergroup           WHERE username = 'sqltest'           ORDER BY priority
rlm_sql (sql): Released sql socket id: 3
++[sql] returns ok
++[pap] returns updated
Found Auth-Type = PAP
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!    Replacing User-Password in config items with Cleartext-Password.     !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Please update your configuration so that the "known good"               !!!
!!! clear text password is in Cleartext-Password, and not in User-Password. !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+- entering group PAP {...}
[pap] login attempt with password "testpwd"
[pap] Using clear text password "testpwd"
[pap] User authenticated successfully
++[pap] returns ok
+- entering group post-auth {...}
++[exec] returns noop
Sending Access-Accept of id 246 to 127.0.0.1 port 55590

Patch file: patch-add_mysql_variant.patch is attached to this request.

Thanks, Jeff (gvibe06@…)

Attachments (1)

patch-add_mysql_variant.patch (589 bytes) - added by hackdefendr (HackDefendr) 13 years ago.
Patch file for Portfile to add mysql variant.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added; freeradius mysql5 mysql5-server removed
Port: freeradius added; mysql5 removed
Summary: freeradius needs mysql variantfreeradius: add mysql variant

/opt/local should not be hardcoded; use ${prefix}.

Changed 13 years ago by hackdefendr (HackDefendr)

Patch file for Portfile to add mysql variant.

comment:2 Changed 13 years ago by hackdefendr (HackDefendr)

Fixed patch with ${prefix} instead of hardcoded path.

comment:3 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.