Skip to content

Commit

Permalink
Merge pull request #5282 from vpodzime/master-with_pcre
Browse files Browse the repository at this point in the history
Fixes for libntech without GPL code
  • Loading branch information
olehermanse authored Aug 4, 2023
2 parents 3e8512b + 76f1f02 commit 366eee3
Show file tree
Hide file tree
Showing 41 changed files with 2,434 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ stamp-h1
/contrib/vagrant-ci/centos-7-x64/Makefile
/examples/Makefile
/ext/Makefile
/libcfecompat/Makefile
/libcfnet/Makefile
/libenv/Makefile
/libpromises/Makefile
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ LCOV_FLAGS = $(if $(filter-out 0,$(V)),,-q)

SUBDIRS = \
libntech \
libcfecompat \
libcfnet \
libenv \
cf-check \
Expand Down
1 change: 1 addition & 0 deletions cf-agent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
noinst_LTLIBRARIES = libcf-agent.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../cf-check \
@CPPFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions cf-agent/cf-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


#include <platform.h>
#include <getopt.h>
#include <generic_agent.h>

#include <actuator.h>
Expand Down
2 changes: 2 additions & 0 deletions cf-check/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-check.la

AM_CPPFLAGS = -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libntech/libcompat \
-I$(srcdir)/../libcfecompat \
@CPPFLAGS@ \
$(PCRE_CPPFLAGS) \
$(LIBYAML_CPPFLAGS) \
Expand All @@ -45,6 +46,7 @@ AM_LDFLAGS = \
$(LMDB_LDFLAGS)

libcf_check_la_LIBADD = ../libntech/libutils/libutils.la \
../libcfecompat/libcfecompat.la \
$(LMDB_LIBS) \
$(PCRE_LIBS) \
$(LIBYAML_LIBS) \
Expand Down
2 changes: 2 additions & 0 deletions cf-check/cf-check.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <platform.h>
#include <getopt.h>
#include <lmdump.h>
#include <dump.h>
#include <diagnose.h>
Expand Down
1 change: 1 addition & 0 deletions cf-execd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ noinst_LTLIBRARIES = libcf-execd.la libcf-execd-test.la
AM_CPPFLAGS = \
-I$(srcdir)/../libpromises \
-I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libenv \
-I$(srcdir)/../cf-check \
Expand Down
3 changes: 3 additions & 0 deletions cf-execd/cf-execd.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <cf-execd.h>

#ifndef __MINGW32__
Expand Down
1 change: 1 addition & 0 deletions cf-key/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-key.la

AM_CPPFLAGS = \
-I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libpromises \
$(PCRE_CPPFLAGS) \
Expand Down
3 changes: 3 additions & 0 deletions cf-key/cf-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <generic_agent.h>

#include <dbm_api.h>
Expand Down
1 change: 1 addition & 0 deletions cf-monitord/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-monitord.la

AM_CPPFLAGS = \
-I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libenv \
-I$(srcdir)/../libpromises \
Expand Down
3 changes: 3 additions & 0 deletions cf-monitord/cf-monitord.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <generic_agent.h>
#include <mon.h>

Expand Down
2 changes: 2 additions & 0 deletions cf-monitord/mon_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
# define LOADAVG_5MIN 1
#endif

#include <cfecompat.h>

/* Implementation */

