Compare commits

...

3 Commits

Author SHA1 Message Date
2265b1d710 new working adobe's ade activate url 2026-04-07 17:35:50 +02:00
eed5be06c0 fix regression in 76cab18667 2026-04-03 14:38:34 +02:00
d7bd98e719 Use -fmacro-prefix-map for utils
The __FILE__ macro is used in the EXCEPTION macro to report the file
name alongside error messages. This macro reports the file name
exactly as it is passed to the compiler. For most source files in
libgourou this is a nice relative path such as "src/libgourou.cpp".
However, for EXCEPTION instances in libgourou_common.h, the compiler
flag is "-I$(ROOT)/include", where $(ROOT) is an absolute path passed
from the higher Makefile. This results in an absolute path to the
build directory being hardcoded into the utils shared library and
binaries, and reported in error messages. Besides being less readable
than the more common relative paths, this triggers warnings from
packaging tools that detect inadvertent references to temporary build
directories that end up in compiled binaries and might indicate a bug.

There is a GCC feature -fmacro-prefix-map which allows to perform
substition on the values that are used for __FILE__. Use that option
to strip out the absolute path component, without changing any
functionality.

The feature was added to GCC on 2018-01-18 and released in GCC 8.1.0.

7365279fca
2026-03-14 13:51:40 +01:00
3 changed files with 12 additions and 5 deletions

View File

@@ -34,7 +34,7 @@
#endif
#ifndef ACS_SERVER
#define ACS_SERVER "http://adeactivate.adobe.com/adept"
#define ACS_SERVER "https://adeactivate.adobe.com/adept"
#endif
#define LIBGOUROU_VERSION "0.8.8"

View File

@@ -1513,7 +1513,8 @@ namespace gourou
}
}
/* Delete objects that reference EBX objects, except in trailer */
/* Delete objects that reference EBX objects,
except in trailer and objects that references Info */
for(it = objects.begin(); it != objects.end(); it++)
{
uPDFParser::Object* object = *it;
@@ -1522,12 +1523,18 @@ namespace gourou
{
uPDFParser::Reference* encrypt = (uPDFParser::Reference*)(*object)["Encrypt"];
if (object->hasKey("Info"))
{
object->deleteKey("Encrypt");
continue;
}
/* Delete EBX objects */
for(ebxIt = ebxObjects.begin(); ebxIt != ebxObjects.end(); ebxIt++)
{
if (encrypt->value() == (*ebxIt)->objectId())
{
GOUROU_LOG(ERROR, "Delete stream id " << object->objectId());
GOUROU_LOG(DEBUG, "Delete stream id " << object->objectId());
parser.removeObject(object);
break;
@@ -1540,7 +1547,7 @@ namespace gourou
for(it = ebxObjects.begin(); it != ebxObjects.end(); it++)
parser.removeObject(*it);
uPDFParser::Object& trailer = parser.getTrailer();
uPDFParser::Object& trailer = parser.getTrailer();
trailer.deleteKey("Encrypt");
parser.write(filenameOut);

View File

@@ -6,7 +6,7 @@ TARGETS=$(TARGET_BINARIES) launcher
MAN_PAGES=acsmdownloader adept_activate adept_remove adept_loan_mgt
CXXFLAGS=-Wall -fPIC -I$(ROOT)/include -fdata-sections -ffunction-sections
CXXFLAGS=-Wall -fPIC -I$(ROOT)/include -fmacro-prefix-map=$(ROOT)/= -fdata-sections -ffunction-sections
STATIC_DEP=
# LDFLAGS += -Wl,--gc-sections