inflex / ripMIME

MIME/email package decoder
BSD 3-Clause "New" or "Revised" License
69 stars 26 forks source link

ripmime and Almalinux 9 #22

Closed graz68a closed 11 months ago

graz68a commented 11 months ago

Hello

unlucky ripmime does not install over Almalinux 9. Anyone is able to fix this ?

Thank you Graziano

inflex commented 11 months ago

Not install, or not build?

Can we get some error log or something, else at this point I'm going to assume perhaps it's an installer issue with that specific linux and should be raised with their support team.

graz68a commented 11 months ago

this is the error I receive when I execute make

tnef.c: In function ‘save_attach_data’: tnef.c:335:48: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 1024 [-Wformat-truncation=] 335 | snprintf(filename, sizeof(filename),"%s/%s", TNEF_glb.path, title ); | ^ tnef.c:335:9: note: ‘snprintf’ output 2 or more bytes (assuming 1026) into a destination of size 1024 335 | snprintf(filename, sizeof(filename),"%s/%s", TNEF_glb.path, title ); | ^~~~~~~~~~~~~~~ tnef.c: In function ‘read_attribute’: tnef.c:601:25: warning: ‘strncpy’ output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation] 601 | strncpy(attach_title, make_string(tsp+header,size),255); | ^~~~~~~~~~~~~~~ mime.c: In function ‘MIME_test_uniquename’: mime.c:1091:79: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1022 [-Werror=format-truncation=] 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~ mime.c:1091:75: note: directive argument in the range [1, 2147483647] 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~~~~ mime.c:1091:41: note: ‘snprintf’ output 5 or more bytes (assuming 1037) into a destination of size 1023 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~~~~~~~~~~~~~~~~~~ mime.c: In function ‘MIME_decode_raw’: mime.c:1432:67: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 1432 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^ mime.c:1432:33: note: ‘snprintf’ output between 1 and 129 bytes into a destination of size 128 1432 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^~~~~~~~~~~~~~~ mime.c: In function ‘MIME_decode_text’: mime.c:1626:59: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 1626 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^ mime.c:1626:25: note: ‘snprintf’ output between 1 and 129 bytes into a destination of size 128 1626 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^~~~~~~~~~~~~~~ mime.c: In function ‘MIME_unpack_stage2’: mime.c:3463:107: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 3463 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:3463:65: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 3463 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ mime.c: In function ‘MIME_handle_multipart’: mime.c:2901:67: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 2901 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:2901:25: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 2901 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ mime.c: In function ‘MIME_handle_rfc822’: mime.c:2986:67: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 2986 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:2986:25: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 2986 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: [Makefile:51: mime.o] Error 1 mime.c: In function ‘MIME_test_uniquename’: mime.c:1091:79: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1022 [-Werror=format-truncation=] 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~ mime.c:1091:75: note: directive argument in the range [1, 2147483647] 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~~~~ mime.c:1091:41: note: ‘snprintf’ output 5 or more bytes (assuming 1037) into a destination of size 1023 1091 | snprintf(newname,_MIME_STRLENMAX,"%s/%s%d.%s",path,frontname,count,extention); | ^~~~~~~~~~~~~~~~~~~ mime.c: In function ‘MIME_decode_raw’: mime.c:1432:67: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 1432 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^ mime.c:1432:33: note: ‘snprintf’ output between 1 and 129 bytes into a destination of size 128 1432 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^~~~~~~~~~~~~~~ mime.c: In function ‘MIME_decode_text’: mime.c:1626:59: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 1626 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^ mime.c:1626:25: note: ‘snprintf’ output between 1 and 129 bytes into a destination of size 128 1626 | snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name); | ^~~~~~~~~~~~~~~ mime.c: In function ‘MIME_unpack_stage2’: mime.c:3463:107: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 3463 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:3463:65: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 3463 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ mime.c: In function ‘MIME_handle_multipart’: mime.c:2901:67: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 2901 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:2901:25: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 2901 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ mime.c: In function ‘MIME_handle_rfc822’: mime.c:2986:67: error: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 129 [-Werror=format-truncation=] 2986 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~ ~~~ mime.c:2986:25: note: ‘snprintf’ output between 1 and 1024 bytes into a destination of size 129 2986 | snprintf(h->filename,sizeof(h->filename),"%s",scratch); | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: [Makefile:51: mime.o] Error 1

inflex commented 11 months ago

In the Makefile, remove the "-Wall" build flag and try again.

graz68a commented 11 months ago

I tried ripmime-1.4.0.10 and ripmime-1.4.0.9. I have AlmaLinux 9.2 x86_64 . I installed and used ripmime from years in Centos and Red Hat without issues.

graz68a commented 11 months ago

trying

graz68a commented 11 months ago

I changed CFLAGS=-Wall -g -I. -O2 -Werror to CFLAGS=-g -I. -O2 -Werror in makefile

It didn't work too.

make

