]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
getlistaddr: remove now dead code
authorBaptiste Daroussin <bapt@FreeBSD.org>
Sun, 12 Feb 2023 15:04:59 +0000 (16:04 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Sun, 12 Feb 2023 15:04:59 +0000 (16:04 +0100)
include/getlistaddr.h [deleted file]
src/Makefile.am
src/getlistaddr.c [deleted file]
tests/mlmmj.c

diff --git a/include/getlistaddr.h b/include/getlistaddr.h
deleted file mode 100644 (file)
index d8752e8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2002, 2003 Mads Martin Joergensen <mmj at mmj.dk>
- *
- * $Id$
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef GETLISTADDR_H
-#define GETLISTADDR_H
-
-char *getlistaddr(int fd);
-
-#endif /* GETLISTADDR_H */
index 895b14fd5a6e58e70605eabc7ea023fbfd977f03..a424d3427c32ed97d1304f4ef65e2c2f3ab65736 100644 (file)
@@ -34,7 +34,7 @@ libmlmmj_a_SOURCES=   mail-functions.c chomp.c incindexfile.c \
                        listcontrol.c send_help.c prepstdreply.c \
                        do_all_the_voodoo_here.c log_oper.c send_list.c \
                        unistr.c gethdrline.c send_digest.c \
-                       getlistaddr.c strgen.c statctrl.c \
+                       strgen.c statctrl.c \
                        ctrlvalue.c readn.c getlistdelim.c ctrlvalues.c \
                        utils.c mlmmj.c send_mail.c
 
diff --git a/src/getlistaddr.c b/src/getlistaddr.c
deleted file mode 100644 (file)
index 29111f7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2002, 2003 Mads Martin Joergensen <mmj at mmj.dk>
- * Copyright (C) 2022 Baptiste Daroussin <bapt@FreeBSD.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include "getlistaddr.h"
-#include "log_error.h"
-#include "ctrlvalue.h"
-
-char *
-getlistaddr(int fd)
-{
-       char *listaddr = ctrlvalue(fd, "listaddress");
-       if (listaddr == NULL) {
-               log_error(LOG_ARGS, "FATAL. Could not get listaddress "
-                   "in control/listaddress");
-               exit(EXIT_FAILURE);
-       }
-       if (strchr(listaddr, '@') == NULL) {
-               log_error(LOG_ARGS, "FATAL. No @ sign in listaddress");
-               exit(EXIT_FAILURE);
-       }
-
-       return (listaddr);
-}
index a120adab7e580965f67703822fd6f3487b154aed..6c3d733157392cc3ff4eb4993a1e7e3362100138 100644 (file)
@@ -53,7 +53,6 @@
 #include "find_email_adr.h"
 #include "send_mail.h"
 #include "getlistdelim.h"
-#include "getlistaddr.h"
 #include "statctrl.h"
 #include "subscriberfuncs.h"
 #include "getaddrsfromfile.h"
@@ -117,7 +116,6 @@ ATF_TC_WITHOUT_HEAD(getlistdelim_1);
 ATF_TC_WITHOUT_HEAD(getlistdelim_2);
 ATF_TC_WITHOUT_HEAD(getlistdelim_3);
 ATF_TC_WITHOUT_HEAD(getlistdelim_4);
-ATF_TC_WITHOUT_HEAD(getlistaddr);
 ATF_TC_WITHOUT_HEAD(statctrl);
 ATF_TC_WITHOUT_HEAD(is_subbed_in);
 ATF_TC_WITHOUT_HEAD(getaddrsfromfile);
@@ -1619,26 +1617,6 @@ ATF_TC_BODY(getlistdelim_4, tc)
        ATF_REQUIRE_STREQ_MSG(getlistdelim(fd), "mydelim", "Invalid delimiter found");
 }
 
-ATF_TC_BODY(getlistaddr, tc)
-{
-       init_ml(false);
-       int fd = open("list/control", O_RDONLY);
-
-       pid_t p = atf_utils_fork();
-       if (p == 0) {
-               ATF_REQUIRE_EQ_MSG(getlistaddr(fd), NULL, "no control/listaddress file should be null");
-       }
-       atf_utils_wait(p, EXIT_FAILURE, "", "");
-       atf_utils_create_file("list/control/listaddress", "plop\n");
-       p = atf_utils_fork();
-       if (p == 0) {
-               ATF_REQUIRE_EQ_MSG(getlistaddr(fd), NULL, "no control/listaddress file should be null");
-       }
-       atf_utils_wait(p, EXIT_FAILURE, "", "");
-       atf_utils_create_file("list/control/listaddress", "plop@meh\n");
-       ATF_REQUIRE_STREQ_MSG(getlistaddr(fd), "plop@meh", "list address not read properly");
-}
-
 ATF_TC_BODY(statctrl, tc)
 {
        pid_t p;
@@ -2555,7 +2533,6 @@ ATF_TP_ADD_TCS(tp)
        ATF_TP_ADD_TC(tp, getlistdelim_2);
        ATF_TP_ADD_TC(tp, getlistdelim_3);
        ATF_TP_ADD_TC(tp, getlistdelim_4);
-       ATF_TP_ADD_TC(tp, getlistaddr);
        ATF_TP_ADD_TC(tp, statctrl);
        ATF_TP_ADD_TC(tp, is_subbed_in);
        ATF_TP_ADD_TC(tp, getaddrsfromfile);