fm4dd / webcert

WebCert is a Web application to generate and manage digital certificates in cases where no "full" CA is needed.
http://webcert.fm4dd.com
MIT License
28 stars 13 forks source link

Compilation error #3

Closed mshedsilegx closed 2 years ago

mshedsilegx commented 2 years ago

Latest main branch RHEL8, gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1.2.0.1) - from: gcc-toolset-10-gcc-10.3.1-1.2.0.1.el8_5.x86_64

gcc serial.o revocation.o webcert.o buildrequest.o pagehead.o pagefoot.o handle_error.o -o buildrequest.cgi -lcgic -lm -lssl -lcrypto /opt/rh/gcc-toolset-10/root/usr/bin/ld: revocation.o:(.bss+0x0): multiple definition of error_str'; serial.o:(.bss+0x0): first defined here /opt/rh/gcc-toolset-10/root/usr/bin/ld: webcert.o:(.bss+0x0): multiple definition oferror_str'; serial.o:(.bss+0x0): first defined here /opt/rh/gcc-toolset-10/root/usr/bin/ld: buildrequest.o:(.bss+0x0): multiple definition of error_str'; serial.o:(.bss+0x0): first defined here /opt/rh/gcc-toolset-10/root/usr/bin/ld: pagehead.o:(.bss+0x0): multiple definition oferror_str'; serial.o:(.bss+0x0): first defined here /opt/rh/gcc-toolset-10/root/usr/bin/ld: pagefoot.o:(.bss+0x0): multiple definition of error_str'; serial.o:(.bss+0x0): first defined here /opt/rh/gcc-toolset-10/root/usr/bin/ld: handle_error.o:(.bss+0x0): multiple definition oferror_str'; serial.o:(.bss+0x0): first defined here

mshedsilegx commented 2 years ago

I got by with the following patch:

--- o/src/common.h.dist 2021-11-28 20:15:21.001622925 -0600
+++ n/src/common.h  2021-11-28 20:14:16.434623158 -0600
@@ -0,0 +1 @@
+char error_str[4096];
--- o/src/revocation.c.dist 2021-11-25 21:31:54.000000000 -0600
+++ n/src/revocation.c  2021-11-28 20:14:35.179623090 -0600
@@ -11,6 +11,7 @@
 #include <openssl/ocsp.h>
 #include <openssl/conf.h>
 #include "webcert.h"
+#include "common.h"

 #define BSIZE           256
 #define B_FORMAT_TEXT   0x8000
--- o/src/webcert.h.dist    2021-11-28 20:12:21.340623573 -0600
+++ n/src/webcert.h 2021-11-28 20:12:49.669623471 -0600
@@ -183,5 +183,5 @@

 void keycreate_input();

-char error_str[4096];
+extern char error_str[4096];
 /****************************** end webcert.h *********************************/
fm4dd commented 2 years ago

Hi mshedsilegx,

Thank you for reporting the issue, researching it, and even providing the patch back. This is very appreciated! The patch works fine on Ubuntu 20.04 under gcc v9 as well, and I updated the code, uploading a new revision.

Cheers and Best wishes, Frank