On macppc, `wiresep-keygen tun0' would busy-loop forever.

OK?

I'll send a proper git patch upstream.


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/wiresep/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile    7 Apr 2020 17:45:32 -0000       1.5
+++ Makefile    20 Apr 2020 20:27:49 -0000
@@ -3,6 +3,7 @@
 COMMENT =              privilege separated implementation of WireGuard
 
 DISTNAME =             wiresep-0.11.1
+REVISION =             0
 MASTER_SITES =         https://netsend.nl/wiresep/archive/
 
 CATEGORIES =           net security
Index: patches/patch-master_c
===================================================================
RCS file: patches/patch-master_c
diff -N patches/patch-master_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-master_c      20 Apr 2020 20:25:05 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+getopt(3) returns int not char;  fixes endless loop on platforms where char
+is unsigned (macppc).
+
+Index: master.c
+--- master.c.orig
++++ master.c
+@@ -133,7 +133,8 @@ main(int argc, char **argv)
+       int configtest, foreground, stdopen, masterport, stat;
+       pid_t pid;
+       const char *errstr;
+-      char c, *eargs[4], *eenv[1], *logfacilitystr, *oldprogname;
++      char *eargs[4], *eenv[1], *logfacilitystr, *oldprogname;
++      int c;
+ 
+       /* should endup in a configure script */
+       if (sizeof(struct msgwginit) != 148)
Index: patches/patch-wiresep-keygen_c
===================================================================
RCS file: patches/patch-wiresep-keygen_c
diff -N patches/patch-wiresep-keygen_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-wiresep-keygen_c      20 Apr 2020 20:25:03 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+getopt(3) returns int not char;  fixes endless loop on platforms where char
+is unsigned (macppc).
+
+Index: wiresep-keygen.c
+--- wiresep-keygen.c.orig
++++ wiresep-keygen.c
+@@ -121,7 +121,7 @@ main(int argc, char **argv)
+       uint8_t privkey[X25519_KEY_LENGTH], pubkey[X25519_KEY_LENGTH];
+       char b64privkey[46], b64pubkey[46];
+       int i, fd, wd, ret;
+-      char c;
++      int c;
+       char *keypath, *presharedkey, *filename;
+ 
+       presharedkey = NULL;

Reply via email to