#ifdef HAVE_GETLOADAVG
Expand Down
1 change: 1 addition & 0 deletions cf-net/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
noinst_LTLIBRARIES = libcf-net.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
$(OPENSSL_CPPFLAGS) \
$(PCRE_CPPFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions cf-net/cf-net.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define CF_NET_VERSION "0.1.2"

#include <platform.h>
#include <getopt.h>
#include <libgen.h>
#include <client_code.h> // ServerConnection
#include <logging.h> // Log, LogSetGlobalLevel
Expand Down
1 change: 1 addition & 0 deletions cf-promises/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ noinst_LTLIBRARIES = libcf-promises.la
AM_CPPFLAGS = \
-I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libpromises \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
@CPPFLAGS@ \
$(OPENSSL_CPPFLAGS) \
Expand Down
3 changes: 3 additions & 0 deletions cf-promises/cf-promises.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <generic_agent.h>

#include <eval_context.h>
Expand Down
1 change: 1 addition & 0 deletions cf-runagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-runagent.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libcfecompat \
$(OPENSSL_CPPFLAGS) \
$(PCRE_CPPFLAGS) \
$(ENTERPRISE_CPPFLAGS)
Expand Down
3 changes: 3 additions & 0 deletions cf-runagent/cf-runagent.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <generic_agent.h>

#include <known_dirs.h>
Expand Down
1 change: 1 addition & 0 deletions cf-secret/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
noinst_LTLIBRARIES = libcf-secret.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libcfnet \
$(OPENSSL_CPPFLAGS) \
$(PCRE_CPPFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions cf-secret/cf-secret.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*/

#include <platform.h>
#include <getopt.h>
#include <openssl/err.h>

#include <lastseen.h>
Expand Down
1 change: 1 addition & 0 deletions cf-serverd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-serverd.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libenv \
$(OPENSSL_CPPFLAGS) \
$(PCRE_CPPFLAGS) \
Expand Down
3 changes: 3 additions & 0 deletions cf-serverd/cf-serverd-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
included file COSL.txt.
*/

#include <platform.h>
#include <getopt.h>

#include <cf-serverd-functions.h>
#include <cf-serverd-enterprise-stubs.h>

Expand Down
1 change: 1 addition & 0 deletions cf-testd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libcf-testd.la

AM_CPPFLAGS = -I$(srcdir)/../libpromises -I$(srcdir)/../libntech/libutils \
-I$(srcdir)/../libcfnet \
-I$(srcdir)/../libcfecompat \
-I$(srcdir)/../libenv \
-I$(srcdir)/../cf-serverd \
$(OPENSSL_CPPFLAGS) \
Expand Down
18 changes: 14 additions & 4 deletions cf-testd/cf-testd.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include <platform.h>
#include <getopt.h>

#include <client_code.h> // cfnet_init
#include <crypto.h> // CryptoInitialize
Expand Down Expand Up @@ -774,11 +775,16 @@ int main(int argc, char *argv[])
for (int i = 0; i < n_threads; i++)
{
thread_configs[i] = (CFTestD_Config*) xcalloc(1, sizeof(CFTestD_Config));
char *thread_num_str;
xasprintf(&thread_num_str, "%d", i);

if (config->report_file != NULL && strstr(config->report_file, "%d") != NULL)
{
/* replace the '%d' with the thread number */
asprintf(&(thread_configs[i]->report_file), config->report_file, i);
/* replace the (first) '%d' with the thread number */
size_t report_file_len = strlen(config->report_file) + strlen(thread_num_str) - 2 + 1;
thread_configs[i]->report_file = xmalloc(report_file_len);
StringReplaceN(thread_configs[i]->report_file, report_file_len,
"%d", thread_num_str, 1);
}
else
{
Expand All @@ -787,8 +793,11 @@ int main(int argc, char *argv[])

if (config->key_file != NULL && strstr(config->key_file, "%d") != NULL)
{
/* replace the '%d' with the thread number */
asprintf(&(thread_configs[i]->key_file), config->key_file, i);
/* replace the (first) '%d' with the thread number */
size_t key_file_len = strlen(config->key_file) + strlen(thread_num_str) - 2 + 1;
thread_configs[i]->key_file = xmalloc(key_file_len);
StringReplaceN(thread_configs[i]->key_file, key_file_len,
"%d", thread_num_str, 1);
}
else
{
Expand All @@ -803,6 +812,7 @@ int main(int argc, char *argv[])
{
thread_configs[i]->address = IncrementIPaddress(thread_configs[i-1]->address);
}
free(thread_num_str);
}

CFTestD_ConfigDestroy(config);
Expand Down
Loading

0 comments on commit 366eee3

Please sign in to comment.