* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.35 1995/05/16 09:40:43 adam
+ * Revision 1.36 1995/05/17 10:51:33 adam
+ * Added a few more error checks to the show command.
+ *
+ * Revision 1.35 1995/05/16 09:40:43 adam
* LICENSE. Setting of CCL token names (and/or/not/set) in read_kernel_res.
*
* Revision 1.34 1995/05/04 10:40:08 adam
li = li->next;
}
else
+ {
+ int len = li->len;
+ memcpy (tmp_str, li->name, len);
+ tmp_str[len] = '\0';
+ if (atoi(tmp_str) <= 0)
+ {
+ fprintf (reply_fd, "%s\n",
+ gw_res_get (info.kernel_res, "gw.err.bad.show",
+ "Integer expected"));
+ return -3;
+ }
li = li->next;
+ }
}
if (set_token)
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Got set=%.*s", set_token->len,
memcpy (tmp_str, li->name, len);
tmp_str [len] = '\0';
number = atoi (tmp_str) - offset + 1;
+ if (number <= 0)
+ {
+ fprintf (reply_fd, "%s\n",
+ gw_res_get (info.kernel_res,
+ "gw.err.pos.show",
+ "Starting position "
+ "greater than ending position"));
+ return -3;
+ }
}
else
{
}
li = li->next;
}
- else
+ else if (li->kind == CCL_TOK_TERM)
{
len = li->len;
memcpy (tmp_str, li->name, len);
mta = gw_res_get (info.kernel_res, "gw.reply.mta",
"/usr/lib/sendmail");
sprintf (cmd, "%s %s < %s", mta, info.from_str, info.reply_fname);
-
+#if 1
mta_code = system (cmd);
if (mta_code)
gw_log (GW_LOG_FATAL, KERNEL_LOG,
"Reply '%s' got exit code %d", cmd, mta_code);
else
unlink (info.reply_fname);
+#endif
gw_log (GW_LOG_ACCT, KERNEL_LOG, "User end %s", info.from_str);
}
}