Page MenuHomeFreeBSD

net/ocserv: update to 0.11.1
ClosedPublic

Authored by cpm on Apr 8 2016, 11:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 18 2026, 9:24 PM
Unknown Object (File)
Feb 17 2026, 3:44 PM
Unknown Object (File)
Feb 12 2026, 2:44 PM
Unknown Object (File)
Jan 9 2026, 9:34 PM
Unknown Object (File)
Dec 6 2025, 4:26 AM
Unknown Object (File)
Nov 9 2025, 2:03 AM
Unknown Object (File)
Nov 7 2025, 9:40 AM
Unknown Object (File)
Nov 7 2025, 9:40 AM
Subscribers
None

Details

Summary
  • Update to 0.11.1 release
  • Convert LICENSE= "GPLxx # or later" to "GPLxx+"
  • Add dependency on libev
  • Regenerate patches
  • Add MAKE_JOBS_UNSAFE; port attempts to modify man page before generation sed: ocpasswd.8: No such file or directory

Changelog:

http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003551.html

Test Plan

ocserv port build/install fine but core dump if it fork to background.

http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003552.html

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cpm retitled this revision from to net/ocserv: update to 0.11.1.
cpm updated this object.
cpm edited the test plan for this revision. (Show Details)
cpm added a reviewer: junovitch.

Regarding this, http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003552.html, what's the next step if there is a runtime error? Are we going to wait for an upstream release or patch to fix it?

Makefile
43 ↗(On Diff #15025)

Why the MAKE_JOBS_UNSAFE?

When it comes time to remove this we'll want it in the SVN history why it was initially added so we can be certain that it indeed safe to remove. See https://lists.FreeBSD.org/pipermail/svn-ports-all/2016-April/121764.html

Regarding this, http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003552.html, what's the next step if there is a runtime error? Are we going to wait for an upstream release or patch to fix it?

I'm working in a patch to submit upstream which fix the invalid fd. Also, I'm in contact with the ocserv developer.

The port fails to build at this point

Making all in doc
gmake[4]: Entering directory '/usr/ports/net/ocserv/work/ocserv-0.11.1/doc'
gsed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' \
	../src/ocserv-args.def > ../src/ocserv-args.def.tmp && \
autogen -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl \
	../src/ocserv-args.def.tmp && \
rm -f ../src/ocserv-args.def.tmp
gsed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' \
	../src/ocpasswd/args.def > ../src/ocpasswd/args.def.tmp && \
autogen -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl \
	../src/ocpasswd/args.def.tmp && \
rm -f ../src/ocpasswd/args.def.tmp
gsed 's/@subheading \(.*\)/@*\n@var{\1}\n@*/' \
	../src/occtl/args.def > ../src/occtl/args.def.tmp && \
autogen -L../src -DMAN_SECTION=8 -Tagman-cmd.tpl \
	../src/occtl/args.def.tmp && \
rm -f ../src/occtl/args.def.tmp
sed -I -e 's/^\.NOP //' occtl.8
sed -I -e 's/^\.NOP //' ocpasswd.8
sed: ocpasswd.8: No such file or directory
Makefile:1145: recipe for target 'ocpasswd.8' failed
gmake[4]: *** [ocpasswd.8] Error 1
gmake[4]: *** Waiting for unfinished jobs....
sed -I -e 's/^\.NOP //' ocserv.8
gmake[4]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.1/doc'
Makefile:1011: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.1'
Makefile:952: recipe for target 'all' failed
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory '/usr/ports/net/ocserv/work/ocserv-0.11.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

'MAKE_JOBS_UNSAFE=yes' has effect

In D5890#126116, @cpm_fbsd.es wrote:

'MAKE_JOBS_UNSAFE=yes' has effect

Ok, then it would be appropriate to mention it in the commit message like this (you can use triple backticks for code quotes here):

- Update to 0.11.1 release
- Convert LICENSE= "GPLxx # or later" to "GPLxx+"
- Add dependency on libev
- Regenerate patches
- Add MAKE_JOBS_UNSAFE; port attempts to modify man page before generation
  sed: ocpasswd.8: No such file or directory

Changelog:  http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003551.html

Approved by: junovitch (mentor)
Differential Revision: D5890
In D5890#126114, @cpm_fbsd.es wrote:

I'm working in a patch to submit upstream which fix the invalid fd. Also, I'm in contact with the ocserv developer.

Perfect. Once we factor in a plan to address the runtime issue I'll mark this approved. Keep up the good work.

In D5890#126116, @cpm_fbsd.es wrote:

'MAKE_JOBS_UNSAFE=yes' has effect

Ok, then it would be appropriate to mention it in the commit message like this (you can use triple backticks for code quotes here):

- Update to 0.11.1 release
- Convert LICENSE= "GPLxx # or later" to "GPLxx+"
- Add dependency on libev
- Regenerate patches
- Add MAKE_JOBS_UNSAFE; port attempts to modify man page before generation
  sed: ocpasswd.8: No such file or directory

Changelog:  http://lists.infradead.org/pipermail/openconnect-devel/2016-March/003551.html

Approved by: junovitch (mentor)
Differential Revision: D5890

Understood!

In D5890#126114, @cpm_fbsd.es wrote:

I'm working in a patch to submit upstream which fix the invalid fd. Also, I'm in contact with the ocserv developer.

Perfect. Once we factor in a plan to address the runtime issue I'll mark this approved. Keep up the good work.

The following patch fixes the bad file descriptor that prevents ocserv running in the background.

--- src/main.c.orig	2016-03-06 11:14:35 UTC
+++ src/main.c
@@ -77,7 +77,7 @@ static void listen_watcher_cb (EV_P_ ev_
 
 int syslog_open = 0;
 sigset_t sig_default_set;
-struct ev_loop *loop;
+struct ev_loop *loop = NULL;
 
 /* EV watchers */
 ev_io ctl_watcher;
@@ -147,8 +147,9 @@ int y;
 #elif defined(IP_RECVDSTADDR) /* *BSD */
 	if (family == AF_INET) {
 		y = 1;
-		if (setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR,
-			       (const void *)&y, sizeof(y)) < 0)
+        if (family == AF_INET &&
+            setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR,
+                (const void *)&y, sizeof(y)) < 0)
 			perror("setsockopt(IP_RECVDSTADDR) failed");
 	}
 #endif
