]> git.pld-linux.org Git - packages/fwtk.git/blob - fwtk-ftp-plugin.patch
- tabs in preamble
[packages/fwtk.git] / fwtk-ftp-plugin.patch
1 diff -urN fwtk.orig/ftp-gw/ftp-gw.c fwtk/ftp-gw/ftp-gw.c
2 --- fwtk.orig/ftp-gw/ftp-gw.c   Fri Jul  9 12:24:28 1999
3 +++ fwtk/ftp-gw/ftp-gw.c        Fri Jul  9 12:29:46 1999
4 @@ -57,6 +58,7 @@
5  
6  static Cfg                     *confp;
7  static char                    **validests = (char **)0;
8 +static  char                    *plugdest = (char *)0;
9  static int                     blockinput = 0;
10  static int                     blockoutput = 0;
11  
12 @@ -519,6 +521,8 @@
13  {
14         int     dests = 0;
15  
16 +       if(plugdest != (char *)0) {
17 +               syslog(LLEV,"fwtkcfgerr: config line %d: cannot specify both -plug-to and -dest",c);        } else {
18         if(validests == (char **)0)
19                 validests = (char **)malloc(sizeof(char *) * 2);
20         else {
21 @@ -530,10 +534,31 @@
22                 return;
23         validests[dests] = v;
24         validests[dests + 1] = (char *)0;
25 + }
26  }
27  
28 -
29 -
30 +static  void
31 +accept_setplug(v,c)
32 +char    *v;
33 +int     c;
34 +{
35 +  if(plugdest == (char *)0) {
36 +    if(validests == (char **)0) {
37 +      if(gethostbyname(v) == (struct hostent *)0) {
38 +        syslog(LLEV,"fwtkcfgerr: config line %d: invalid -plug-to destination: %.100s",c,v);
39 +      }
40 +      else {
41 +        plugdest = v;
42 +      }
43 +    }
44 +    else {
45 +      syslog(LLEV,"fwtkcfgerr: config line %d: cannot specify both -plug-to and -dest",c);
46 +    }
47 +  }
48 +  else {
49 +    syslog(LLEV,"fwtkcfgerr: config line %d: cannot specify multiple -plug-to destinations",c);
50 +  }
51 +}
52  
53  acceptrule(c)
54  Cfg    *c;
55 @@ -583,6 +608,8 @@
56                         op = accept_setdeny;
57                 if(!strcmp(c->argv[x],"-dest"))
58                         op = accept_setdest;
59 +               if(!strcmp(c->argv[x],"-plug-to"))
60 +                       op = accept_setplug;
61                 if(op == 0) {
62                         syslog(LLEV,"fwtkcfgerr: bad option line %d: %.100s",c->ln,c->argv[x]);
63                         return(1);
64 @@ -640,6 +667,10 @@
65         }
66  
67  
68 +       if(plugdest != (char *)0) {
69 +         dest = plugdest;
70 +         user = av[1];
71 +       } else {
72         if((p = rindex(av[1],'@')) != (char *)0) {
73                 *p++ = '\0';
74                 dest = p;
75 @@ -651,6 +682,7 @@
76                         dest = av[1];
77                 } else
78                         return(sayn(0,noad,sizeof(noad)-1));
79 +       }
80         }
81  
82         if(*dest == '\0')
This page took 0.087043 seconds and 3 git commands to generate.