mirror of
				https://github.com/3proxy/3proxy.git
				synced 2025-11-04 07:42:39 +08:00 
			
		
		
		
	Clearing LdapPlugin compilation issues
This commit is contained in:
		
							parent
							
								
									f8557187cd
								
							
						
					
					
						commit
						5c9bb58a81
					
				@ -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)
 | 
			
		||||
 | 
			
		||||
@ -1,25 +1,15 @@
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include <ldap.h>
 | 
			
		||||
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#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 <ldap.h>
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user