@@ -661,13 +662,15 @@ void clear_lists(main_server_st *s)
 	ctl_handler_deinit(s);
 	main_ban_db_deinit(s);
 
-	/* clear libev state */
-	ev_io_stop (loop, &ctl_watcher);
-	ev_io_stop (loop, &sec_mod_watcher);
-	ev_child_stop (loop, &child_watcher);
-	ev_timer_stop(loop, &maintainance_watcher);
-	/* free memory by the event loop */
-	ev_loop_destroy (loop);
+	if (loop) {
+		/* clear libev state */
+		ev_io_stop (loop, &ctl_watcher);
+		ev_io_stop (loop, &sec_mod_watcher);
+		ev_child_stop (loop, &child_watcher);
+		ev_timer_stop(loop, &maintainance_watcher);
+		/* free memory by the event loop */
+		ev_loop_destroy (loop);
+	}
 }
 
 /* A UDP fd will not be forwarded to worker process before this number of
@@ -1165,12 +1168,6 @@ int main(int argc, char** argv)
 
 	memset(&creds, 0, sizeof(creds));
 
-	loop = EV_DEFAULT;
-	if (loop == NULL) {
-		fprintf(stderr, "could not initialise libev\n");
-		exit(1);
-	}
-
 	/* main pool */
 	main_pool = talloc_init("main");
 	if (main_pool == NULL) {
@@ -1253,6 +1250,12 @@ int main(int argc, char** argv)
 		exit(1);
 	}
 
+	loop = EV_DEFAULT;
+	if (loop == NULL) {
+		fprintf(stderr, "could not ititialise libev\n");
+		exit(1);
+	}
+
 	mslog(s, NULL, LOG_INFO, "initialized %s", PACKAGE_STRING);
 
 	/* chdir to our chroot directory, to allow opening the sec-mod
cpm updated this object.
cpm edited edge metadata.
cpm added a reviewer: pi.
pi edited edge metadata.

cpm send me a shorter patch which would fix the run-time problem as well.

I tested it, it works. From my point of view it can be updated.

This revision is now accepted and ready to land.Apr 16 2016, 1:34 PM

Is there something wrong with the upstream on this?

At least right now we can fetch from distcache but we will immediately break the port if we update right now.

=> ocserv-0.11.1.tar.xz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch ftp://ftp.infradead.org/pub/ocserv/ocserv-0.11.1.tar.xz
fetch: ftp://ftp.infradead.org/pub/ocserv/ocserv-0.11.1.tar.xz: Protocol error
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/ocserv-0.11.1.tar.xz
fetch: http://distcache.FreeBSD.org/ports-distfiles/ocserv-0.11.1.tar.xz: Not Found
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.

Once we can actually fetch it, the update, patch to handle the runtime regression in the new version and commit message all look fine.

This revision was automatically updated to reflect the committed changes.