summaryrefslogtreecommitdiffstats
path: root/testing/pptpd/pptpd.patch
blob: 3b4522dc76caba6174b3e4fb9a26e2f09946ce6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- pptpd-1.3.4/Makefile.am
+++ pptpd-1.3.4-orig/Makefile.am
@@ -11,7 +11,8 @@
 ##  warning with -Wmissing-prototypes).
 ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
 ##  aren't up to it).
-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
+OPTFLAGS=-O2
+CFLAGS = $(OPTFLAGS) -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
 #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
 #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
 
--- pptpd-1.3.4/bcrelay.c
+++ pptpd-1.3.4-orig/bcrelay.c
@@ -381,12 +381,12 @@
                         return 1;
                 }
   }
-  if (ifin == "") {
+  if (!strlen(ifin)) {
        syslog(LOG_INFO,"Incoming interface required!");
        showusage(argv[0]);
        _exit(1);
   }
-  if (ifout == "" && ipsec == "") {
+  if (!strlen(ifout) && !strlen(ipsec)) {
        syslog(LOG_INFO,"Listen-mode or outgoing or IPsec interface required!");
        showusage(argv[0]);
        _exit(1);
@@ -870,7 +870,7 @@
     // IPSEC tunnels are a fun one.  We must change the destination address
     // so that it will be routed to the correct tunnel end point.
     // We can define several tunnel end points for the same ipsec interface.
-    } else if (ipsec != "" && strncmp(ifs.ifc_req[i].ifr_name, "ipsec", 5) == 0) {
+    } else if (strlen(ipsec) && strncmp(ifs.ifc_req[i].ifr_name, "ipsec", 5) == 0) {
       if (strncmp(ifs.ifc_req[i].ifr_name, ipsec, 6) == 0) {
         struct hostent *hp = gethostbyname(ipsec+7);
         ioctl(s, SIOCGIFINDEX, &ifs.ifc_req[i]);
--- pptpd-1.3.4/plugins/Makefile
+++ pptpd-1.3.4-orig/plugins/Makefile
@@ -3,7 +3,7 @@
 CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
 LDFLAGS	= -shared
 LDADD   = -lutil
-INSTALL	= install -o root
+INSTALL	= install
 prefix  = /usr/local
 
 PLUGINS = pptpd-logwtmp.so
@@ -18,7 +18,7 @@
 %.so: %.c
 	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ $(LDADD)
 
-LIBDIR	?= $(DESTDIR)$(prefix)/lib/pptpd
+LIBDIR	= $(DESTDIR)$(prefix)/lib/pptpd
 
 install: $(PLUGINS)
 	$(INSTALL) -d $(LIBDIR)
--- pptpd-1.3.4/plugins/pptpd-logwtmp.c
+++ pptpd-1.3.4-orig/plugins/pptpd-logwtmp.c
@@ -12,7 +12,7 @@
 #include <unistd.h>
 #include <utmp.h>
 #include <string.h>
-#include "pppd.h"
+#include <pppd/pppd.h>
 
 char pppd_version[] = VERSION;