char *mlmmjsend, *bindir;
char *address = NULL, *modstr = NULL;
int opt, subconfirm = 0, confirmsub = 0, notifysub;
- int changeuid = 1, status, digest = 0, nomail = 0, both = 0;
+ int changeuid = 1, digest = 0, nomail = 0, both = 0;
int nogensubscribed = 0;
int force = 0, quiet = 0;
enum subtype subbed;
struct stat st;
- pid_t pid, childpid = 0;
uid_t uid;
enum subtype typesub = SUB_NORMAL;
enum subreason reasonsub = SUB_ADMIN;
subscribe_type(ml.fd, address, typesub);
}
- if(confirmsub) {
- childpid = fork();
-
- if(childpid < 0) {
- log_error(LOG_ARGS, "Could not fork; owner not notified");
- confirm_sub(&ml, address, typesub, reasonsub, true);
- }
-
- if(childpid > 0) {
- do /* Parent waits for the child */
- pid = waitpid(childpid, &status, 0);
- while(pid == -1 && errno == EINTR);
- }
-
- /* child confirms subscription */
- if(childpid == 0)
- confirm_sub(&ml, address, typesub, reasonsub, true);
- }
+ if(confirmsub)
+ confirm_sub(&ml, address, typesub, reasonsub, true);
notifysub = !quiet && reasonsub != SUB_SWITCH &&
statctrl(ml.ctrlfd, "notifysub");
ATF_REQUIRE(socketpair(AF_UNIX, SOCK_STREAM, 0, smtppipe) >= 0);
pid_t p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- pid_t p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_NORMAL, SUB_ADMIN, true);
- }
+ confirm_sub(&ml, "test@plop", SUB_NORMAL, SUB_ADMIN, true);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
path = "mailout.txt";
if (!atf_utils_grep_file(".*An administrator has subscribed you to the normal version of the list.*", path)) {
atf_utils_cat_file(path, "");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_DIGEST, SUB_ADMIN, true);
- }
+ confirm_sub(&ml, "test@plop", SUB_DIGEST, SUB_ADMIN, true);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*An administrator has subscribed you to the digest version of the list.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_NOMAIL, SUB_CONFIRM, true);
- }
+ confirm_sub(&ml, "test@plop", SUB_NOMAIL, SUB_CONFIRM, true);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*Thank you for confirming your subscription. You have now been added to the.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_BOTH, SUB_REQUEST, true);
- }
+ confirm_sub(&ml, "test@plop", SUB_BOTH, SUB_REQUEST, true);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*Thank you for your request to join us. You have now been added to the.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_NORMAL, SUB_ADMIN, false);
- }
+ confirm_sub(&ml, "test@plop", SUB_NORMAL, SUB_ADMIN, false);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*An administrator has removed you from the list.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_DIGEST, SUB_ADMIN, false);
- }
+ confirm_sub(&ml, "test@plop", SUB_DIGEST, SUB_ADMIN, false);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*An administrator has removed you from the list.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_NOMAIL, SUB_CONFIRM, false);
- }
+ confirm_sub(&ml, "test@plop", SUB_NOMAIL, SUB_CONFIRM, false);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*Thank you for confirming your unsubscribe. You have now been removed from.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file unsubscribe nomail confirm");
p2 = single_mail_reception(smtppipe[1]);
atf_utils_readline(smtppipe[0]);
- p = atf_utils_fork();
- if (p == 0) {
- confirm_sub(&ml, "test@plop", SUB_BOTH, SUB_REQUEST, false);
- }
+ confirm_sub(&ml, "test@plop", SUB_BOTH, SUB_REQUEST, false);
atf_utils_wait(p2, 0, "save:mailout.txt", "");
- atf_utils_wait(p, 0, "", "");
if (!atf_utils_grep_file(".*You have now been removed from the list.*", path)) {
atf_utils_cat_file(path, "");
atf_tc_fail("invalid file");