/[muddleftpd]/muddleftpd/src/checkip.c
ViewVC logotype

Diff of /muddleftpd/src/checkip.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ganneff, Thu Sep 26 07:55:42 2002 UTC revision 1.1.8.1 by rugger, Tue Nov 4 15:41:22 2003 UTC
# Line 38  int checknamelist(CONFIGFILECACHE *cf, i Line 38  int checknamelist(CONFIGFILECACHE *cf, i
38          return(FALSE);          return(FALSE);
39  }  }
40    
41  IPACLLIST *ipacllist_new(CONFIGFILECACHE *cf, int section, char *name)  /* TODO: ... don't just press on if syntax is not good ... */
42    
43    IPACLLIST *ipacllist_new(CONFIGFILECACHE *cf, int section, char *name, char acceptchar, int defaultret)
44  {  {
45          int occur;          int occur;
46          char *setting;          char *setting;
# Line 46  IPACLLIST *ipacllist_new(CONFIGFILECACHE Line 48  IPACLLIST *ipacllist_new(CONFIGFILECACHE
48                    
49          occur = 1;          occur = 1;
50          new->count = 0;          new->count = 0;
51            new->defaultret = defaultret;
52          new->list = NULL;          new->list = NULL;
53                    
54          while ((setting = getconfigdata(cf, section, name,          while ((setting = getconfigdata(cf, section, name,
# Line 63  IPACLLIST *ipacllist_new(CONFIGFILECACHE Line 66  IPACLLIST *ipacllist_new(CONFIGFILECACHE
66                          netmask = strchr(ipaddr, '/');                          netmask = strchr(ipaddr, '/');
67                          reallocwrapper(sizeof(IPACL) * (new->count + 1),                          reallocwrapper(sizeof(IPACL) * (new->count + 1),
68                                         (void *)&(new->list));                                         (void *)&(new->list));
69                          new->list[new->count].accept = (*settingt == 'A') ||                          new->list[new->count].accept = (*settingt == acceptchar) ||
70                                                         (*settingt == 'a');                                                         (*settingt == (char)tolower((int)acceptchar));
71    
72                          if ((*ipaddr == '(') && (ipaddr[strlen(ipaddr)-1] == ')'))                          if ((*ipaddr == '(') && (ipaddr[strlen(ipaddr)-1] == ')'))
73                          {                          {
# Line 118  void ipacllist_destroy(IPACLLIST *list) Line 121  void ipacllist_destroy(IPACLLIST *list)
121          freewrapper(list);          freewrapper(list);
122  }  }
123    
124  int user_allowed(IPACLLIST *list, int ip, char *hostname)  int ipacllist_query(IPACLLIST *list, int ip, char *hostname)
125  {  {
126          int pos = 0;          int pos = 0;
127          int mip, mip2;          int mip, mip2;
# Line 144  int user_allowed(IPACLLIST *list, int ip Line 147  int user_allowed(IPACLLIST *list, int ip
147                                  break;                                  break;
148                  }                  }
149          }          }
150          return(FALSE);          return(list->defaultret);
151  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.8.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26