From 5c9bb58a81c44ef16986cc80fdc519eb42f373b0 Mon Sep 17 00:00:00 2001 From: z3APA3A <3APA3A@3proxy.ru> Date: Fri, 6 Apr 2018 17:45:18 +0300 Subject: [PATCH] Clearing LdapPlugin compilation issues --- src/plugins/LdapPlugin/Makefile.inc | 2 +- src/plugins/LdapPlugin/ldapauth.c | 34 ++++++++++------------------- src/structures.h | 12 ++++++++++ 3 files changed, 24 insertions(+), 24 deletions(-) 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/structures.h b/src/structures.h index 1e5e6d1..b1cb04c 100644 --- a/src/structures.h +++ b/src/structures.h @@ -76,6 +76,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