From c9ca0a32745a43eaa6cb6b7b460718de8ccb84f2 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 18 Feb 2008 11:08:33 +0000 Subject: mount: recognize "dirsync" (closes bug 835) mount: sanitize environ if called by non-root *: adjust for slightly different sanitize routine --- networking/nc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'networking/nc.c') diff --git a/networking/nc.c b/networking/nc.c index feb9c5db6..7c2aafaf6 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -44,14 +44,17 @@ int nc_main(int argc, char **argv) while ((opt = getopt(argc, argv, "" USE_NC_SERVER("lp:") USE_NC_EXTRA("w:i:f:e:") )) > 0 ) { - if (ENABLE_NC_SERVER && opt=='l') USE_NC_SERVER(do_listen++); - else if (ENABLE_NC_SERVER && opt=='p') { + if (ENABLE_NC_SERVER && opt=='l') + USE_NC_SERVER(do_listen++); + else if (ENABLE_NC_SERVER && opt=='p') USE_NC_SERVER(lport = bb_lookup_port(optarg, "tcp", 0)); - } - else if (ENABLE_NC_EXTRA && opt=='w') USE_NC_EXTRA( wsecs = xatou(optarg)); - else if (ENABLE_NC_EXTRA && opt=='i') USE_NC_EXTRA( delay = xatou(optarg)); - else if (ENABLE_NC_EXTRA && opt=='f') USE_NC_EXTRA( cfd = xopen(optarg, O_RDWR)); - else if (ENABLE_NC_EXTRA && opt=='e' && optind<=argc) { + else if (ENABLE_NC_EXTRA && opt=='w') + USE_NC_EXTRA( wsecs = xatou(optarg)); + else if (ENABLE_NC_EXTRA && opt=='i') + USE_NC_EXTRA( delay = xatou(optarg)); + else if (ENABLE_NC_EXTRA && opt=='f') + USE_NC_EXTRA( cfd = xopen(optarg, O_RDWR)); + else if (ENABLE_NC_EXTRA && opt=='e' && optind <= argc) { /* We cannot just 'break'. We should let getopt finish. ** Or else we won't be able to find where ** 'host' and 'port' params are -- cgit v1.2.3