add a simple maintenance tool for kernel config files
[openwrt.git] / package / busybox / patches / 110-telnetd.patch
index e95757e..8ebb6de 100644 (file)
@@ -1,17 +1,16 @@
-diff -urN busybox-1.00-pre8/networking/telnetd.c busybox-1.00-pre8-openwrt/networking/telnetd.c
---- busybox-1.00-pre8/networking/telnetd.c     2004-02-22 03:45:57.000000000 -0600
-+++ busybox-1.00-pre8-openwrt/networking/telnetd.c     2004-03-05 01:32:57.000000000 -0600
-@@ -44,6 +44,8 @@
+diff -ruN busybox-1.2.0-old/networking/telnetd.c busybox-1.2.0-new/networking/telnetd.c
+--- busybox-1.2.0-old/networking/telnetd.c     2006-07-01 00:42:02.000000000 +0200
++++ busybox-1.2.0-new/networking/telnetd.c     2006-07-31 10:52:30.000000000 +0200
+@@ -44,6 +44,7 @@
  #include <arpa/telnet.h>
  #include <ctype.h>
  #include <sys/syslog.h>
 +#include <net/if.h>
  #include <arpa/telnet.h>
  #include <ctype.h>
  #include <sys/syslog.h>
 +#include <net/if.h>
-+
  
  #include "busybox.h"
  
  
  #include "busybox.h"
  
-@@ -384,11 +386,13 @@
-       int portnbr = 23;
+@@ -391,11 +392,13 @@
+       struct in_addr bind_addr = { .s_addr = 0x0 };
  #endif /* CONFIG_FEATURE_TELNETD_INETD */
        int c;
 +      char *interface_name = NULL;
  #endif /* CONFIG_FEATURE_TELNETD_INETD */
        int c;
 +      char *interface_name = NULL;
@@ -19,35 +18,34 @@ diff -urN busybox-1.00-pre8/networking/telnetd.c busybox-1.00-pre8-openwrt/netwo
        static const char options[] =
  #ifdef CONFIG_FEATURE_TELNETD_INETD
 -              "f:l:";
        static const char options[] =
  #ifdef CONFIG_FEATURE_TELNETD_INETD
 -              "f:l:";
--#else /* CONFIG_EATURE_TELNETD_INETD */
--              "f:l:p:";
 +              "i:f:l:";
 +              "i:f:l:";
-+#else /* CONFIG_FEATURE_TELNETD_INETD */
-+              "i:f:l:p:";
+ #else /* CONFIG_EATURE_TELNETD_INETD */
+-              "f:l:p:b:";
++              "i:f:l:p:b:";
  #endif /* CONFIG_FEATURE_TELNETD_INETD */
        int maxlen, w, r;
  
  #endif /* CONFIG_FEATURE_TELNETD_INETD */
        int maxlen, w, r;
  
-@@ -403,6 +407,9 @@
+@@ -410,6 +413,9 @@
                        case 'f':
                        case 'f':
-                               issuefile = strdup (optarg);
+                               issuefile = optarg;
                                break;
                                break;
-+                        case 'i':
-+                                interface_name = strdup(optarg);
-+                                break;
++                      case 'i':
++                              interface_name = strdup(optarg);
++                              break;
                        case 'l':
                        case 'l':
-                               loginpath = strdup (optarg);
+                               loginpath = optarg;
                                break;
                                break;
-@@ -442,6 +449,13 @@
-       sa.sin_family = AF_INET;
-       sa.sin_port = htons(portnbr);
+@@ -459,6 +465,13 @@
+       sa.sin_addr = bind_addr;
+ #endif
  
  
-+        /* Set it to listen on the specified interface */
-+        if (interface_name) {
-+                strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
-+                (void)setsockopt(master_fd, SOL_SOCKET,
-+                                SO_BINDTODEVICE, &interface, sizeof(interface));
-+        }
-+
-       if (bind(master_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
-               bb_perror_msg_and_die("bind");
-       }
++      /* Set it to listen on the specified interface */
++      if (interface_name) {
++              strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
++              (void)setsockopt(master_fd, SOL_SOCKET,
++                              SO_BINDTODEVICE, &interface, sizeof(interface));
++      }
++ 
+       bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
+       bb_xlisten(master_fd, 1);
+       bb_xdaemon(0, 0);
This page took 0.029508 seconds and 4 git commands to generate.