Re: [Toybox] PATCH telnetd
Hi. My real situation is like this : 1. running telnetd on embedded board. 2. running client on windows/linux 3. client works something on connection such as getting big file with tftp or testing system with automated script for a long time. 4. client is killed abnormally, for example kill telnet process 5. At this time, telnetd goes infinite loop and cpu occupation almost becomes 90%. I think this connection should be closed completely and telnetd should hold for next connection using select(). but select() returns 1, and it means a socket fd has some changes. That is telnetd does not catch client already killed. (Unfortunatly, PC running telnetd can't reproduce this issue. I recommended to check any embedded board if you have) As I know, It is abnormally disconnected network and should handle. The only ambigous thing in the patch is the max fail count. At first, set max fail count as 10, but it is not standard I think. Thanks. Message: 5 Date: Tue, 17 Mar 2015 09:59:18 -0400 From: Rich Felker dal...@libc.org To: toybox@lists.landley.net Subject: Re: [Toybox] PATCH telnetd Message-ID: 20150317135918.gy23...@brightrain.aerifal.cx Content-Type: text/plain; charset=utf-8 On Tue, Mar 17, 2015 at 07:31:12PM +0900, ??? wrote: Hi. All I found an issue of telnetd that it loops infinitely when client disconnected abnormally on working. like client is killed by outside. On embedded system, this issue make that cpu occupation goes high. In this case : select() returns 1, means socket fd has something changes. but, read()/write() after select() gets an error because client already disconnected. read does not return an error; it returns 0, indicating EOF. attached patch help prevent this issue. plz, check. The patch as written does not seem correct. There is no justification for killing the child process with SIGKILL; this is a very bad practice and precludes any sort of cleanup it may need to do. Unless it's specifically written not to, the child running in the telnet session should automatically terminate when it loses its controlling terminal, which should happen when the telnet session exits. Can you clarify what exactly is going wrong for you? Rich ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] PATCH telnetd
Hi. All I found an issue of telnetd that it loops infinitely when client disconnected abnormally on working. like client is killed by outside. On embedded system, this issue make that cpu occupation goes high. In this case : select() returns 1, means socket fd has something changes. but, read()/write() after select() gets an error because client already disconnected. attached patch help prevent this issue. plz, check. 0001-telnetd-handling-read-write-fail-when-client-disconn.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] Regarding -m option of mknod
Hi all. Toybox's mknod have no -m option while busybox and coreutil have. Can anyone tell me the reason? Or is it just a implementation miss? Thank you! ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] patch mdev
Hi. As internal needs, Ranjan Kumar (ranjankumar@gmail.com) added hotplug feature into mdev. Highlight points are: 1. mdev is extended to support hotplug feature. 2. sequence file support is yet to do. 0001-mdev-add-hotplugin-feature.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] Regarding mkflags.c
Hi. On cross compile, I found an abnormal operation of make.sh. In a cross compile system, mkflags excutable gives wrong result code although completely created generated/flags.h So, it goes to exit 1. line 177 - 178 in scripts/make.sh - *done | sort -s | sed -n 's/ A / /;t pair;h;s/\([^ ]*\).*/\1 /;x;b single;:pair;h;n;:single;s/[^ ]* B //;H;g;s/\n/ /;p' |\generated/mkflags generated/flags.h || exit 1* - Because above, I analyzed mkflags.c to find the reason why mkflags gives wrong result code. The result is that main() returns nothing if it normally exits. main() function has int return type and it affacts an build process on a system. plz, have a look. diff --git a/scripts/mkflags.c b/scripts/mkflags.c index 454fc03..1ae4c40 100644 --- a/scripts/mkflags.c +++ b/scripts/mkflags.c @@ -206,4 +206,5 @@ int main(int argc, char *argv[]) if (i0) return 1; out += i; } + return 0; } 0001-scripts-mkflags.c-main-function-need-return-0-if-nor.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] Patch : syslogd
Hi. I added error handling code in write_rotate(). I think that it is better to check tf-logfd before doing truncate()/write() and getting error. From 5e24e65d3abfd78e5405b81690d6ada4260cca4e Mon Sep 17 00:00:00 2001 From: Hyejin Kim hj8...@gmail.com Date: Mon, 2 Mar 2015 14:27:00 +0900 Subject: [PATCH] syslogd : check return value when opening file --- toys/pending/syslogd.c | 4 1 file changed, 4 insertions(+) diff --git a/toys/pending/syslogd.c b/toys/pending/syslogd.c index 7fb297f..41d655d 100644 --- a/toys/pending/syslogd.c +++ b/toys/pending/syslogd.c @@ -300,6 +300,10 @@ static int write_rotate(struct logfile *tf, int len) unlink(tf-filename); close(tf-logfd); tf-logfd = open(tf-filename, O_CREAT | O_WRONLY | O_APPEND, 0666); + if (tf-logfd 0) { + perror_msg(can't open %s, tf-filename); + return -1; +} } ftruncate(tf-logfd, 0); } -- 1.9.1 0001-syslogd-check-return-value-when-opening-file.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] Regarding ifconfig
Hi. I have a question about ifconfig. Nov 30 on 2013, Rob deleted trailers and dynamic options because they are dead fields unused by linux kernel. But, NOTRAILERS and DYNAMIC string still exist in the code, line from 212 to 214 in ifconfig.c I think these also should be removed if really dead fields. Thanks. ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net
[Toybox] patch mktemp
Hello. On my board testing, encountered some behavior of mktemp. The command was malfunctioning with longopts (like --diectory and --tmpdir). Again the return status of the command was not correct in some cases like: ./toybox mktemp -p Filename. Here filename is wrong argument (correct argument is dirname). please have a look. 0001-patch-mktemp-fix-to-match-longopt-with-correct-opt-a.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net