diff --git a/.gitignore b/.gitignore index c93ce4c..988c01c 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,7 @@ lib/version.h makefile encrypted.aff affconfig.h +*.trs +*.dirstamp +lib/aftest +afflib-?.?.? diff --git a/Makefile.am b/Makefile.am index 19be4e6..237c995 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,6 @@ release: make prerelease make distcheck make the_release - make distribute_release prerelease: @echo Making sure SVN is up to date @@ -55,15 +54,9 @@ getrelease: tar xfz $(PACKAGE).tar.gz (cd afflib-*;./configure;make;make test_crypto) -the_release: +the_release: $(RELEASE).tar.gz gpg --detach-sign $(RELEASE).tar.gz -distribute_release: - scp $(RELEASE).tar.gz{,.sig} $(RELEASE_SSH) - ssh $(RELEASE_HOST) 'cd $(RELEASE_LOC);/bin/rm $(PACKAGE).tar.gz;ln -s $(RELEASE).tar.gz $(PACKAGE).tar.gz' - ssh $(RELEASE_HOST) 'echo $(RELEASE).tar.gz > $(RELEASE_PATH)' - @echo Release $(RELEASE) uploaded to server - DOCS = BUGLIST.txt README_Linux.txt README_Win32.txt \ doc/crypto_doc.txt \ doc/crypto_design.txt \ @@ -79,7 +72,7 @@ EXTRA_DIST = $(DOCS) \ afflib.spec \ afflib.pc.in \ afflib.pubkey.asc \ - tests/encrypted.iso \ + tests/encrypted.raw \ tests/encrypted.aff \ win32/Changes.txt \ win32/README_MSVC++.txt \ diff --git a/configure.ac b/configure.ac index a838f85..647e426 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ # See http://autotoolset.sourceforge.net/tutorial.html # and http://www.openismus.com/documents/linux/automake/automake.shtml -AC_INIT([AFFLIB],[3.7.1],[bugs@afflib.org]) +AC_INIT([AFFLIB],[3.7.2],[bugs@afflib.org]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE diff --git a/lib/Makefile.am b/lib/Makefile.am index 84d7233..d168397 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,6 +3,8 @@ TESTS = aftest CLEANFILES = aftest +AUTOMAKE_OPTIONS = subdir-objects + aftest_SOURCES = aftest.cpp aftest_LDADD = libafflib.la aftest_LDFLAGS = $(PTHREAD_CFLAGS) -static # easier debugging @@ -81,7 +83,7 @@ install-exec-hook: EXTRA_DIST = -INCLUDES = \ +AM_CPPFLAGS = \ -I@top_srcdir@/lzma443/C \ -I@top_srcdir@/lzma443/C/7zip/Compress/LZMA_Alone diff --git a/lib/afflib.cpp b/lib/afflib.cpp index e89ed9f..48ada9b 100644 --- a/lib/afflib.cpp +++ b/lib/afflib.cpp @@ -238,7 +238,6 @@ AFFILE *af_open_with(const char *url,int flags,int mode, struct af_vnode *v) af->openmode = mode; af->image_sectorsize = 512; // default size af->error_reporter = warnx; - af->badflag = (unsigned char *)malloc(af->image_sectorsize); /* Decode URL */ af_parse_url(url,&af->protocol,&af->hostname,&af->username,&af->password, @@ -593,6 +592,9 @@ int64_t af_get_imagesize(AFFILE *af) */ int af_make_badflag(AFFILE *af) { + if(af->badflag!=0) free(af->badflag); + af->badflag = (unsigned char *)malloc(af->image_sectorsize); // current sector size + #ifdef HAVE_RAND_pseudo_bytes /* Use a good random number generator if we have it */ RAND_pseudo_bytes(af->badflag,af->image_sectorsize); diff --git a/lib/afflib_pages.cpp b/lib/afflib_pages.cpp index e2c470f..df57229 100644 --- a/lib/afflib_pages.cpp +++ b/lib/afflib_pages.cpp @@ -20,9 +20,12 @@ void af_read_sizes(AFFILE *af) af_get_seg(af,AF_SEGSIZE_D,&af->image_pagesize,0,0); // try old name } - /* Read the badflag if it is present */ + /* Read the badflag if it is present. + * Be sure to adjust badflag size to current sector size (which may have changed). + */ + if(af->badflag!=0) free(af->badflag); + af->badflag = (unsigned char *)malloc(af->image_sectorsize); size_t sectorsize = af->image_sectorsize; - if(af->badflag==0) af->badflag = (unsigned char *)malloc(sectorsize); if(af_get_seg(af,AF_BADFLAG,0,af->badflag,(size_t *)§orsize)==0){ af->badflag_set = 1; } diff --git a/lib/aftest.cpp b/lib/aftest.cpp index 3ec5695..efa64f0 100644 --- a/lib/aftest.cpp +++ b/lib/aftest.cpp @@ -397,11 +397,15 @@ void sparse_test() memset(buf,'g',sizeof(buf)); af_seek(af,mult/2,SEEK_SET); ssize_t r = af_read(af,(unsigned char *)buf,sizeof(buf)); - if(r!=sizeof(buf)){ - err(1,"Tried to read %zd bytes at mult/2; got %zd bytes\n",sizeof(buf),r); - } - for(u_int i=0;i header file. */ +#define HAVE_LIBEWF_H 1