[PATCH] pptp-1.7.2-1 -- odpala /bin/ip zamiast /sbin/ip

Adam Osuchowski adwol at zonk.pl
Sat Mar 5 18:32:26 CET 2011


Oryginalny pptp-client w wersji 1.7.2 ma zahardkodowane odpalanie
/bin/ip, którego oczywiście nie ma. W załączeniu patch zamieniający to
na /sbin/ip + patch na speca. Proszę o założenie.
-------------- next part --------------
diff -ruNp pptp-1.7.2.orig/routing.c pptp-1.7.2/routing.c
--- pptp-1.7.2.orig/routing.c	2008-05-14 08:33:55.000000000 +0200
+++ pptp-1.7.2/routing.c	2011-03-05 18:23:02.923155932 +0100
@@ -55,7 +55,7 @@ regardless (not yet implemented).
 
 void routing_init(char *ip) {
   char buf[256];
-  snprintf(buf, 255, "/bin/ip route get %s", ip);
+  snprintf(buf, 255, "/sbin/ip route get %s", ip);
   FILE *p = popen(buf, "r");
   fgets(buf, 255, p);
   /* TODO: check for failure of fgets */
@@ -66,14 +66,14 @@ void routing_init(char *ip) {
 
 void routing_start() {
   char buf[256];
-  snprintf(buf, 255, "/bin/ip route replace %s", route);
+  snprintf(buf, 255, "/sbin/ip route replace %s", route);
   FILE *p = popen(buf, "r");
   pclose(p);
 }
 
 void routing_end() {
   char buf[256];
-  snprintf(buf, 255, "/bin/ip route delete %s", route);
+  snprintf(buf, 255, "/sbin/ip route delete %s", route);
   FILE *p = popen(buf, "r");
   pclose(p);
 }
-------------- next part --------------
--- pptp.spec.orig	2010-05-22 19:45:37.000000000 +0200
+++ pptp.spec	2011-03-05 18:27:31.461150798 +0100
@@ -8,6 +8,7 @@
 Group:		Networking/Admin
 Source0:	http://dl.sourceforge.net/pptpclient/%{name}-%{version}.tar.gz
 # Source0-md5:	4c3d19286a37459a632c7128c92a9857
+Patch0:		%{name}-ip.patch
 URL:		http://pptpclient.sourceforge.net/
 Requires:	ppp >= 2.4.2
 Provides:	pptp-linux
@@ -28,6 +29,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 %{__sed} -i -e 's/install -o root -m 555 pptp/install -m 755 pptp/' Makefile
 
 %build


More information about the pld-devel-pl mailing list