Commit c3dcc6a0 authored by David Byers's avatar David Byers

Do not send new-recipient and sub-recipient messages for BCC recipients to

users who are not members of the BCC recipient in question.

Re-read aux-item definition file on a WINCH signal.
parent 9407083f
1999-10-28 David Byers <davby@ida.liu.se>
* src/server/text.c (send_async_sub_recipient): Don't send
sub-recipient messages for bcc recipients to users who are not
members of the bcc recipient.
* src/server/testsuite/lyskomd.0/06.exp (shutdown_06): Added test
cases to test async messages when adding and removing BCC
recipients.
1999-10-27 David Byers <davby@ida.liu.se>
* src/server/ramkomd.c (dump_exit_statistics): Free
read_config_file
(main): Save name of configuration file in read_config_file.
Handle WINCH signal (re-read config file.)
* src/server/param.h: Added reread_param.
Added read_config_file
* src/server/server-config.c: Added reread_param.
1999-10-20 Kent Engström <kent@lysator.liu.se>
Documentation updates w.r.t. e-mail import.
......
......@@ -3,8 +3,6 @@ server.
* Showstoppers for the 2.0.2 release
** send_async_new_recipient in text.c sends asyncs for BCC recipients.
** Fix dbck so that it can repair the database damage created by
lyskomd 2.0.0.
......@@ -25,6 +23,7 @@ server.
** Features
*** Reload configuration.
Aux-items are now reloaded on a WINCH signal. Reload other params too.
*** Cross references should create a mirror item.
......@@ -946,6 +945,9 @@ server.
It doesn't work anyway. Results are *strange*.
FIXED.
** send_async_new_recipient in text.c sends asyncs for BCC recipients.
DONE.
* In progress
** Document aux-items for mail import/export. (3229403)
......
/*
* $Id: connections.c,v 0.66 1999/06/24 12:25:45 ceder Exp $
* $Id: connections.c,v 0.67 1999/10/28 13:18:07 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -36,7 +36,7 @@
#endif
static const char *
rcsid = "$Id: connections.c,v 0.66 1999/06/24 12:25:45 ceder Exp $";
rcsid = "$Id: connections.c,v 0.67 1999/10/28 13:18:07 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -89,6 +89,7 @@ USE(rcsid);
#include "kom-errno.h"
#include "sigflags.h"
#include "server-time.h"
#include "aux-items.h"
IscMaster * kom_server_mcb = NULL;
Connection * active_connection = NULL;
......@@ -678,6 +679,13 @@ toploop(void)
do_statistics = 0;
}
if (reread_param)
{
free_aux_item_definitions();
initialize_aux_items(param.aux_def_file);
reread_param = FALSE;
}
event = isc_getnextevent(kom_server_mcb,
pending_input ? 0 : timeout );
......
/*
* $Id: param.h,v 1.32 1999/07/24 18:42:11 ceder Exp $
* $Id: param.h,v 1.33 1999/10/28 13:18:08 byers Exp $
* Copyright (C) 1994-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -120,5 +120,7 @@ struct kom_par {
};
extern struct kom_par param;
extern Bool reread_param;
extern char *read_config_file;
#endif
/*
* $Id: ramkomd.c,v 0.92 1999/07/01 18:41:17 ceder Exp $
* $Id: ramkomd.c,v 0.93 1999/10/28 13:18:09 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -44,7 +44,7 @@
#endif
static const char *
rcsid = "$Id: ramkomd.c,v 0.92 1999/07/01 18:41:17 ceder Exp $";
rcsid = "$Id: ramkomd.c,v 0.93 1999/10/28 13:18:09 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -251,6 +251,16 @@ sighandler_usr2 (int UNUSED(sig))
}
}
static void
sighandler_winch(int UNUSED(sig))
{
#ifndef HAVE_STRUCT_SIGACTION
signal(SIGWINCH, sighandler_winch);
#endif
kom_log("Signal WINCH received. Will re-read config now.\n");
reread_param = TRUE;
}
static void
save_pid(void)
{
......@@ -530,15 +540,22 @@ main (int argc,
act.sa_handler = sighandler_usr2;
sigaction(SIGUSR2, &act, NULL);
act.sa_handler = sighandler_winch;
sigaction(SIGWINCH, &act, NULL);
#else
signal(SIGHUP, sighandler_hup);
signal(SIGQUIT, sighandler_quit);
signal(SIGUSR1, sighandler_usr1);
signal(SIGUSR2, sighandler_usr2);
signal(SIGWINCH, sighandler_winch);
#endif
initialize(config_file); /* Read config, listen, and start db */
chdir(param.core_dir);
read_config_file = smalloc(strlen(config_file) + 1);
strcpy(read_config_file, config_file);
sfree(default_config_file);
save_pid();
......@@ -594,6 +611,7 @@ dump_exit_statistics(void)
free_kom_info();
free_aux_item_definitions();
free_configuration();
sfree(read_config_file);
dump_smalloc_counts(stat_file);
dump_alloc_counts(stat_file);
......
/*
* $Id: server-config.c,v 0.70 1999/07/24 18:41:40 ceder Exp $
* $Id: server-config.c,v 0.71 1999/10/28 13:18:10 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -37,7 +37,7 @@
#endif
static const char *
rcsid = "$Id: server-config.c,v 0.70 1999/07/24 18:41:40 ceder Exp $";
rcsid = "$Id: server-config.c,v 0.71 1999/10/28 13:18:10 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -70,6 +70,8 @@ USE(rcsid);
#include "unused.h"
struct kom_par param;
Bool reread_param;
char *read_config_file;
static Success log_param(const char *val, const struct parameter *par);
static Success jubel(const char *val, const struct parameter *par);
......
......@@ -375,6 +375,25 @@ kom_ping_server
talk_to client 3
kom_ping_server
# ----------------------------------------------------------------------
# Add a BCC recipient to text one in client 2
talk_to client 2
send "1032 30 2 5 15\n"
simple_expect ":3 16 2 5 15"
simple_expect "=1032"
# Check that the message is not sent to any non-members of 5
talk_to client 1
kom_ping_server
talk_to client 0
kom_ping_server
talk_to client 3
kom_ping_server
# ======================================================================
# Test sub-recipient message
......@@ -395,6 +414,24 @@ talk_to client 3
kom_accept_async "13 { 0 5 6 7 8 9 11 12 13 14 15 16 18 }\n"
# ----------------------------------------------------------------------
# Remove a BCC recipient
# Check that no message is sent to non-members of the BCC recipient
talk_to client 2
send "1039 31 2 5\n"
simple_expect ":3 17 2 5 15"
simple_expect "=1039"
talk_to client 0
kom_ping_server
talk_to client 1
kom_ping_server
talk_to client 3
kom_ping_server
# ----------------------------------------------------------------------
# Remove a recipient of text 1 in client 2
# Check that the message is not sent to a non-member
......
/*
* $Id: text.c,v 0.76 1999/07/08 11:18:38 ceder Exp $
* $Id: text.c,v 0.77 1999/10/28 13:18:12 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: text.c,v 0.76 1999/07/08 11:18:38 ceder Exp $";
rcsid = "$Id: text.c,v 0.77 1999/10/28 13:18:12 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -618,22 +618,41 @@ send_async_sub_recipient (Text_no text_no, Text_stat *text_s,
{
Connection *cptr;
Session_no i = 0;
Membership *mship;
while ((i = traverse_connections(i)) != 0)
{
cptr = get_conn_by_number(i);
/*
* Send messate if connection is logged on, the user is a member
* in a recipient and the subtracted recipient is visible to the
* user
*/
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& access_perm(conf_no, cptr, read_protected) > none)
if (type != bcc_recpt) {
while ((i = traverse_connections(i)) != 0)
{
async_sub_recipient(cptr, text_no, conf_no, type);
cptr = get_conn_by_number(i);
/*
* Send messate if connection is logged on, the user is a member
* in a recipient and the subtracted recipient is visible to the
* user
*/
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& access_perm(conf_no, cptr, read_protected) > none)
{
async_sub_recipient(cptr, text_no, conf_no, type);
}
}
}
else
{
while ((i = traverse_connections(i)) != 0)
{
cptr = get_conn_by_number(i);
if (cptr->person != NULL) {
mship = locate_membership(conf_no, cptr->person);
if (mship != NULL &&
!mship->type.passive &&
access_perm(conf_no, cptr, read_protected) > none)
{
async_sub_recipient(cptr, text_no, conf_no, type);
}
}
}
}
}
/*
......@@ -2857,16 +2876,36 @@ send_async_add_recipient (Text_no text_no, Text_stat *text_s,
Conf_no conf_no, Info_type type)
{
Connection *cptr;
Membership *mship;
Session_no i = 0;
while ((i = traverse_connections(i)) != 0)
if (type != bcc_recpt)
{
cptr = get_conn_by_number(i);
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& access_perm(conf_no, cptr, read_protected) > none)
while ((i = traverse_connections(i)) != 0)
{
async_new_recipient(cptr, text_no, conf_no, type);
cptr = get_conn_by_number(i);
if (cptr->person != NULL
&& is_member_in_recpt(cptr->person, text_s, TRUE) == TRUE
&& access_perm(conf_no, cptr, read_protected) > none)
{
async_new_recipient(cptr, text_no, conf_no, type);
}
}
}
else
{
while ((i = traverse_connections(i)) != 0)
{
cptr = get_conn_by_number(i);
if (cptr->person != NULL) {
mship = locate_membership(conf_no, cptr->person);
if (mship != NULL &&
!mship->type.passive &&
access_perm(conf_no, cptr, read_protected) > none)
{
async_new_recipient(cptr, text_no, conf_no, type);
}
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment