diff --git a/src/plugins/LdapPlugin/Makefile.inc b/src/plugins/LdapPlugin/Makefile.inc index b21cf15..bc89dff 100644 --- a/src/plugins/LdapPlugin/Makefile.inc +++ b/src/plugins/LdapPlugin/Makefile.inc @@ -4,4 +4,4 @@ ldapauth$(OBJSUFFICS): ldapauth.c $(CC) $(DCFLAGS) $(CFLAGS) ldapauth.c $(BUILDDIR)ldapauth$(DLSUFFICS): ldapauth$(OBJSUFFICS) - $(LN) $(LNOUT)../../$(BUILDDIR)ldapauth$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) $(LIBSPREFIX)ladp$(LIBSSUFFIX) ldapauth$(OBJSUFFICS) + $(LN) $(LNOUT)../../$(BUILDDIR)ldapauth$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) $(LIBSPREFIX)ldap$(LIBSSUFFIX) ldapauth$(OBJSUFFICS) diff --git a/src/plugins/LdapPlugin/ldapauth.c b/src/plugins/LdapPlugin/ldapauth.c index 38d112a..60ca3d4 100644 --- a/src/plugins/LdapPlugin/ldapauth.c +++ b/src/plugins/LdapPlugin/ldapauth.c @@ -1,25 +1,15 @@ + #include -#include #include +#include #include -#include - #ifndef _WIN32 - #include #endif -#include "../../proxy.h" #include "../../structures.h" - -struct counter_record -{ - unsigned long traf; - unsigned long trafgb; - time_t cleared; - time_t updated; -}; - +#define LDAP_DEPRECATED 1 +#include int already_loaded = 0; @@ -62,7 +52,7 @@ void lower (char *string) #endif /* -------------------------------------------------------------------------- */ -int savecouters(void) +int savecounters(void) { struct trafcount *tc=mypluginlink->conf->trafcounter; struct trafcount *tcd; @@ -82,8 +72,8 @@ int savecouters(void) sprintf(tmpbuf,pat_file,ldap_dircount,tcd->ace->users->user); f=fopen(tmpbuf,"w+b"); fseek(f,0,SEEK_SET); - fprintf(f,"%10lu %10lu %lu %lu\n",tcd->trafgb,tcd->traf, - tcd->cleared,tcd->updated); + fprintf(f,"%"PRINTF_INT64_MODIFIER"u %lu %lu\n",tcd->traf64, + (unsigned long)tcd->cleared,(unsigned long)tcd->updated); fclose(f); mypluginlink->myfree(tmpbuf); @@ -385,8 +375,7 @@ int h_trafgroup(int argc, unsigned char ** argv) memset(newtrafcount, 0, sizeof(struct trafcount)); newtrafcount->ace = newace; newtrafcount->type=rtype; - newtrafcount->traflimgb =(traflimit/(1024*4)); - newtrafcount->traflim = ((traflimit - (newtrafcount->traflimgb*(1024*4)))*(1024*1024)); + newtrafcount->traflim64 = traflimit; newtrafcount->comment=(*mypluginlink->mystrdup)("ldapcounters"); newtrafcount->number=0; tmpbuf=(*mypluginlink->myalloc)(strlen(pat_file)+strlen(ldap_dircount)+strlen(vals[0])); @@ -398,12 +387,11 @@ int h_trafgroup(int argc, unsigned char ** argv) fseek(f,0,SEEK_SET); fgets(buf, 256, f); - sscanf(buf,"%10lu %10lu %lu %lu\n",&rcounter.trafgb, &rcounter.traf, + sscanf(buf,"%"PRINTF_INT64_MODIFIER"u %lu %lu\n",&rcounter.traf64, &rcounter.cleared, &rcounter.updated); - newtrafcount->trafgb=rcounter.trafgb; - newtrafcount->traf=rcounter.traf; + newtrafcount->traf64=rcounter.traf64; newtrafcount->cleared=rcounter.cleared; newtrafcount->updated=rcounter.updated; fclose(f); @@ -565,7 +553,7 @@ PLUGINAPI int PLUGINCALL start(struct pluginlink * pluginlink, /*create job shedule for processing reload, save counters to file */ memset(&myschedule,0,sizeof(struct schedule)); myschedule.type=MINUTELY; - myschedule.function=savecouters; + myschedule.function=savecounters; myschedule.next = *pluginlink->schedule; *pluginlink->schedule=&myschedule; diff --git a/src/proxy.h b/src/proxy.h index 37155d0..fef6348 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -29,18 +29,6 @@ #define _PASSWORD_LEN 256 #define MAXNSERVERS 5 -#define ALLOW 0 -#define DENY 1 -#define REDIRECT 2 -#define BANDLIM 3 -#define NOBANDLIM 4 -#define COUNTIN 5 -#define NOCOUNTIN 6 -#define COUNTOUT 7 -#define NOCOUNTOUT 8 -#define CONNLIM 9 -#define NOCONNLIM 10 - #define UDPBUFSIZE 16384 #define TCPBUFSIZE 8192 #define SRVBUFSIZE (param->srv->bufsize?param->srv->bufsize:((param->service == S_UDPPM)?UDPBUFSIZE:TCPBUFSIZE)) diff --git a/src/structures.h b/src/structures.h index 3238253..b6bbb4d 100644 --- a/src/structures.h +++ b/src/structures.h @@ -85,6 +85,18 @@ int #endif +#define ALLOW 0 +#define DENY 1 +#define REDIRECT 2 +#define BANDLIM 3 +#define NOBANDLIM 4 +#define COUNTIN 5 +#define NOCOUNTIN 6 +#define COUNTOUT 7 +#define NOCOUNTOUT 8 +#define CONNLIM 9 +#define NOCONNLIM 10 + #define CONNECT 0x00000001 #define BIND 0x00000002 #define UDPASSOC 0x00000004