+++ /dev/null
-/* 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 */
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
+++ /dev/null
-/*
- * 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);
-}
#include "find_email_adr.h"
#include "send_mail.h"
#include "getlistdelim.h"
-#include "getlistaddr.h"
#include "statctrl.h"
#include "subscriberfuncs.h"
#include "getaddrsfromfile.h"
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);
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;
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);