*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2001 Koulik Andrei, Sandy Service
+ * Copyright 2006 The FreeRADIUS server project
*/
-#include "autoconf.h"
+#include <freeradius-devel/ident.h>
+RCSID("$Id$")
-#include <string.h>
-#include <stdlib.h>
+#include <freeradius-devel/radiusd.h>
+#include <freeradius-devel/modules.h>
#ifdef HAVE_NDBM_H
#include <ndbm.h>
#include <fcntl.h>
-#include "radiusd.h"
-#include "modules.h"
-
#ifdef SANDY_MOD
# include "sandymod.h"
#endif
-static const char rcsid[] = "$Id$";
-
#define MYDBM DBM
#define get_user_content dbm_fetch
if ( parse_state == SMP_PATTERN ) { /* pattern line found */
DEBUG2("process pattern");
/* check pattern against request */
- if ( paircmp(NULL, request, vp, reply ) == 0 ) {
+ if ( paircompare(NULL, request, vp, reply ) == 0 ) {
DEBUG2("rlm_dbm: Pattern matched, look for request");
pairmove(&tmp_config, &vp);
pairfree(&vp);
join_attr = vp;
while( (join_attr = pairfind(join_attr,SM_JOIN_ATTR) ) != NULL ) {
DEBUG2("rlm_dbm: Proccess nested record: username %s",
- (char *)join_attr->strvalue);
+ (char *)join_attr->vp_strvalue);
/* res = RLM_MODULE_NOTFOUND; */
- res = sm_parse_user(pdb, (char *)join_attr->strvalue, request, &tmp_config,
+ res = sm_parse_user(pdb, (char *)join_attr->vp_strvalue, request, &tmp_config,
&nu_reply, ulist);
DEBUG("rlm_dbm: recived: %d\n",res);
switch ( res ) {
* Grab the canonical user name.
*/
namepair = request->username;
- name = namepair ? (char *) namepair->strvalue : "NONE";
+ name = namepair ? (char *) namepair->vp_strvalue : "NONE";
DEBUG2("rlm_dbm: try open database file: %s\n",inst -> userfile);
static int rlm_dbm_detach(void *instance)
{
struct rlm_dbm_t *inst = instance;
- free(inst -> userfile);
free(inst);
return 0;
}