From: Baptiste Daroussin Date: Sun, 12 Feb 2023 15:04:59 +0000 (+0100) Subject: getlistaddr: remove now dead code X-Git-Tag: RELEASE_1_4_0b1~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d4e9bb3964d13ff6dc5985b6ca3980f20b982c1;p=thirdparty%2Fmlmmj.git getlistaddr: remove now dead code --- diff --git a/include/getlistaddr.h b/include/getlistaddr.h deleted file mode 100644 index d8752e89..00000000 --- a/include/getlistaddr.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2002, 2003 Mads Martin Joergensen - * - * $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 */ diff --git a/src/Makefile.am b/src/Makefile.am index 895b14fd..a424d342 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 index 29111f70..00000000 --- a/src/getlistaddr.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2002, 2003 Mads Martin Joergensen - * Copyright (C) 2022 Baptiste Daroussin - * - * 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 -#include -#include -#include -#include - -#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); -} diff --git a/tests/mlmmj.c b/tests/mlmmj.c index a120adab..6c3d7331 100644 --- a/tests/mlmmj.c +++ b/tests/mlmmj.c @@ -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);