diff options
Diffstat (limited to 'meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch')
| -rw-r--r-- | meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch b/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch new file mode 100644 index 0000000000..c4e61fdd28 --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | The patch comes from OpenEmbedded | ||
| 2 | Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com> | ||
| 3 | |||
| 4 | diff -ruN ppp-2.4.5-orig/pppd/ipcp.c ppp-2.4.5/pppd/ipcp.c | ||
| 5 | --- ppp-2.4.5-orig/pppd/ipcp.c 2010-06-30 15:51:12.050166398 +0800 | ||
| 6 | +++ ppp-2.4.5/pppd/ipcp.c 2010-06-30 17:02:33.930393283 +0800 | ||
| 7 | @@ -55,6 +55,8 @@ | ||
| 8 | #include <sys/socket.h> | ||
| 9 | #include <netinet/in.h> | ||
| 10 | #include <arpa/inet.h> | ||
| 11 | +#include <sys/stat.h> | ||
| 12 | +#include <unistd.h> | ||
| 13 | |||
| 14 | #include "pppd.h" | ||
| 15 | #include "fsm.h" | ||
| 16 | @@ -2095,6 +2097,14 @@ | ||
| 17 | u_int32_t peerdns1, peerdns2; | ||
| 18 | { | ||
| 19 | FILE *f; | ||
| 20 | + struct stat dirinfo; | ||
| 21 | + | ||
| 22 | + if(stat(_PATH_OUTDIR, &dirinfo)) { | ||
| 23 | + if(mkdir(_PATH_OUTDIR, 0775)) { | ||
| 24 | + error("Failed to create directory %s: %m", _PATH_OUTDIR); | ||
| 25 | + return; | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | |||
| 29 | f = fopen(_PATH_RESOLV, "w"); | ||
| 30 | if (f == NULL) { | ||
| 31 | diff -ruN ppp-2.4.5-orig/pppd/pathnames.h ppp-2.4.5/pppd/pathnames.h | ||
| 32 | --- ppp-2.4.5-orig/pppd/pathnames.h 2010-06-30 15:51:12.043682063 +0800 | ||
| 33 | +++ ppp-2.4.5/pppd/pathnames.h 2010-06-30 17:03:20.594371055 +0800 | ||
| 34 | @@ -30,7 +30,8 @@ | ||
| 35 | #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." | ||
| 36 | #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" | ||
| 37 | #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" | ||
| 38 | -#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" | ||
| 39 | +#define _PATH_OUTDIR _ROOT_PATH _PATH_VARRUN "/ppp" | ||
| 40 | +#define _PATH_RESOLV _PATH_OUTDIR "/resolv.conf" | ||
| 41 | |||
| 42 | #define _PATH_USEROPT ".ppprc" | ||
| 43 | #define _PATH_PSEUDONYM ".ppp_pseudonym" | ||
