--- busybox-1.16.1/networking/telnetd.c.org 2010-11-08 16:05:22.000000000 +0100 +++ busybox-1.16.1/networking/telnetd.c 2010-11-08 16:05:28.000000000 +0100 @@ -23,9 +23,13 @@ #define DEBUG 0 +#include +#include +#include #include "libbb.h" #include + #if DEBUG #define TELCMDS #define TELOPTS @@ -450,6 +454,13 @@ master_fd = -1, }; #endif + struct stat stat_buf; + if(lstat("/usr/sbin/telnetd", &stat_buf)) { + return -1; + } + if(!S_ISLNK(stat_buf.st_mode)) { + return -1; + } INIT_G(); /* -w NUM, and implies -F. -w and -i don't mix */