OSSP CVS Repository

ossp - Check-in [1804]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1804
Date: 2002-Feb-05 15:56:47 (local)
2002-Feb-05 14:56:47 (UTC)
User:thl
Branch:
Comment: "make check" works again! --operationmode now correctly sets OPERATIONMODE_FAKE and detects internal error when this mandatory option was neither given nor preset through option_register(). Found missing functionality where option_parse_internal() does not fail on syntax errors or unknown options. Corrected --timeout* options in "test.sh".
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_config.c      1.41 -> 1.42     5 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.36 -> 1.37     1 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_option.c      1.11 -> 1.12     1 inserted, 1 deleted
ossp-pkg/lmtp2nntp/test.sh      1.9 -> 1.10     42 inserted, 15 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.41 -> 1.42

--- lmtp2nntp_config.c   2002/02/05 14:14:54     1.41
+++ lmtp2nntp_config.c   2002/02/05 14:56:47     1.42
@@ -637,6 +637,7 @@
             else if (strcasecmp(cp, "feed") == 0)
                 ctx->option_operationmode = OPERATIONMODE_FEED;
             else {
+                ctx->option_operationmode = OPERATIONMODE_FAKE;
                 if (strlen(cp) != 9) {
                     log1(ctx, ERROR, "option --operationmode, invalid length (%s)", cp);
                     throw(0,0,0);
@@ -669,6 +670,10 @@
                 }
             }
         }
+        else {
+            log0(ctx, ERROR, "option --operationmode, is mandatory but neither given nor preset (internal)");
+            throw(0,0,0);
+        }
     }
     catch (ex)
         rethrow;


ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.36 -> 1.37

