Hello

This patch adds rlm_sql_sqlite, rlm_passwd modules for freeradius2.
It patches the rlm_sql_sqlite in order to work (authorization is working, 
accounting not yet tested).
It adds radwho to the utils.
WARNING
It compiles fine but it isn't shown well in menuconfig (mod-sql-pgsql 
disappears).

Thanks in advance.

Signed-off-by: Etienne CHAMPETIER <[email protected]>

-------------------------------------------------

Index: net/freeradius2/patches/009-sql_sqlite_c.patch
===================================================================
--- net/freeradius2/patches/009-sql_sqlite_c.patch      (révision 0)
+++ net/freeradius2/patches/009-sql_sqlite_c.patch      (révision 0)
@@ -0,0 +1,14 @@
+--- a/src/modules/rlm_sql/drivers/rlm_sql_sqlite/sql_sqlite.c
++++ b/src/modules/rlm_sql/drivers/rlm_sql_sqlite/sql_sqlite.c
+@@ -138,10 +138,7 @@ static int sql_query(SQLSOCK * sqlsocket
+ static int sql_select_query(SQLSOCK *sqlsocket, SQL_CONFIG *config,
+                           char *querystr)
+ {
+-      if (strstr(querystr, "nas") != NULL)
+-              return sql_query(sqlsocket, config, querystr);
+-              
+-      return 0;
++      return sql_query(sqlsocket, config, querystr);
+ }
+ 
+ 
Index: net/freeradius2/Makefile
===================================================================
--- net/freeradius2/Makefile    (révision 25702)
+++ net/freeradius2/Makefile    (copie de travail)
@@ -9,7 +9,7 @@
 
 PKG_NAME:=freeradius2
 PKG_VERSION:=2.1.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
@@ -188,6 +188,16 @@
 /etc/freeradius2/modules/files
 endef
 
+define Package/freeradius2-mod-passwd
+  $(call Package/freeradius2/Default)
+  DEPENDS:=freeradius2
+  TITLE:=Module using passwd-like files for authorization (user group support)
+endef
+
+define Package/freeradius2-mod-passwd/conffiles
+/etc/freeradius2/modules/passwd
+endef
+
 define Package/freeradius2-mod-ldap
   $(call Package/freeradius2/Default)
   DEPENDS:=freeradius2 +libopenldap
@@ -276,6 +286,13 @@
   TITLE:=PostgreSQL module
 endef
 
+define Package/freeradius2-mod-sql-sqlite
+  $(call Package/freeradius2/Default)
+  DEPENDS:=freeradius2-mod-sql \
+       +PACKAGE_freeradius2-mod-sql-sqlite:libsqlite3
+  TITLE:=SQLite module
+endef
+
 define Package/freeradius2-mod-sqlcounter
   $(call Package/freeradius2/Default)
   DEPENDS:=freeradius2-mod-sql
@@ -331,7 +348,6 @@
        --without-rlm_perl \
        --without-rlm_python \
        --without-rlm_smb \
-       --without-rlm_always \
        --with-rlm_sql \
        --with-rlm_sqlcounter \
        --without-rlm_sqlhpwippool \
@@ -344,12 +360,12 @@
        --without-rlm_sql_sybase \
        --without-rlm_sql_unixodbc \
        --without-rlm_sql_log \
-       --without-rlm_sql_sqlite \
        --without-rlm_unix \
        --without-rlm_eap_tnc \
        --without-rlm_eap_ikev2 \
        --without-rlm_opendirectory \
        --without-rlm_wimax \
+       --without-rlm_ruby \
 
 PKG_DICTIONARIES:= \
        freeradius freeradius.internal \
@@ -385,6 +401,16 @@
   CONFIGURE_ARGS+= --without-rlm_sql_postgresql
 endif
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-sqlite),)
+  CONFIGURE_ARGS+= \
+       --with-rlm_sql_sqlite \
+       --with-experimental-modules \
+       --with-sqlite-include-dir="$(STAGING_DIR)/usr/include" \
+       --with-sqlite-lib-dir="$(STAGING_DIR)/usr/lib"
+else
+  CONFIGURE_ARGS+= --without-rlm_sql_sqlite
+endif
+
 ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
   CONFIGURE_ARGS+= \
                --with-rlm_eap_peap \
@@ -496,7 +522,7 @@
 
 define Package/freeradius2-utils/install
        $(INSTALL_DIR) $(1)/usr/bin
-       for f in radclient radeapclient; do \
+       for f in radclient radeapclient radwho; do \
                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ 
; \
        done
 endef
@@ -531,6 +557,7 @@
 $(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec 
modules/echo ,modules,))
 $(eval $(call 
BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
 $(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users 
preproxy_users users modules/files,modules,))
+$(eval $(call 
BuildPlugin,freeradius2-mod-passwd,rlm_passwd,modules/passwd,modules,))
 $(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap 
modules/ldap,modules,))
 $(eval $(call 
BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
 $(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
@@ -539,6 +566,7 @@
 $(eval $(call BuildPlugin,freeradius2-mod-sql,rlm_sql,sql.conf,))
 $(eval $(call BuildPlugin,freeradius2-mod-sql-mysql,rlm_sql_mysql,))
 $(eval $(call BuildPlugin,freeradius2-mod-sql-pgsql,rlm_sql_postgresql,))
+$(eval $(call BuildPlugin,freeradius2-mod-sql-sqlite,rlm_sql_sqlite,))
 $(eval $(call BuildPlugin,freeradius2-mod-sqlcounter,rlm_sqlcounter,))
 $(eval $(call BuildPlugin,freeradius2-mod-radutmp,rlm_radutmp,modules/radutmp 
modules/sradutmp,modules,))
 $(eval $(call 
BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logintime,modules,))


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to