]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/ppp/ppp-2.4.3/pppd-resolv-varrun.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / ppp / ppp-2.4.3 / pppd-resolv-varrun.patch
1
2 #
3 # Patch managed by http://www.holgerschurig.de/patcher.html
4 #
5
6 --- ppp-2.4.3/pppd/ipcp.c~pppd-resolv-varrun.patch
7 +++ ppp-2.4.3/pppd/ipcp.c
8 @@ -55,6 +55,8 @@
9  #include <sys/socket.h>
10  #include <netinet/in.h>
11  #include <arpa/inet.h>
12 +#include <sys/stat.h>
13 +#include <unistd.h>
14  
15  #include "pppd.h"
16  #include "fsm.h"
17 @@ -2032,6 +2034,14 @@
18      u_int32_t peerdns1, peerdns2;
19  {
20      FILE *f;
21 +    struct stat dirinfo;
22 +
23 +    if(stat(_PATH_OUTDIR, &dirinfo)) {
24 +        if(mkdir(_PATH_OUTDIR, 0775)) {
25 +            error("Failed to create directory %s: %m", _PATH_OUTDIR);
26 +            return;
27 +        }
28 +    }
29  
30      f = fopen(_PATH_RESOLV, "w");
31      if (f == NULL) {
32 --- ppp-2.4.3/pppd/pathnames.h~pppd-resolv-varrun.patch
33 +++ ppp-2.4.3/pppd/pathnames.h
34 @@ -29,7 +29,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"