Fixed and updated the port to the latest LTS version.

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/Makefile,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile
--- Makefile    19 Nov 2016 15:28:40 -0000    1.56
+++ Makefile    26 Nov 2017 02:38:12 -0000
@@ -1,10 +1,10 @@
 # $OpenBSD: Makefile,v 1.56 2016/11/19 15:28:40 sthen Exp $

-BROKEN =    pkg_add fails: problem with symlinks
+#BROKEN =    pkg_add fails: problem with symlinks

 COMMENT =    GNU system administration tool for networks

-DISTNAME =    cfengine-3.7.2
+DISTNAME =    cfengine-3.10.2

 SHARED_LIBS +=  promises    0.0 # 1.0
 CATEGORIES =    sysutils
@@ -15,7 +15,7 @@ MAINTAINER =    Rodrigo Mosconi <openbsd@mo
 # GPLv3 only
 PERMIT_PACKAGE_CDROM =    Yes

-WANTLIB += c crypto iconv lzma m pam pcre pthread ssl qdbm xml2 z
+WANTLIB += c crypto iconv lzma m pcre pthread ssl tokyocabinet yaml xml2 z

 MASTER_SITES =    https://cfengine-package-repos.s3.amazonaws.com/tarballs/

@@ -30,22 +30,22 @@ SEPARATE_BUILD =     Yes
 CONFIGURE_STYLE =    gnu
 USE_GMAKE =        Yes
 LIB_DEPENDS =        converters/libiconv \
-            databases/qdbm \
+            databases/tokyocabinet \
             devel/pcre \
-            security/openpam \
-            textproc/libxml
+            textproc/libxml \
+            devel/libyaml
 CONFIGURE_ENV +=    CPPFLAGS="-I${LOCALBASE}/include" \
             LDFLAGS="-L${LOCALBASE}/lib"
 CONFIGURE_ARGS =    --with-openssl=/usr \
             --without-libacl \
             --without-libvirt \
             --with-libxml2 \
-            --without-libyaml \
+            --with-libyaml \
             --without-lmdb \
-            --with-pam \
+            --without-pam \
             --with-pcre \
