Ralph wrote:
OK as long as the refile didn't create a copy before bailing on the rmm;
as happens now.
To prevent that, how about this addition to refile.c:
diff --git a/uip/refile.c b/uip/refile.c
index 2bd12ed..76e41d0 100644
--- a/uip/refile.c
+++ b/uip/refile.c
@@ -182,6 +182,19 @@ main (int argc, char **argv)
if (filep > 0) {
if (folder || msgs.size)
adios (NULL, "use -file or some messages, not both");
+
+ /* If using an rmmproc, check for MAXARGS overflow before
+ modifying anything. If not using an rmmproc, we don't
+ pass the message files to another process, so this check
+ isn't necessary. This check also isn't necessary if
+ NFOLDERS < MAXARGS - 1, because there's a check above for
+ filep <= NFOLDERS, but do it in that case just to be safe. */
+ if (rmmproc) {
+ if (filep > MAXARGS - 2)
+ adios (NULL, "more than %d messages for %s exec", MAXARGS - 2,
+ rmmproc);
+ }
+
opnfolds (folders, foldp);
for (i = 0; i < filep; i++)
if (m_file (files[i], folders, foldp, preserve, 0))
@@ -213,6 +226,17 @@ main (int argc, char **argv)
for (msgnum = 0; msgnum < msgs.size; msgnum++)
if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
+
+ /* If using an rmmproc, check for MAXARGS overflow before
+ modifying anything. If not using an rmmproc, we don't
+ pass the message files to another process, so this check
+ isn't necessary. */
+ if (rmmproc) {
+ if (mp->numsel > MAXARGS - 2)
+ adios (NULL, "more than %d messages for %s exec", MAXARGS - 2,
+ rmmproc);
+ }
+
seq_setprev (mp); /* set the previous-sequence */
/* create folder structures for each destination folder */
David
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers