Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modify ezmlm-split to exit silently is splitfile is absent.

  • Loading branch information...
commit 4d5b94f84737582caefaae22f27f505798823f46 1 parent 819ce5a
@bruceg authored
View
2  CHANGES
@@ -33,6 +33,8 @@ ezmlm-idx-7.1.0, ????-??-??
- Renamed to "setup" target to the more standard "install".
+- Modified ezmlm-split to exit silently if there is not "split" file.
+
ezmlm-idx-7.0.2, 2009-08-09
===========================
View
4 ezmlm-split.1
@@ -39,7 +39,9 @@ The hash and domain parts are then tested against successive lines of
If a match is found, the request is forwarded to the corresponding
sublist, and
.B ezmlm-split
-exits 99. If a match is not found or action is not
+exits 99. If
+.I splitfile
+does not exist, a match is not found, or action is not
.I \-subscribe
or
.IR \-unsubscribe ,
View
8 ezmlm-split.c
@@ -102,8 +102,12 @@ int findname(void)
if (!stralloc_copyb(&domain,cpat + 1,cplast - cpat)) die_nomem();
if (!stralloc_0(&domain)) die_nomem();
- if ((fd = open_read(split)) == -1)
- strerr_die2sys(111,FATAL,MSG1(ERR_OPEN,split));
+ if ((fd = open_read(split)) == -1) {
+ if (errno == error_noent)
+ _exit(0);
+ else
+ strerr_die2sys(111,FATAL,MSG1(ERR_OPEN,split));
+ }
substdio_fdbuf(&sssp,read,fd,spbuf,(int) sizeof(spbuf));
lineno = 0;
for (;;) { /* dom:hash_lo:hash_hi:listaddress */
View
5 tests/170-ezmlm-split
@@ -40,5 +40,10 @@
${ECHO} "X-num: spl1" | ${EZBIN}/ezmlm-split "$DIR" >"$ERR" 2>&1 || \
fatal "failed to exit 0 after failing to match"
checkenv spl1 "$LOC-return-@$HOST" "$LOC-subscribe-$SND=$HOST@$HOST"
+# if no split file, should exit 0
+ ${RM} "${DIR}/split"
+ ${ECHO} "X-num: spl2" | ${EZBIN}/ezmlm-split "$DIR" >"$ERR" 2>&1 || \
+ fatal "failed to exit 0 with no split file"
+ checkenv spl2 "$LOC-return-@$HOST" "$LOC-subscribe-$SND=$HOST@$HOST"
${ECHO} "OK"
Please sign in to comment.
Something went wrong with that request. Please try again.