-            --with-qdbm \
-            --without-tokyocabinet \
+            --without-qdbm \
+            --with-tokyocabinet \
             --disable-fhs \
             --with-workdir=${CFENGINE_BASE}
 MAKE_FLAGS +=        examplesdir="${CFENGINE_EXAMPLES}" \
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/distinfo,v
retrieving revision 1.15
diff -u -p -r1.15 distinfo
--- distinfo    22 Jan 2016 11:38:23 -0000    1.15
+++ distinfo    26 Nov 2017 02:38:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (cfengine-3.7.2.tar.gz) =
qtmuJghkrL3yqkQcIINlRg+ajsqlNhi720ZeN670reU=
-SIZE (cfengine-3.7.2.tar.gz) = 2114764
+SHA256 (cfengine-3.10.2.tar.gz) =
1PqaxydtunuF1nV6qy8JKauNOxFcsOewz5hHYDR0Kdc=
+SIZE (cfengine-3.10.2.tar.gz) = 2366237
Index: patches/patch-cf-agent_verify_files_c
===================================================================
RCS file: patches/patch-cf-agent_verify_files_c
diff -N patches/patch-cf-agent_verify_files_c
--- patches/patch-cf-agent_verify_files_c    22 Jan 2016 11:38:23 -0000
1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-cf-agent_verify_files_c,v 1.1 2016/01/22 11:38:23 sthen
Exp $
---- cf-agent/verify_files.c.orig    Wed Jan 20 00:29:13 2016
-+++ cf-agent/verify_files.c    Wed Jan 20 00:32:12 2016
-@@ -680,12 +680,12 @@ PromiseResult ScheduleEditOperation(EvalContext
*ctx,
-         if ((vp = PromiseGetConstraintAsRval(pp, "edit_line",
RVAL_TYPE_FNCALL)))
-         {
-             fp = (FnCall *) vp;
--            strcpy(edit_bundle_name, fp->name);
-+            strlcpy(edit_bundle_name, fp->name, CF_BUFSIZE);
-             args = fp->args;
-         }
-         else if ((vp = PromiseGetConstraintAsRval(pp, "edit_line",
RVAL_TYPE_SCALAR)))
-         {
--            strcpy(edit_bundle_name, (char *) vp);
-+            strlcpy(edit_bundle_name, (char *) vp, CF_BUFSIZE);
-             args = NULL;
-         }
-         else
Index: patches/patch-cf-execd_cf-execd_c
===================================================================
RCS file: patches/patch-cf-execd_cf-execd_c
diff -N patches/patch-cf-execd_cf-execd_c
--- patches/patch-cf-execd_cf-execd_c    22 Jan 2016 11:38:23 -0000    1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-cf-execd_cf-execd_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- cf-execd/cf-execd.c.orig    Wed Jan 20 01:40:30 2016
-+++ cf-execd/cf-execd.c    Wed Jan 20 01:42:49 2016
-@@ -568,7 +568,7 @@ static bool ScheduleRun(EvalContext *ctx, Policy **pol
-
-         EvalContextClear(ctx);
-
--        strcpy(VDOMAIN, "undefined.domain");
-+        strlcpy(VDOMAIN, "undefined.domain", sizeof(VDOMAIN));
-
-         PolicyDestroy(*policy);
-         *policy = NULL;
Index: patches/patch-cf-upgrade_log_c
===================================================================
RCS file: patches/patch-cf-upgrade_log_c
diff -N patches/patch-cf-upgrade_log_c
--- patches/patch-cf-upgrade_log_c    22 Jan 2016 11:38:23 -0000    1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-cf-upgrade_log_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- cf-upgrade/log.c.orig    Wed Jan 20 00:13:36 2016
-+++ cf-upgrade/log.c    Wed Jan 20 00:14:34 2016
-@@ -54,7 +54,7 @@ static char *prepare_message(char *format, va_list arg
-     strftime(timestamp, timestamp_size, "%Y/%m/%d %H:%M:%S", now_tm);
-     /* '[' + ']' + ' ' + '\0' */
-     message = xmalloc(message_size + timestamp_size + 4);
--    sprintf(message, "[%s] %s", timestamp, buffer);
-+    snprintf(message, message_size, "[%s] %s", timestamp, buffer);
-     return message;
- }
-
Index: patches/patch-libcfnet_client_code_c
===================================================================
RCS file: patches/patch-libcfnet_client_code_c
diff -N patches/patch-libcfnet_client_code_c
--- /dev/null    1 Jan 1970 00:00:00 -0000
+++ patches/patch-libcfnet_client_code_c    26 Nov 2017 02:38:12 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: libcfnet/client_code.c
+--- libcfnet/client_code.c.orig
++++ libcfnet/client_code.c
+@@ -772,7 +772,7 @@ int CopyRegularFileNet(const char *source, const char
+         /* If the first thing we get is an error message, break. */
+
+         if (n_wrote_total == 0
+-            && strncmp(buf, CF_FAILEDSTR, strlen(CF_FAILEDSTR) == 0))
++            && strncmp(buf, CF_FAILEDSTR, (size_t)(strlen(CF_FAILEDSTR)
== 0)))
+         {
+             Log(LOG_LEVEL_INFO, "Network access to '%s:%s' denied",
+                 conn->this_server, source);
Index: patches/patch-libcompat_strchrnul_c
===================================================================
RCS file: patches/patch-libcompat_strchrnul_c
diff -N patches/patch-libcompat_strchrnul_c
--- patches/patch-libcompat_strchrnul_c    22 Jan 2016 11:38:23 -0000    1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libcompat_strchrnul_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- libcompat/strchrnul.c.orig    Wed Jan 20 01:28:25 2016
-+++ libcompat/strchrnul.c    Wed Jan 20 01:29:38 2016
-@@ -12,7 +12,7 @@ char *strchrnul(const char *s, int c)
-
-     if (p == NULL)
-     {
--        return s + strlen(s);
-+        return (char *)s + strlen(s);
-     }
-     else
-     {
Index: patches/patch-libpromises_evalfunction_c
===================================================================
RCS file: patches/patch-libpromises_evalfunction_c
diff -N patches/patch-libpromises_evalfunction_c
--- patches/patch-libpromises_evalfunction_c    22 Jan 2016 11:38:23
-0000    1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libpromises_evalfunction_c,v 1.1 2016/01/22 11:38:23 sthen
Exp $
---- libpromises/evalfunction.c.orig    Mon Jan 18 22:52:24 2016
-+++ libpromises/evalfunction.c    Mon Jan 18 22:52:49 2016
-@@ -5520,7 +5520,7 @@ static FnCallResult FnCallStrftime(ARG_UNUSED
EvalCont
-     if (tm == NULL)
-     {
-         Log(LOG_LEVEL_WARNING,
--            "Function %s, the given time stamp '%ld' was invalid.
(strftime: %s)",
-+            "Function %s, the given time stamp '%lld' was invalid.
(strftime: %s)",
-             fp->name, when, GetErrorStr());
-     }
-     else if (PortablyFormatTime(buffer, sizeof(buffer),
Index: patches/patch-libutils_string_lib_c
===================================================================
RCS file: patches/patch-libutils_string_lib_c
diff -N patches/patch-libutils_string_lib_c
--- patches/patch-libutils_string_lib_c    22 Jan 2016 11:38:23 -0000    1.1
+++ /dev/null    1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-libutils_string_lib_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- libutils/string_lib.c.orig    Wed Jan 20 01:38:43 2016
-+++ libutils/string_lib.c    Wed Jan 20 01:40:04 2016
-@@ -1023,8 +1023,8 @@ bool StringAppendAbbreviatedPromise(char *dst, const
c
-             last_line += tail - max_fragment;
-         }
-         memcpy(abbr, src, head);
--        strcpy(abbr + head, sep);
--        strcat(abbr, last_line);
-+        strlcpy(abbr + head, sep, sizeof(abbr)-head );
-+        strlcat(abbr, last_line, sizeof(abbr) );
-         return StringAppendPromise(dst, abbr, n);
-     }
- }
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/pkg/PLIST,v
retrieving revision 1.14
diff -u -p -r1.14 PLIST
--- pkg/PLIST    22 Jan 2016 11:38:23 -0000    1.14
+++ pkg/PLIST    26 Nov 2017 02:38:12 -0000
@@ -1,7 +1,4 @@
 @comment $OpenBSD: PLIST,v 1.14 2016/01/22 11:38:23 sthen Exp $
-lib/libpromises.a
-lib/libpromises.la
-@lib lib/libpromises.so.${LIBpromises_VERSION}
 @bin bin/cf-agent
 @bin bin/cf-execd
 @bin bin/cf-key
@@ -10,6 +7,9 @@ lib/libpromises.la
 @bin bin/cf-runagent
 @bin bin/cf-serverd
 @bin bin/cf-upgrade
+lib/libpromises.a
+lib/libpromises.la
+@lib lib/libpromises.so.${LIBpromises_VERSION}
 share/doc/cfengine/
 share/doc/cfengine/ChangeLog
 share/doc/cfengine/README.md
@@ -30,6 +30,7 @@ share/examples/cfengine/ago.cf
 share/examples/cfengine/app_baseline.cf
 share/examples/cfengine/appgroups.cf
 share/examples/cfengine/arrays.cf
+share/examples/cfengine/augment.cf
 share/examples/cfengine/backreferences_files.cf
 share/examples/cfengine/badpromise.cf
 share/examples/cfengine/badtype.cf
@@ -130,6 +131,7 @@ share/examples/cfengine/getindices_and_v
 share/examples/cfengine/getmacaddress.cf
 share/examples/cfengine/getregistry.cf
 share/examples/cfengine/getuid.cf
+share/examples/cfengine/getuserinfo.cf
 share/examples/cfengine/getusers.cf
 share/examples/cfengine/getvalues.cf
 share/examples/cfengine/getvariablemetatags.cf
@@ -160,6 +162,7 @@ share/examples/cfengine/irange.cf
 share/examples/cfengine/isdir.cf
 share/examples/cfengine/isexecutable.cf
 share/examples/cfengine/isgreaterthan.cf
+share/examples/cfengine/isipinsubnet.cf
 share/examples/cfengine/islessthan.cf
 share/examples/cfengine/islink.cf
 share/examples/cfengine/isnewerthan.cf
@@ -167,6 +170,7 @@ share/examples/cfengine/isplain.cf
 share/examples/cfengine/isvariable.cf
 share/examples/cfengine/iteration.cf
 share/examples/cfengine/join.cf
+share/examples/cfengine/kill_process_running_wrong_user.cf
 share/examples/cfengine/knowledge_driver.cf
 share/examples/cfengine/knowledge_txt.cf
 share/examples/cfengine/lastnode.cf
@@ -174,12 +178,19 @@ share/examples/cfengine/ldap.cf
 share/examples/cfengine/length.cf
 share/examples/cfengine/linking.cf
 share/examples/cfengine/literal_server.cf
+share/examples/cfengine/local_group_present.cf
+share/examples/cfengine/local_user_password.cf
+share/examples/cfengine/local_user_secondary_group_member.cf
+share/examples/cfengine/local_users_absent.cf
+share/examples/cfengine/local_users_locked.cf
+share/examples/cfengine/local_users_present.cf
 share/examples/cfengine/locate_files_and_compress.cf
 share/examples/cfengine/log_private.cf
 share/examples/cfengine/loops.cf
 share/examples/cfengine/lsdir.cf
 share/examples/cfengine/maparray.cf
 share/examples/cfengine/mapdata.cf
+share/examples/cfengine/mapdata_jsonpipe.cf
 share/examples/cfengine/maplist.cf
 share/examples/cfengine/max-min-mean-variance.cf
 share/examples/cfengine/measure_log.cf
@@ -195,9 +206,10 @@ share/examples/cfengine/method_var2.cf
 share/examples/cfengine/module_exec.cf
 share/examples/cfengine/module_exec_2.cf
 share/examples/cfengine/monitord.cf
-share/examples/cfengine/motd.cf
 share/examples/cfengine/mount_fs.cf
 share/examples/cfengine/multipassvars.cf
+share/examples/cfengine/multiple_outcomes.cf
+share/examples/cfengine/mustache_template_motd.cf
 share/examples/cfengine/namespace.cf
 share/examples/cfengine/namespace1.cf
 share/examples/cfengine/namespace2.cf
@@ -254,6 +266,7 @@ share/examples/cfengine/processes_define
 share/examples/cfengine/product.cf
 share/examples/cfengine/promise_knowledge.cf
 share/examples/cfengine/promises.cf
+share/examples/cfengine/quoting.cf
 share/examples/cfengine/randomint.cf
 share/examples/cfengine/readcsv.cf
 share/examples/cfengine/readdata.cf
@@ -264,6 +277,7 @@ share/examples/cfengine/readtcp.cf
 share/examples/cfengine/reg_multiline.cf
 share/examples/cfengine/regarray.cf
 share/examples/cfengine/regcmp.cf
+share/examples/cfengine/regex_replace.cf
 share/examples/cfengine/regex_win.cf
 share/examples/cfengine/regextract.cf
 share/examples/cfengine/registry.cf
@@ -282,6 +296,7 @@ share/examples/cfengine/report_custom.cf
 share/examples/cfengine/report_diffs.cf
 share/examples/cfengine/report_state.cf
 share/examples/cfengine/reporting.cf
+share/examples/cfengine/reports.cf
 share/examples/cfengine/reporttofile.cf
 share/examples/cfengine/resolveconf.cf
 share/examples/cfengine/returnszero.cf
@@ -301,11 +316,14 @@ share/examples/cfengine/service_catalogu
 share/examples/cfengine/service_catalogue_separate.cf
 share/examples/cfengine/service_disable.cf
 share/examples/cfengine/service_start.cf
+share/examples/cfengine/services.cf
 share/examples/cfengine/services_concept.cf
+share/examples/cfengine/services_default_service_bundle.cf
 share/examples/cfengine/services_win.cf
 share/examples/cfengine/setuidlog.cf
 share/examples/cfengine/setvar.cf
 share/examples/cfengine/shuffle.cf
+share/examples/cfengine/simple_ssh_key_distribution.cf
 share/examples/cfengine/software_dist.cf
 share/examples/cfengine/software_update_version_yum.cf
 share/examples/cfengine/some.cf
@@ -327,6 +345,8 @@ share/examples/cfengine/stringarray.cf
 share/examples/cfengine/sublist.cf
 share/examples/cfengine/sum.cf
 share/examples/cfengine/switchcase.cf
+share/examples/cfengine/symlink.cf
+share/examples/cfengine/symlink_children.cf
 share/examples/cfengine/syslog.cf
 share/examples/cfengine/syslog2.cf
 share/examples/cfengine/template.cf
@@ -344,6 +364,7 @@ share/examples/cfengine/users_type.cf
 share/examples/cfengine/varclass.cf
 share/examples/cfengine/varexpansion.cf
 share/examples/cfengine/variablesmatching.cf
+share/examples/cfengine/variablesmatching_as_data.cf
 share/examples/cfengine/varnet.cf
 share/examples/cfengine/vars.cf
 share/examples/cfengine/warnifline.cf
@@ -357,16 +378,6 @@ share/examples/cfengine/zenoss.cf
 @rcscript ${RCDIR}/cf_monitord
 @rcscript ${RCDIR}/cf_serverd
 @rcscript ${RCDIR}/cfengine
-@cwd ${CFENGINE_BASE}
-bin/
-bin/cf-agent
-bin/cf-execd
-bin/cf-key
-bin/cf-monitord
-bin/cf-promises
-bin/cf-runagent
-bin/cf-serverd
-bin/cf-upgrade
 @mode 0750
 @sample ${CFENGINE_BASE}/
 @mode 0700
@@ -375,5 +386,15 @@ bin/cf-upgrade
 @sample ${CFENGINE_BASE}/modules/
 @sample ${CFENGINE_BASE}/outputs/
 @sample ${CFENGINE_BASE}/ppkeys/
-@mode
 @extraunexec rm -rf ${CFENGINE_BASE}/*
+@cwd ${CFENGINE_BASE}
+@exec mkdir ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-agent  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-execd  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-key  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-monitord  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-promises  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-runagent  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-serverd  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-upgrade  ${CFENGINE_BASE}/bin
+@mode
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/Makefile,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile
--- Makefile	19 Nov 2016 15:28:40 -0000	1.56
+++ Makefile	26 Nov 2017 02:38:12 -0000
@@ -1,10 +1,10 @@
 # $OpenBSD: Makefile,v 1.56 2016/11/19 15:28:40 sthen Exp $
 
-BROKEN =	pkg_add fails: problem with symlinks
+#BROKEN =	pkg_add fails: problem with symlinks
 
 COMMENT =	GNU system administration tool for networks
 
-DISTNAME =	cfengine-3.7.2
+DISTNAME =	cfengine-3.10.2
 
 SHARED_LIBS +=  promises	0.0 # 1.0
 CATEGORIES =	sysutils
@@ -15,7 +15,7 @@ MAINTAINER =	Rodrigo Mosconi <openbsd@mo
 # GPLv3 only
 PERMIT_PACKAGE_CDROM =	Yes
 
-WANTLIB += c crypto iconv lzma m pam pcre pthread ssl qdbm xml2 z
+WANTLIB += c crypto iconv lzma m pcre pthread ssl tokyocabinet yaml xml2 z
 
 MASTER_SITES =	https://cfengine-package-repos.s3.amazonaws.com/tarballs/
 
@@ -30,22 +30,22 @@ SEPARATE_BUILD = 	Yes
 CONFIGURE_STYLE =	gnu
 USE_GMAKE =		Yes
 LIB_DEPENDS =		converters/libiconv \
-			databases/qdbm \
+			databases/tokyocabinet \
 			devel/pcre \
-			security/openpam \
-			textproc/libxml
+			textproc/libxml \
+			devel/libyaml
 CONFIGURE_ENV +=	CPPFLAGS="-I${LOCALBASE}/include" \
 			LDFLAGS="-L${LOCALBASE}/lib"
 CONFIGURE_ARGS =	--with-openssl=/usr \
 			--without-libacl \
 			--without-libvirt \
 			--with-libxml2 \
-			--without-libyaml \
+			--with-libyaml \
 			--without-lmdb \
-			--with-pam \
+			--without-pam \
 			--with-pcre \
-			--with-qdbm \
-			--without-tokyocabinet \
+			--without-qdbm \
+			--with-tokyocabinet \
 			--disable-fhs \
 			--with-workdir=${CFENGINE_BASE}
 MAKE_FLAGS +=		examplesdir="${CFENGINE_EXAMPLES}" \
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/distinfo,v
retrieving revision 1.15
diff -u -p -r1.15 distinfo
--- distinfo	22 Jan 2016 11:38:23 -0000	1.15
+++ distinfo	26 Nov 2017 02:38:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (cfengine-3.7.2.tar.gz) = qtmuJghkrL3yqkQcIINlRg+ajsqlNhi720ZeN670reU=
-SIZE (cfengine-3.7.2.tar.gz) = 2114764
+SHA256 (cfengine-3.10.2.tar.gz) = 1PqaxydtunuF1nV6qy8JKauNOxFcsOewz5hHYDR0Kdc=
+SIZE (cfengine-3.10.2.tar.gz) = 2366237
Index: patches/patch-cf-agent_verify_files_c
===================================================================
RCS file: patches/patch-cf-agent_verify_files_c
diff -N patches/patch-cf-agent_verify_files_c
--- patches/patch-cf-agent_verify_files_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-$OpenBSD: patch-cf-agent_verify_files_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- cf-agent/verify_files.c.orig	Wed Jan 20 00:29:13 2016
-+++ cf-agent/verify_files.c	Wed Jan 20 00:32:12 2016
-@@ -680,12 +680,12 @@ PromiseResult ScheduleEditOperation(EvalContext *ctx, 
-         if ((vp = PromiseGetConstraintAsRval(pp, "edit_line", RVAL_TYPE_FNCALL)))
-         {
-             fp = (FnCall *) vp;
--            strcpy(edit_bundle_name, fp->name);
-+            strlcpy(edit_bundle_name, fp->name, CF_BUFSIZE);
-             args = fp->args;
-         }
-         else if ((vp = PromiseGetConstraintAsRval(pp, "edit_line", RVAL_TYPE_SCALAR)))
-         {
--            strcpy(edit_bundle_name, (char *) vp);
-+            strlcpy(edit_bundle_name, (char *) vp, CF_BUFSIZE);
-             args = NULL;
-         }             
-         else
Index: patches/patch-cf-execd_cf-execd_c
===================================================================
RCS file: patches/patch-cf-execd_cf-execd_c
diff -N patches/patch-cf-execd_cf-execd_c
--- patches/patch-cf-execd_cf-execd_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-cf-execd_cf-execd_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- cf-execd/cf-execd.c.orig	Wed Jan 20 01:40:30 2016
-+++ cf-execd/cf-execd.c	Wed Jan 20 01:42:49 2016
-@@ -568,7 +568,7 @@ static bool ScheduleRun(EvalContext *ctx, Policy **pol
- 
-         EvalContextClear(ctx);
- 
--        strcpy(VDOMAIN, "undefined.domain");
-+        strlcpy(VDOMAIN, "undefined.domain", sizeof(VDOMAIN));
- 
-         PolicyDestroy(*policy);
-         *policy = NULL;
Index: patches/patch-cf-upgrade_log_c
===================================================================
RCS file: patches/patch-cf-upgrade_log_c
diff -N patches/patch-cf-upgrade_log_c
--- patches/patch-cf-upgrade_log_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-cf-upgrade_log_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- cf-upgrade/log.c.orig	Wed Jan 20 00:13:36 2016
-+++ cf-upgrade/log.c	Wed Jan 20 00:14:34 2016
-@@ -54,7 +54,7 @@ static char *prepare_message(char *format, va_list arg
-     strftime(timestamp, timestamp_size, "%Y/%m/%d %H:%M:%S", now_tm);
-     /* '[' + ']' + ' ' + '\0' */
-     message = xmalloc(message_size + timestamp_size + 4);
--    sprintf(message, "[%s] %s", timestamp, buffer);
-+    snprintf(message, message_size, "[%s] %s", timestamp, buffer);
-     return message;
- }
- 
Index: patches/patch-libcfnet_client_code_c
===================================================================
RCS file: patches/patch-libcfnet_client_code_c
diff -N patches/patch-libcfnet_client_code_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-libcfnet_client_code_c	26 Nov 2017 02:38:12 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: libcfnet/client_code.c
+--- libcfnet/client_code.c.orig
++++ libcfnet/client_code.c
+@@ -772,7 +772,7 @@ int CopyRegularFileNet(const char *source, const char 
+         /* If the first thing we get is an error message, break. */
+ 
+         if (n_wrote_total == 0
+-            && strncmp(buf, CF_FAILEDSTR, strlen(CF_FAILEDSTR) == 0))
++            && strncmp(buf, CF_FAILEDSTR, (size_t)(strlen(CF_FAILEDSTR) == 0)))
+         {
+             Log(LOG_LEVEL_INFO, "Network access to '%s:%s' denied",
+                 conn->this_server, source);
Index: patches/patch-libcompat_strchrnul_c
===================================================================
RCS file: patches/patch-libcompat_strchrnul_c
diff -N patches/patch-libcompat_strchrnul_c
--- patches/patch-libcompat_strchrnul_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libcompat_strchrnul_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- libcompat/strchrnul.c.orig	Wed Jan 20 01:28:25 2016
-+++ libcompat/strchrnul.c	Wed Jan 20 01:29:38 2016
-@@ -12,7 +12,7 @@ char *strchrnul(const char *s, int c)
- 
-     if (p == NULL)
-     {
--        return s + strlen(s);
-+        return (char *)s + strlen(s);
-     }
-     else
-     {
Index: patches/patch-libpromises_evalfunction_c
===================================================================
RCS file: patches/patch-libpromises_evalfunction_c
diff -N patches/patch-libpromises_evalfunction_c
--- patches/patch-libpromises_evalfunction_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libpromises_evalfunction_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- libpromises/evalfunction.c.orig	Mon Jan 18 22:52:24 2016
-+++ libpromises/evalfunction.c	Mon Jan 18 22:52:49 2016
-@@ -5520,7 +5520,7 @@ static FnCallResult FnCallStrftime(ARG_UNUSED EvalCont
-     if (tm == NULL)
-     {
-         Log(LOG_LEVEL_WARNING,
--            "Function %s, the given time stamp '%ld' was invalid. (strftime: %s)",
-+            "Function %s, the given time stamp '%lld' was invalid. (strftime: %s)",
-             fp->name, when, GetErrorStr());
-     }
-     else if (PortablyFormatTime(buffer, sizeof(buffer),
Index: patches/patch-libutils_string_lib_c
===================================================================
RCS file: patches/patch-libutils_string_lib_c
diff -N patches/patch-libutils_string_lib_c
--- patches/patch-libutils_string_lib_c	22 Jan 2016 11:38:23 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-libutils_string_lib_c,v 1.1 2016/01/22 11:38:23 sthen Exp $
---- libutils/string_lib.c.orig	Wed Jan 20 01:38:43 2016
-+++ libutils/string_lib.c	Wed Jan 20 01:40:04 2016
-@@ -1023,8 +1023,8 @@ bool StringAppendAbbreviatedPromise(char *dst, const c
-             last_line += tail - max_fragment;
-         }
-         memcpy(abbr, src, head);
--        strcpy(abbr + head, sep);
--        strcat(abbr, last_line);
-+        strlcpy(abbr + head, sep, sizeof(abbr)-head );
-+        strlcat(abbr, last_line, sizeof(abbr) );
-         return StringAppendPromise(dst, abbr, n);
-     }
- }
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/pkg/PLIST,v
retrieving revision 1.14
diff -u -p -r1.14 PLIST
--- pkg/PLIST	22 Jan 2016 11:38:23 -0000	1.14
+++ pkg/PLIST	26 Nov 2017 02:38:12 -0000
@@ -1,7 +1,4 @@
 @comment $OpenBSD: PLIST,v 1.14 2016/01/22 11:38:23 sthen Exp $
-lib/libpromises.a
-lib/libpromises.la
-@lib lib/libpromises.so.${LIBpromises_VERSION}
 @bin bin/cf-agent
 @bin bin/cf-execd
 @bin bin/cf-key
@@ -10,6 +7,9 @@ lib/libpromises.la
 @bin bin/cf-runagent
 @bin bin/cf-serverd
 @bin bin/cf-upgrade
+lib/libpromises.a
+lib/libpromises.la
+@lib lib/libpromises.so.${LIBpromises_VERSION}
 share/doc/cfengine/
 share/doc/cfengine/ChangeLog
 share/doc/cfengine/README.md
@@ -30,6 +30,7 @@ share/examples/cfengine/ago.cf
 share/examples/cfengine/app_baseline.cf
 share/examples/cfengine/appgroups.cf
 share/examples/cfengine/arrays.cf
+share/examples/cfengine/augment.cf
 share/examples/cfengine/backreferences_files.cf
 share/examples/cfengine/badpromise.cf
 share/examples/cfengine/badtype.cf
@@ -130,6 +131,7 @@ share/examples/cfengine/getindices_and_v
 share/examples/cfengine/getmacaddress.cf
 share/examples/cfengine/getregistry.cf
 share/examples/cfengine/getuid.cf
+share/examples/cfengine/getuserinfo.cf
 share/examples/cfengine/getusers.cf
 share/examples/cfengine/getvalues.cf
 share/examples/cfengine/getvariablemetatags.cf
@@ -160,6 +162,7 @@ share/examples/cfengine/irange.cf
 share/examples/cfengine/isdir.cf
 share/examples/cfengine/isexecutable.cf
 share/examples/cfengine/isgreaterthan.cf
+share/examples/cfengine/isipinsubnet.cf
 share/examples/cfengine/islessthan.cf
 share/examples/cfengine/islink.cf
 share/examples/cfengine/isnewerthan.cf
@@ -167,6 +170,7 @@ share/examples/cfengine/isplain.cf
 share/examples/cfengine/isvariable.cf
 share/examples/cfengine/iteration.cf
 share/examples/cfengine/join.cf
+share/examples/cfengine/kill_process_running_wrong_user.cf
 share/examples/cfengine/knowledge_driver.cf
 share/examples/cfengine/knowledge_txt.cf
 share/examples/cfengine/lastnode.cf
@@ -174,12 +178,19 @@ share/examples/cfengine/ldap.cf
 share/examples/cfengine/length.cf
 share/examples/cfengine/linking.cf
 share/examples/cfengine/literal_server.cf
+share/examples/cfengine/local_group_present.cf
+share/examples/cfengine/local_user_password.cf
+share/examples/cfengine/local_user_secondary_group_member.cf
+share/examples/cfengine/local_users_absent.cf
+share/examples/cfengine/local_users_locked.cf
+share/examples/cfengine/local_users_present.cf
 share/examples/cfengine/locate_files_and_compress.cf
 share/examples/cfengine/log_private.cf
 share/examples/cfengine/loops.cf
 share/examples/cfengine/lsdir.cf
 share/examples/cfengine/maparray.cf
 share/examples/cfengine/mapdata.cf
+share/examples/cfengine/mapdata_jsonpipe.cf
 share/examples/cfengine/maplist.cf
 share/examples/cfengine/max-min-mean-variance.cf
 share/examples/cfengine/measure_log.cf
@@ -195,9 +206,10 @@ share/examples/cfengine/method_var2.cf
 share/examples/cfengine/module_exec.cf
 share/examples/cfengine/module_exec_2.cf
 share/examples/cfengine/monitord.cf
-share/examples/cfengine/motd.cf
 share/examples/cfengine/mount_fs.cf
 share/examples/cfengine/multipassvars.cf
+share/examples/cfengine/multiple_outcomes.cf
+share/examples/cfengine/mustache_template_motd.cf
 share/examples/cfengine/namespace.cf
 share/examples/cfengine/namespace1.cf
 share/examples/cfengine/namespace2.cf
@@ -254,6 +266,7 @@ share/examples/cfengine/processes_define
 share/examples/cfengine/product.cf
 share/examples/cfengine/promise_knowledge.cf
 share/examples/cfengine/promises.cf
+share/examples/cfengine/quoting.cf
 share/examples/cfengine/randomint.cf
 share/examples/cfengine/readcsv.cf
 share/examples/cfengine/readdata.cf
@@ -264,6 +277,7 @@ share/examples/cfengine/readtcp.cf
 share/examples/cfengine/reg_multiline.cf
 share/examples/cfengine/regarray.cf
 share/examples/cfengine/regcmp.cf
+share/examples/cfengine/regex_replace.cf
 share/examples/cfengine/regex_win.cf
 share/examples/cfengine/regextract.cf
 share/examples/cfengine/registry.cf
@@ -282,6 +296,7 @@ share/examples/cfengine/report_custom.cf
 share/examples/cfengine/report_diffs.cf
 share/examples/cfengine/report_state.cf
 share/examples/cfengine/reporting.cf
+share/examples/cfengine/reports.cf
 share/examples/cfengine/reporttofile.cf
 share/examples/cfengine/resolveconf.cf
 share/examples/cfengine/returnszero.cf
@@ -301,11 +316,14 @@ share/examples/cfengine/service_catalogu
 share/examples/cfengine/service_catalogue_separate.cf
 share/examples/cfengine/service_disable.cf
 share/examples/cfengine/service_start.cf
+share/examples/cfengine/services.cf
 share/examples/cfengine/services_concept.cf
+share/examples/cfengine/services_default_service_bundle.cf
 share/examples/cfengine/services_win.cf
 share/examples/cfengine/setuidlog.cf
 share/examples/cfengine/setvar.cf
 share/examples/cfengine/shuffle.cf
+share/examples/cfengine/simple_ssh_key_distribution.cf
 share/examples/cfengine/software_dist.cf
 share/examples/cfengine/software_update_version_yum.cf
 share/examples/cfengine/some.cf
@@ -327,6 +345,8 @@ share/examples/cfengine/stringarray.cf
 share/examples/cfengine/sublist.cf
 share/examples/cfengine/sum.cf
 share/examples/cfengine/switchcase.cf
+share/examples/cfengine/symlink.cf
+share/examples/cfengine/symlink_children.cf
 share/examples/cfengine/syslog.cf
 share/examples/cfengine/syslog2.cf
 share/examples/cfengine/template.cf
@@ -344,6 +364,7 @@ share/examples/cfengine/users_type.cf
 share/examples/cfengine/varclass.cf
 share/examples/cfengine/varexpansion.cf
 share/examples/cfengine/variablesmatching.cf
+share/examples/cfengine/variablesmatching_as_data.cf
 share/examples/cfengine/varnet.cf
 share/examples/cfengine/vars.cf
 share/examples/cfengine/warnifline.cf
@@ -357,16 +378,6 @@ share/examples/cfengine/zenoss.cf
 @rcscript ${RCDIR}/cf_monitord
 @rcscript ${RCDIR}/cf_serverd
 @rcscript ${RCDIR}/cfengine
-@cwd ${CFENGINE_BASE}
-bin/
-bin/cf-agent
-bin/cf-execd
-bin/cf-key
-bin/cf-monitord
-bin/cf-promises
-bin/cf-runagent
-bin/cf-serverd
-bin/cf-upgrade
 @mode 0750
 @sample ${CFENGINE_BASE}/
 @mode 0700
@@ -375,5 +386,15 @@ bin/cf-upgrade
 @sample ${CFENGINE_BASE}/modules/
 @sample ${CFENGINE_BASE}/outputs/
 @sample ${CFENGINE_BASE}/ppkeys/
-@mode
 @extraunexec rm -rf ${CFENGINE_BASE}/*
+@cwd ${CFENGINE_BASE}
+@exec mkdir ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-agent  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-execd  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-key  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-monitord  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-promises  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-runagent  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-serverd  ${CFENGINE_BASE}/bin
+@exec-add ln -s ${LOCALBASE}/bin/cf-upgrade  ${CFENGINE_BASE}/bin
+@mode

Reply via email to