OSSP CVS Repository

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

Check-in Number: 749
Date: 2001-Aug-23 10:36:53 (local)
2001-Aug-23 08:36:53 (UTC)
User:rse
Branch:
Comment: adjust for recently fixed return code semantic of str_parse()
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp.c      1.25 -> 1.26     8 inserted, 8 deleted
ossp-pkg/lmtp2nntp/msg.c      1.7 -> 1.8     4 inserted, 3 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.25 -> 1.26

--- lmtp2nntp.c  2001/08/23 08:30:41     1.25
+++ lmtp2nntp.c  2001/08/23 08:36:53     1.26
@@ -402,8 +402,8 @@
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.0.0   Other undefined Status
      */
-    if (! (   helo_rfc0821domain(req->msg, &ctx->session.lhlo_domain)
-           || helo_rfc1035domain(req->msg, &ctx->session.lhlo_domain))) {
+    if (! (   helo_rfc0821domain(req->msg, &ctx->session.lhlo_domain) > 0
+           || helo_rfc1035domain(req->msg, &ctx->session.lhlo_domain) > 0)) {
         res.statuscode = "501";
         res.dsncode    = "5.0.0";
         res.statusmsg  = "Please identify yourself. Domain must match RFC0821/RFC1035.";
@@ -674,7 +674,7 @@
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.1.7   Bad sender's mailbox address syntax
      */
-    if (!str_parse(req->msg, "m/^MAIL From:\\s*<(?:.+@.+)>/i")) {
+    if (str_parse(req->msg, "m/^MAIL From:\\s*<(?:.+@.+)>/i") <= 0) {
         res.statuscode = "553";
         res.dsncode    = "5.1.7";
         res.statusmsg  = "Domain name required for sender address.";
@@ -687,9 +687,9 @@
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.5.4   Invalid command arguments
      */
-    if (!str_parse(req->msg, "m/^MAIL From:\\s*<(.+@.+)>"
-                             "(?:\\s+BODY=(?:7BIT|8BITMIME)\\s*)?$/i", 
-                             &ctx->msg->mail_from)) {
+    if (str_parse(req->msg, "m/^MAIL From:\\s*<(.+@.+)>"
+                            "(?:\\s+BODY=(?:7BIT|8BITMIME)\\s*)?$/i", 
+                            &ctx->msg->mail_from) <= 0) {
         res.statuscode = "501";
         res.dsncode    = "5.5.4";
         res.statusmsg  = "Unknown parameter for keyword BODY.";
@@ -733,7 +733,7 @@
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
      *  RFC1893 3.5 Network and Routing Status          X.5.2   Syntax error
      */
-    if (!str_parse(req->msg, "m/^RCPT To:\\s*(.+)$/i", &cp)) {
+    if (str_parse(req->msg, "m/^RCPT To:\\s*(.+)$/i", &cp) <= 0) {
         res.statuscode = "501";
         res.dsncode    = "5.5.2";
         res.statusmsg  = "Syntax error in parameters.";
@@ -764,7 +764,7 @@
      *                                                  X.7.2   Mailing list expansion prohibited
      */
     if (ctx->option_groupmode == GROUPMODE_ENVELOPE) {
-        if (!str_parse(cp, "m/^<(.+)?@[^@]+>$/i", &group)) {
+        if (str_parse(cp, "m/^<(.+)?@[^@]+>$/i", &group) <= 0) {
             res.statuscode = "550";
             res.dsncode    = "5.1.1";
             res.statusmsg  = "Recipient did not transform into group.";


ossp-pkg/lmtp2nntp/msg.c 1.7 -> 1.8

--- msg.c        2001/08/23 07:54:06     1.7
+++ msg.c        2001/08/23 08:36:53     1.8
@@ -91,7 +91,7 @@
      */
 
     /* split message into header and body */
-    if (!str_parse(msg->cpMsg, "m/((?:.*?)\\n)\\n(.*)$/s", &cpHeaders, &msg->cpBody))
+    if (str_parse(msg->cpMsg, "m/((?:.*?)\\n)\\n(.*)$/s", &cpHeaders, &msg->cpBody) <= 0)
         return MSG_ERR_SPLITSPLITBODY;
 
     /* replace envelope From w/o colon by X-F: pseudotag. This eliminates the
@@ -104,7 +104,7 @@
 
     /* unwrap header lines */
     /*FIXME poor man's s///g simulator as current str library doesn't support //global substitution */
-    while (str_parse(cpHeaders, "s/(.*?)\\n[ \\t]+(.*)/$1 $2/s", &cpRem)) {
+    while (str_parse(cpHeaders, "s/(.*?)\\n[ \\t]+(.*)/$1 $2/s", &cpRem) > 0) {
         free(cpHeaders);
         cpHeaders = cpRem;
     }
@@ -114,7 +114,8 @@
     /*FIXME - fix bug "not" [^...] working */
     /*FIXME - improve str_parse(foo, "...", &foo) should free foo() on it's own */
     /*FIXME - add "global" in s/search/replace/g (see above "unwrap hader lines") */
-    while (str_parse(cpHeaders, "m/^([\\w-]+?:)[ \\t]*(.*?)[ \\t]*\\n(.*)/s", &cpName, &cpValue, &cpRem)) {
+    while (str_parse(cpHeaders, "m/^([\\w-]+?:)[ \\t]*(.*?)[ \\t]*\\n(.*)/s",
+                     &cpName, &cpValue, &cpRem) > 0) {
         free(cpHeaders);
         cpHeaders = cpRem;
         argz_add(&msg->azHeaders, &msg->asHeaders, cpName);

CVSTrac 2.0.1