From 34d9fff953ad79e9ef17f12e7cb6bb5e0fba9430 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 14 Apr 2017 14:42:14 +1000 Subject: [PATCH] Check realnames and alias when determining who a message is for --- README.md | 18 +++++++++--------- mail_menu.c | 4 +++- www_msgs.c | 4 +++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6b6a4ee..97fb6bb 100644 --- a/README.md +++ b/README.md @@ -21,34 +21,34 @@ If you want to install Magicka BBS, follow these steps. 3. Build the BBS (You may have to adjust the Makefile for your system) - `make -f Makefile.linux` (Linux) `gmake -f Makefile.freebsd` (FreeBSD) `make -f Makefile.osx` (macOS) `make -f Makefile.netbsd` (NetBSD) + `make -f Makefile.linux` (Linux) `gmake -f Makefile.freebsd` (FreeBSD) `make -f Makefile.osx` (macOS) `gmake -f Makefile.netbsd` (NetBSD) 4. Make a directory for logs. - `mkdir logs` + `mkdir logs` 5. Copy the config-default directory to a config directory. - `cp -r config_default config` + `cp -r config_default config` 6. Edit the config files and update essential information, like system paths and BBS name etc 7. Copy the ansi-default directory to the one specified in your system path - eg. + eg. - `cp -r ansi_default ansis` + `cp -r ansi_default ansis` 8. If you are going to run SSH, you will need to create keys. To do this - `mkdir keys` + `mkdir keys` - `ssh-keygen -f keys/ssh_host_rsa_key -N '' -t rsa` + `ssh-keygen -f keys/ssh_host_rsa_key -N '' -t rsa` - `ssh-keygen -f keys/ssh_host_dsa_key -N '' -t dsa` + `ssh-keygen -f keys/ssh_host_dsa_key -N '' -t dsa` 9. Run Magicka BBS on a port over 1024 (Below require root, and we're not ready for that). - `./magicka config/bbs.ini` + `./magicka config/bbs.ini` 10. Your BBS is now running on the port you specified in the config.ini, log in and create yourself an account! (By default there is only one security level, you can add more, but you will need to use an SQLite Manager to modify users.sq3 and set security levels, as there is no user editor yet. diff --git a/mail_menu.c b/mail_menu.c index 7c34fd7..6d24f34 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -287,7 +287,9 @@ struct msg_headers *read_message_headers(int msgconf, int msgarea, struct user_r if (jmh.Attribute & JAM_MSG_PRIVATE) { if (!msg_is_to(user, jamm->to, jamm->daddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) && - !msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf)) { + !msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, conf.mail_conferences[msgconf]->realnames, msgconf) && + !msg_is_to(user, jamm->to, jamm->daddress, conf.mail_conferences[msgconf]->nettype, !conf.mail_conferences[msgconf]->realnames, msgconf) && + !msg_is_from(user, jamm->from, jamm->oaddress, conf.mail_conferences[msgconf]->nettype, !conf.mail_conferences[msgconf]->realnames, msgconf)) { if (jamm->subject != NULL) { free(jamm->subject); diff --git a/www_msgs.c b/www_msgs.c index 73c45b7..30bb054 100644 --- a/www_msgs.c +++ b/www_msgs.c @@ -342,7 +342,9 @@ char *www_msgs_messageview(struct user_record *user, int conference, int area, i if (jmh.Attribute & JAM_MSG_PRIVATE) { if (!msg_is_to(user, to, daddress, conf.mail_conferences[conference]->nettype, conf.mail_conferences[conference]->realnames, conference) && - !msg_is_from(user, from, oaddress, conf.mail_conferences[conference]->nettype, conf.mail_conferences[conference]->realnames, conference)) { + !msg_is_from(user, from, oaddress, conf.mail_conferences[conference]->nettype, conf.mail_conferences[conference]->realnames, conference) && + !msg_is_to(user, to, daddress, conf.mail_conferences[conference]->nettype, !conf.mail_conferences[conference]->realnames, conference) && + !msg_is_from(user, from, oaddress, conf.mail_conferences[conference]->nettype, !conf.mail_conferences[conference]->realnames, conference)) { if (subject != NULL) { free(subject);