diff --git a/Makefile b/Makefile index 33baef5..a5f1b38 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ endif ar cru $@ $^ %: %.c - $(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat + $(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat ${LIBS} t1 parse: ldif.a storage.a t2: ldap.a asn1.a @@ -58,10 +58,10 @@ bindrequest tinyldap tinyldap_standalone tinyldap_debug ldapclient ldapclient_st idx2ldif: ldap.a tinyldap_standalone: tinyldap.c - $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat + $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat ${LIBS} tinyldap_debug: tinyldap.c - $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat + $(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat ${LIBS} .PHONY: clean tar clean: diff --git a/THANKS b/THANKS index c02cb83..36dd33a 100644 --- a/THANKS +++ b/THANKS @@ -5,3 +5,5 @@ David Lichteblau found lots of problems in the ASN.1 code. Özgür Kesim helped fix the substring search. Thomas Walpuski has found lots of problems with the LDAP code. + +Dirk Meyer helped BSD portability diff --git a/auth.c b/auth.c index 028e8a8..24690a3 100644 --- a/auth.c +++ b/auth.c @@ -1,3 +1,6 @@ +#ifdef __FreeBSD__ +#include +#endif #include #include "ldap.h" #include "auth.h" diff --git a/idx2ldif.c b/idx2ldif.c index f9fba6f..084869c 100644 --- a/idx2ldif.c +++ b/idx2ldif.c @@ -35,6 +35,7 @@ int main(int argc,char* argv[]) { unsigned long filelen; char* fn=argc<2?"data":argv[1]; char* map=mmap_read(fn,&filelen); + uint32 magic,attribute_count,record_count,indices_offset,size_of_string_table; if (!map) { buffer_puts(buffer_2,"could not open "); buffer_puts(buffer_2,fn); @@ -43,7 +44,6 @@ int main(int argc,char* argv[]) { buffer_putnlflush(buffer_2); return 1; } - uint32 magic,attribute_count,record_count,indices_offset,size_of_string_table; uint32_unpack(map,&magic); uint32_unpack(map+4,&attribute_count); uint32_unpack(map+2*4,&record_count); diff --git a/md5password.c b/md5password.c index f5bd926..826edf7 100644 --- a/md5password.c +++ b/md5password.c @@ -1,3 +1,6 @@ +#ifdef __FreeBSD__ +#include +#endif #include #include #include "buffer.h" diff --git a/mstorage_add.c b/mstorage_add.c index 97e341a..f77a195 100644 --- a/mstorage_add.c +++ b/mstorage_add.c @@ -54,9 +54,9 @@ long mstorage_add(mstorage_t* p,const char* s,unsigned long n) { if (!tmp) return -1; } else { munmap(p->root,p->used); - tmp=mmap(0,need,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0); + tmp=mmap(0,need,PROT_READ|PROT_WRITE,MAP_SHARED,p->fd,0); if (tmp==-1) { - tmp=mmap(0,p->used,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0); + tmp=mmap(0,p->used,PROT_READ|PROT_WRITE,MAP_SHARED,p->fd,0); /* this can never fail, because we mmap exactly as much as we * had mmapped previously. We need to munmap before doing the * new mmap, though, because we may run into the address space diff --git a/tinyldap.c b/tinyldap.c index f2c3425..e763afe 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -14,8 +14,13 @@ #ifdef STANDALONE #include "socket.h" #include "ip6.h" +#ifdef __FreeBSD__ +#include +#include +#else #include #endif +#endif #include "case.h" #include