On Fri, Jun 5, 2009 at 3:58 PM, Stefan Seyfried<[email protected]> wrote:
> On Fri, Jun 05, 2009 at 03:35:10PM +0200, Denys Vlasenko wrote:
>> I see. Still, in order to get the bad behavior you described,
>> you ought to specify *both* -v and -S:
>
> Yes. Actually, I needd "-vv -S", because i needed "very verbose logging
> to syslog". And the only way to up the verbosity is to use "-vv".
>
>> in other words, user makes a mistake. If he runs ftpd from inetd,
>> he should not specify -v. If he runs ftpd under tcpsvd, it's ok.
>
> Now that the other bug is fixed, I don't care that much anymore (I found
> this one when trying to debug the missing "unkown command" case).
>
> Hm, maybe I should hack a "-SS" option to increase verbosity for the syslog
> case...
Please try attached patch.
--
vda
diff -d -urpN busybox.8/networking/ftpd.c busybox.9/networking/ftpd.c
--- busybox.8/networking/ftpd.c 2009-06-04 18:58:25.000000000 +0200
+++ busybox.9/networking/ftpd.c 2009-06-05 20:40:03.000000000 +0200
@@ -1095,17 +1095,19 @@ int ftpd_main(int argc UNUSED_PARAM, cha
#endif
{
unsigned abs_timeout;
+ unsigned verbose_S;
smallint opts;
INIT_G();
abs_timeout = 1 * 60 * 60;
+ verbose_S = 0;
G.timeout = 2 * 60;
- opt_complementary = "t+:T+:vv";
+ opt_complementary = "t+:T+:vv:SS";
#if BB_MMU
- opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose);
+ opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
#else
- opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose);
+ opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
if (opts & (OPT_l|OPT_1)) {
/* Our secret backdoor to ls */
/* TODO: pass -n too? */
@@ -1116,6 +1118,8 @@ int ftpd_main(int argc UNUSED_PARAM, cha
return ls_main(argc, argv);
}
#endif
+ if (G.verbose < verbose_S)
+ G.verbose = verbose_S;
if (abs_timeout | G.timeout) {
if (abs_timeout == 0)
abs_timeout = INT_MAX;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox