]> git.pld-linux.org Git - packages/proftpd.git/commitdiff
- fix for previous patches...
authorPaweł Gołaszewski <blues@pld-linux.org>
Sun, 21 Oct 2001 23:38:30 +0000 (23:38 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    proftpd-v6_fix.patch -> 1.1

proftpd-v6_fix.patch [new file with mode: 0644]

diff --git a/proftpd-v6_fix.patch b/proftpd-v6_fix.patch
new file mode 100644 (file)
index 0000000..249eb2c
--- /dev/null
@@ -0,0 +1,81 @@
+--- ./contrib/mod_sql.c.org    Mon Oct 22 01:20:30 2001
++++ ./contrib/mod_sql.c        Mon Oct 22 01:21:48 2001
+@@ -1526,7 +1526,7 @@
+     break;
+   case 'a':
+     argp = arg;
+-    sstrncpy(argp, inet_ntoa(*session.c->remote_ipaddr), sizeof(arg));
++    sstrncpy(argp, INET_NTOA(session.c->remote_ipaddr), sizeof(arg));
+     break;
+   case 'l':
+     argp = arg;
+--- ./src/inet.c.org   Mon Oct 22 01:22:33 2001
++++ ./src/inet.c       Mon Oct 22 01:29:14 2001
+@@ -211,60 +211,27 @@
+  * memory.
+  */
+-char *inet_ascii(pool *pool, p_in_addr_t *addr)
++char *inet_ascii(pool *pool, struct sockaddr_storage *addr)
+ {
+   char *res = NULL;
+-  if((res = inet_ntoa(*addr)) != NULL)
++  if((res = INET_NTOA(addr)) != NULL)
+     res = pstrdup(pool,res);
+   return res;
+ }
+ /* Given an ip addresses, return the FQDN */
+-char *inet_getname(pool *pool, p_in_addr_t *addr)
++char *inet_getname(pool *pool, struct sockaddr_storage *addr)
+ {
++      char name[1025] = {'\0'};
+   char *res = NULL;
+   char **checkaddr;
+-  struct hostent *hptr_rev = NULL, *hptr_forw = NULL;
+   static char *res_cache = NULL;
+-  static p_in_addr_t *addr_cache = NULL;
+-  if(reverse_dns) {
+-    if(res_cache && addr_cache && addr_cache->s_addr == addr->s_addr) {
+-      res = pstrdup(pool, res_cache);
+-      return inet_validate(res);
+-    }
+-    
+-    if((hptr_rev = gethostbyaddr((const char *)addr,
+-                                 sizeof(p_in_addr_t), AF_INET)) != NULL) {
+-      if((hptr_forw = gethostbyname(hptr_rev->h_name)) != NULL) {
+-        for(checkaddr = hptr_forw->h_addr_list; *checkaddr; ++checkaddr) {
+-          if(((p_in_addr_t*)(*checkaddr))->s_addr == addr->s_addr) {
+-            res = pstrdup(pool, hptr_rev->h_name);
+-            break;
+-          }
+-        }
+-      }
+-    }
+-  }
+-  
+-  if(!res)
+-    res = pstrdup(pool, inet_ntoa(*addr));
+- 
+-  if(reverse_dns) {
+-    /* cache the result */
+-    if(!addr_cache)
+-      addr_cache = malloc(sizeof(p_in_addr_t));
+-
+-    if(addr_cache)
+-      memcpy(addr_cache, addr, sizeof(p_in_addr_t));
+-
+-    if(res_cache)
+-      free(res_cache);
+-
+-    res_cache = strdup(res);
+-  }
++  getnameinfo((struct sockaddr *)addr, sizeof(struct sockaddr_storage),
++                name, sizeof(name), NULL, 0, 0);
++  res = pstrdup(pool, name);
+   
+   return inet_validate(res);
+ }
This page took 0.045467 seconds and 4 git commands to generate.