Merge branch 'master' into ENGINE-866

Krista Bennett 2 years ago
commit 99831445b3

@ -7,8 +7,8 @@ cat >local.conf <<__LOCAL__
PREFIX=${INSTPREFIX}
SQLITE3_FROM_OS=""
PER_MACHINE_DIRECTORY=${PEP_MACHINE_DIR}
YML2_PATH=${BUILDROOT}/yml2
YML2_PROC=${BUILDROOT}/yml2/yml2proc
YML2_PATH=${INSTPREFIX}/yml2
YML2_PROC=${INSTPREFIX}/yml2/yml2proc
ETPAN_LIB=-L${INSTPREFIX}/libetpan/lib
ETPAN_INC=-I${INSTPREFIX}/libetpan/include
ASN1C=${INSTPREFIX}/asn1c/bin/asn1c

@ -2,7 +2,7 @@
set -exo
### YML2
cd $BUILDROOT
cd $INSTPREFIX
wget https://fdik.org/yml2.tar.bz2
tar -xf yml2.tar.bz2
rm yml2.tar.bz2

@ -48,9 +48,8 @@ else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
ifeq (,$(wildcard commit_hash.h))
$(shell cp ../templates/commit_hash.h ./commit_hash.h)
endif
# Commit hash header file - if we don't run this, it won't build.
COMMIT_HASH:=$(shell git rev-parse HEAD)
ifdef SQLITE3_FROM_OS
NO_SOURCE+= sqlite3.c
@ -75,7 +74,7 @@ all: $(TARGET)
-include Makefile.protocols
%.d: %.c
%.d: %.c commit_hash.h
@set -e; rm -f $@; \
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
@ -91,20 +90,28 @@ $(TARGET): libpEpEngine.a
.PHONY: objects clean install_headers install uninstall beinstall
objects: $(ALL_OBJECTS)
commit_hash.h:
ifeq (,$(COMMIT_HASH))
$(shell cp ../templates/commit_hash.h commit_hash.h)
else
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$(COMMIT_HASH)\"/" ../templates/commit_hash.h > commit_hash.h
endif
objects: $(ALL_OBJECTS) commit_hash.h
libpEpEngine.a: $(ALL_OBJECTS)
libpEpEngine.a: $(ALL_OBJECTS) commit_hash.h
$(AR) -rc $@ $^
clean:
rm -f *.d *.o *.a $(TARGET) *.dll *.so *.zip *.d.* *.def *~
rm -Rf $(TARGET).dSYM
rm -f KeySync_fsm.* Sync_actions.c Sync_event.* Sync_func.* Sync_impl.* sync_codec.* distribution_codec.*
rm -f commit_hash.h
# CAVEAT:
# install_headers is needed for building *STANDALONE* pEp MIME - it is NOT used for built-in functionality!!!
install_headers: $(TARGET)
install_headers: $(TARGET) commit_hash.h
mkdir -p $(PREFIX)/include/pEp
cp pEpEngine.h keymanagement.h message_api.h dynamic_api.h stringlist.h \
timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h \

@ -932,10 +932,7 @@ static PEP_STATUS _verify_version(PEP_SESSION session, int* version) {
// Sometimes the user_version wasn't set correctly.
bool version_changed = true;
int int_result;
if (table_contains_column(session, "pgp_keypair", "manually_set")) {
*version = 16;
}
else if (table_contains_column(session, "groups", "group_identity")) {
if (table_contains_column(session, "groups", "group_identity")) {
*version = 15;
}
else if (table_contains_column(session, "identity", "enc_format")) {
@ -1467,40 +1464,7 @@ static PEP_STATUS _upgrade_DB_to_ver_14(PEP_SESSION session) {
}
static PEP_STATUS _upgrade_DB_to_ver_15(PEP_SESSION session) {
// int int_result = sqlite3_exec(
// session->db,
// "alter table pgp_keypair\n"
// " add column manually_set integer default 0;\n",
// NULL,
// NULL,
// NULL
// );
//
// assert(int_result == SQLITE_OK);
//
// if (int_result != SQLITE_OK)
// return PEP_UNKNOWN_DB_ERROR;
// FIXME! DO THIS!
return PEP_STATUS_OK;
}
static PEP_STATUS _upgrade_DB_to_ver_16(PEP_SESSION session) {
int int_result = sqlite3_exec(
session->db,
"alter table pgp_keypair\n"
" add column manually_set integer default 0;\n",
NULL,
NULL,
NULL
);
assert(int_result == SQLITE_OK);
if (int_result != SQLITE_OK)
return PEP_UNKNOWN_DB_ERROR;
return PEP_STATUS_OK;
return _create_group_tables(session);
}
static PEP_STATUS _check_and_execute_upgrades(PEP_SESSION session, int version) {
@ -1562,10 +1526,6 @@ static PEP_STATUS _check_and_execute_upgrades(PEP_SESSION session, int version)
if (status != PEP_STATUS_OK)
return status;
case 15:
status = _upgrade_DB_to_ver_16(session);
if (status != PEP_STATUS_OK)
return status;
case 16:
break;
default:
return PEP_ILLEGAL_VALUE;

@ -3,7 +3,7 @@
#include "pEp_internal.h"
// increment this when patching DDL
#define _DDL_USER_VERSION "16"
#define _DDL_USER_VERSION "15"
PEP_STATUS init_databases(PEP_SESSION session);
PEP_STATUS pEp_sql_init(PEP_SESSION session);

@ -11,18 +11,12 @@
# if __has_include ("commit_hash.h")
# include "commit_hash.h"
# else
# define PEP_CURRENT_COMMIT_HASH="DUMMY_COMMIT_HASH_ERROR"
# define PEP_CURRENT_COMMIT_HASH = "DUMMY_COMMIT_HASH_ERROR"
# endif
#else
// Well, we tried. Better hope the git setup is correct.
// IF NOT, or you aren't using git, please copy the commit_hash.h file from
// templates/ into src/ if this include fails.
# include "commit_hash.h"
#endif
#include "commit_hash.h" // We need this everywhere. So.
// maximum attachment size to import as key 25MB, maximum of 20 attachments
#define MAX_KEY_SIZE (25 * 1024 * 1024)
#define MAX_KEYS_TO_IMPORT 20

Loading…
Cancel
Save