./build_tnef make[1]: Entering directory '/usr/local/src/ripmime-1.4.0.10/tnef' cc -Wall -g -O2 -I. -D___TNEF_BYTE_ORDER=4321 -c tnef.c tnef.c: In function ‘save_attach_data’: tnef.c:335:48: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 1024 [-Wformat-truncation=] 335 | snprintf(filename, sizeof(filename),"%s/%s", TNEF_glb.path, title ); | ^ tnef.c:335:9: note: ‘snprintf’ output 2 or more bytes (assuming 1026) into a destination of size 1024 335 | snprintf(filename, sizeof(filename),"%s/%s", TNEF_glb.path, title ); | ^~~~~~~~~~~~~~~ tnef.c: In function ‘read_attribute’: tnef.c:601:25: warning: ‘strncpy’ output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation] 601 | strncpy(attach_title, make_string(tsp+header,size),255); | ^~~~~~~~~~~~~~~ make[1]: Leaving directory '/usr/local/src/ripmime-1.4.0.10/tnef' cc -g -I. -O2 -Werror -DRIPOLE -c strstack.c cc -g -I. -O2 -Werror -DRIPOLE -c mime.c cc -g -I. -O2 -Werror -DRIPOLE -c ffget.c cc -g -I. -O2 -Werror -DRIPOLE -c MIME_headers.c cc -g -I. -O2 -Werror -DRIPOLE -c rawget.c cc -g -I. -O2 -Werror -DRIPOLE -c pldstr.c pldstr.c: In function ‘PLD_strtok’: pldstr.c:300:37: error: comparison between pointer and zero character constant [-Werror=pointer-compare] 300 | if ((st->start)&&(st->start != '\0')) | ^~ pldstr.c:300:27: note: did you mean to dereference the pointer? 300 | if ((st->start)&&(st->start != '\0')) | ^ cc1: all warnings being treated as errors make: [Makefile:51: pldstr.o] Error 1 [root@venus ripmime-1.4.0.10]# make install cc -g -I. -O2 -Werror -DRIPOLE -c pldstr.c pldstr.c: In function ‘PLD_strtok’: pldstr.c:300:37: error: comparison between pointer and zero character constant [-Werror=pointer-compare] 300 | if ((st->start)&&(st->start != '\0')) | ^~ pldstr.c:300:27: note: did you mean to dereference the pointer? 300 | if ((st->start)&&(st->start != '\0')) | ^ cc1: all warnings being treated as errors make: [Makefile:51: pldstr.o] Error 1

inflex commented 11 months ago

Ah, remove -Werror too :D

graz68a commented 11 months ago

removed too , still no way

make cc -g -I. -O2 -DRIPOLE -c pldstr.c pldstr.c: In function ‘PLD_strtok’: pldstr.c:300:37: warning: comparison between pointer and zero character constant [-Wpointer-compare] 300 | if ((st->start)&&(st->start != '\0')) | ^~ pldstr.c:300:27: note: did you mean to dereference the pointer? 300 | if ((st->start)&&(st->start != '\0')) | ^ cc -g -I. -O2 -DRIPOLE -c logger.c cc -g -I. -O2 -DRIPOLE -c libmime-decoders.c cc -g -I. -O2 -DRIPOLE -c boundary-stack.c cc -g -I. -O2 -DRIPOLE -c uuencode.c cc -g -I. -O2 -DRIPOLE -c filename-filters.c ./build_ripOLE make[1]: Entering directory '/usr/local/src/ripmime-1.4.0.10/ripOLE' rm -f *.o ripole make[1]: Leaving directory '/usr/local/src/ripmime-1.4.0.10/ripOLE' make[1]: Entering directory '/usr/local/src/ripmime-1.4.0.10/ripOLE' cc -Wall -g -O2 -I. -Werror -c ole.c cc -Wall -g -O2 -I. -Werror -c olestream-unwrap.c cc -Wall -g -O2 -I. -Werror -c bytedecoders.c cc -Wall -g -O2 -I. -Werror -c logger.c cc -Wall -g -O2 -I. -Werror -c pldstr.c pldstr.c: In function ‘PLD_strtok’: pldstr.c:300:37: error: comparison between pointer and zero character constant [-Werror=pointer-compare] 300 | if ((st->start)&&(st->start != '\0')) | ^~ pldstr.c:300:27: note: did you mean to dereference the pointer? 300 | if ((st->start)&&(st->start != '\0')) | ^ cc1: all warnings being treated as errors make[1]: [Makefile:7: pldstr.o] Error 1 make[1]: Leaving directory '/usr/local/src/ripmime-1.4.0.10/ripOLE' make: [Makefile:45: ripOLE/ole.o] Error 2 [root@venus ripmime-1.4.0.10]# make install cc -g -I. -O2 -DRIPOLE -c ripOLE/bt-int.c ./generate-buildcodes.sh cc -g -I. -O2 -DRIPOLE ripmime.c strstack.o mime.o ffget.o MIME_headers.o tnef/tnef.o rawget.o pldstr.o logger.o libmime-decoders.o boundary-stack.o uuencode.o filename-filters.o ripOLE/ole.o ripOLE/olestream-unwrap.o ripOLE/bytedecoders.o ripOLE/bt-int.o -o ripmime /usr/bin/ld: cannot find ripOLE/bt-int.o: No such file or directory collect2: error: ld returned 1 exit status make: *** [Makefile:69: ripmime] Error 1

inflex commented 11 months ago

Ah, have you tried pulling the current source code from master?

Looks like I fixed most of those issues quite some time back in 2022 iirc.

graz68a commented 11 months ago

I did git clone https://github.com/inflex/ripMIME.git /usr/local/src/ripmime and it worked ! Thank you!

inflex commented 11 months ago

I think they might need to update to release 1.4.1.0 which I realise I did push out as a proper git release last year --- got to love it when you barely touch some projects; completely forget that you've already done the work a year ago :D

inflex commented 11 months ago

https://github.com/inflex/ripMIME/releases/tag/1.4.1.0

graz68a commented 11 months ago

Thank you for your time and effort !