--- lmtp2nntp_main.c     2002/02/05 10:42:39     1.36
+++ lmtp2nntp_main.c     2002/02/05 14:56:47     1.37
@@ -1531,6 +1531,7 @@
      */
     rcpt = NULL;
     while ((rcpt = argz_next(ctx->msg->azRcpt, ctx->msg->asRcpt, rcpt)) != NULL) {
+        log1(ctx, DEBUG, "ctx->option_operationmode=%d", ctx->option_operationmode);
         if (ctx->option_operationmode == OPERATIONMODE_FAKE) {
                     res.statuscode = ctx->option_operationmodefakestatus;
                     res.dsncode    = ctx->option_operationmodefakedsn;


ossp-pkg/lmtp2nntp/lmtp2nntp_option.c 1.11 -> 1.12

--- lmtp2nntp_option.c   2002/02/05 14:14:54     1.11
+++ lmtp2nntp_option.c   2002/02/05 14:56:47     1.12
@@ -649,7 +649,7 @@
 #endif
 
     //val_apply(o->vo, "", 9, dumper, "vorher" );
-    rc = option_parse_internal(o, argc, argv);
+    rc = option_parse_internal(o, argc, argv); //FIXME should fail for syntax errors and unknown options
     //val_apply(o->vo, "", 9, dumper, "nachher" );
     return rc;
 }


ossp-pkg/lmtp2nntp/test.sh 1.9 -> 1.10

--- test.sh      2002/02/05 14:14:54     1.9
+++ test.sh      2002/02/05 14:56:47     1.10
@@ -16,10 +16,10 @@
 Message-Id: <200108141251.f7ECpmn74812@dev.de.cw.net>
 From: Thomas Lotterer <Thomas.Lotterer@example.com>
 Received: from cw.example.com (cw.example.com [10.1.1.32])
-    by gateway.example.com (8.9.2/8.9.2/$Revision: 1.9 $) with SMTP id NAA08840
+    by gateway.example.com (8.9.2/8.9.2/$Revision: 1.10 $) with SMTP id NAA08840
     for <thomas.lotterer@gateway.example.com>; Mon, 2 Apr 2001 13:20:25 +0200 (MET DST)
 Received: from history (history.example.org [195.143.102.41])
-    by cw.example.com (8.11.0/8.11.0/$Revision: 1.9 $) with ESMTP id f32BKPb12235
+    by cw.example.com (8.11.0/8.11.0/$Revision: 1.10 $) with ESMTP id f32BKPb12235
     for <thomas.lotterer@example.com>; Mon, 2 Apr 2001 13:20:25 +0200
 Received: from example.org (littlemua.example.org [195.143.103.160])
         by history (8.8.8/8.8.8) with ESMTP id LAA12678;
@@ -103,6 +103,10 @@
 RC=`cat ${STDOUT} | egrep 'lmtp2nntp[ ]+[0-9]+\.[0-9]+[ab\.][0-9]+[ ]+\([0-9]+-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-[0-9]+\)' | wc -l`
 if [ ${RC} -ne 1 -o ".`cat ${STDERR}`" != . ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -145,6 +149,10 @@
 if [ 1 -eq `egrep <${STDOUT} -- '--usage'               | wc -l` ]; then RC="${RC}--usage "; fi
 if [ "${RC}" != "-C -D -K -P -a -b -c -d -g -h -i --timeoutlmtpaccept --timeoutlmtpread --timeoutlmtpwrite --timeoutnntpconnect --timeoutnntpread --timeoutnntpwrite -l -m -n -o -r -s -u -v --newsgroup -? --usage " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -152,8 +160,7 @@
 echon "checking whether a valid fake posting succeeds ... "
 prolog
 newmsg
-echo ./lmtp2nntp ${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} ${STDOUT} 2${STDERR} ; RC=$
-./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ; RC=$
+./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ; RC=$
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
 if [ 1 -eq `egrep <${STDOUT} '^250[- ].*pleased to meet you'    | wc -l` ]; then RC="${RC}LHLO "; fi
@@ -164,10 +171,10 @@
 if [ 1 -eq `egrep <${STDOUT} '^221[- ]2.0.0.+closing.+channel'  | wc -l` ]; then RC="${RC}QUIT "; fi
 if [ "${RC}" != "init LHLO MAIL RCPT DATA post QUIT " ]; then
     echo "NO (got ${RC})"
-    echo STDIN  cat ${STDIN}
-    echo STDOUT cat ${STDOUT}
-    echo STDERR cat ${STDERR}
-    echo LOG    cat ${L2FILE}
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -175,7 +182,7 @@
 echon "checking whether -m option blocks invalid sender ... "
 prolog
 newmsg
-( MFILT=".*@is.invalid" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
+( MFILT=".*@is.invalid" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
 if [ 1 -eq `egrep <${STDOUT} '^250[- ].+pleased to meet you'    | wc -l` ]; then RC="${RC}LHLO "; fi
@@ -186,6 +193,10 @@
 if [ 1 -eq `egrep <${STDOUT} '^221[- ]2.0.0.+closing.+channel'  | wc -l` ]; then RC="${RC}QUIT "; fi
 if [ "${RC}" != "init LHLO MAIL RCPT DATA post QUIT " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -193,7 +204,7 @@
 echon "checking whether -s option rejects article with invalid size ... "
 prolog
 newmsg
-./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 100 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ; RC=$?
+./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 100 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ; RC=$?
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
 if [ 1 -eq `egrep <${STDOUT} '^250[- ].*pleased to meet you'    | wc -l` ]; then RC="${RC}LHLO "; fi
@@ -204,6 +215,10 @@
 if [ 1 -eq `egrep <${STDOUT} '^221[- ]2.0.0.+closing.+channel'  | wc -l` ]; then RC="${RC}QUIT "; fi
 if [ "${RC}" != "init LHLO MAIL RCPT DATA post QUIT " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -211,12 +226,16 @@
 echon "checking whether -c option fails on invalid local host address ... "
 prolog
 newmsg
-( LOCAL="10.255.255.255" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
+( LOCAL="10.255.255.255" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
-if [ 1 -eq `egrep <${FILE}   'error.+binding'                   | wc -l` ]; then RC="${RC}bind "; fi
+if [ 1 -eq `egrep <${L2FILE} 'error.+binding'                   | wc -l` ]; then RC="${RC}bind "; fi
 if [ "${RC}" != "init bind " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -224,7 +243,7 @@
 echon "checking whether -g envelope option blocks invalid group ... "
 prolog
 newmsg
-( GROUP="foo.*" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g envelope -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
+( GROUP="foo.*" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g envelope -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
 if [ 1 -eq `egrep <${STDOUT} '^250[- ].*pleased to meet you'    | wc -l` ]; then RC="${RC}LHLO "; fi
@@ -236,6 +255,10 @@
 if [ 1 -eq `egrep <${STDOUT} '^221[- ]2.0.0.+closing.+channel'  | wc -l` ]; then RC="${RC}QUIT "; fi
 if [ "${RC}" != "init LHLO MAIL RCPT RCPT DATA post QUIT " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"
@@ -243,12 +266,16 @@
 echon "checking whether -d option times out for invalid host ... "
 prolog
 newmsg
-( HOST="10.255.255.255" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 -t nntp:connect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
+( HOST="10.255.255.255" ; ./lmtp2nntp <${STDIN} -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} ) ; RC=$?
 RC="";
 if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready'       | wc -l` ]; then RC="${RC}init "; fi
-if [ 1 -eq `egrep <${FILE}   'warning.+connect.+failed'         | wc -l` ]; then RC="${RC}conn "; fi
+if [ 1 -eq `egrep <${L2FILE} 'warning.+connect.+failed'         | wc -l` ]; then RC="${RC}conn "; fi
 if [ "${RC}" != "init conn " ]; then
     echo "NO (got ${RC})"
+    echo "STDIN  cat ${STDIN}"
+    echo "STDOUT cat ${STDOUT}"
+    echo "STDERR cat ${STDERR}"
+    echo "LOG    cat ${L2FILE}"
     exit 1;
 fi
 echo "yes"

CVSTrac 2.0.1