]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
* CRE8 command: allow setting default view during room creation
[citadel.git] / citadel / msgbase.c
index 8d08d63dc6b8e68d62f8565a9c4b3bc1b2546ef7..a5ee3d785de13f5ea7618992ef2cd3b77604de31 100644 (file)
@@ -563,6 +563,7 @@ void cmd_msgs(char *cmdbuf)
        }
 
        if (with_template) {
+               unbuffer_output();
                cprintf("%d Send template then receive message list\n",
                        START_CHAT_MODE);
                template = (struct CtdlMessage *)
@@ -578,6 +579,7 @@ void cmd_msgs(char *cmdbuf)
                                }
                        }
                }
+               buffer_output();
        }
        else {
                cprintf("%d Message list...\n", LISTING_FOLLOWS);
@@ -1080,18 +1082,7 @@ int CtdlOutputMsg(long msg_num,          /* message number (local) to fetch */
                return(om_not_logged_in);
        }
 
-       /* FIXME ... small security issue
-        * We need to check to make sure the requested message is actually
-        * in the current room, and set msg_ok to 1 only if it is.  This
-        * functionality is currently missing because I'm in a hurry to replace
-        * broken production code with nonbroken pre-beta code.  :(   -- ajc
-        *
-        if (!msg_ok) {
-        if (do_proto) cprintf("%d Message %ld is not in this room.\n",
-        ERROR + MESSAGE_NOT_FOUND, msg_num);
-        return(om_no_such_msg);
-        }
-        */
+       /* FIXME: check message id against msglist for this room */
 
        /*
         * Fetch the message from disk.  If we're in sooper-fast headers
@@ -1791,8 +1782,12 @@ long send_message(struct CtdlMessage *msg) {
                retval = 0L;
        } else {
                if (is_bigmsg) {
-                       cdb_store(CDB_BIGMSGS, &newmsgid, sizeof(long),
-                               holdM, strlen(holdM) );
+                       cdb_store(CDB_BIGMSGS,
+                               &newmsgid,
+                               sizeof(long),
+                               holdM,
+                               (strlen(holdM) + 1)
+                       );
                }
                retval = newmsgid;
        }
@@ -2466,6 +2461,9 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n) {
  */
 int CtdlCheckInternetMailPermission(struct ctdluser *who) {
 
+       /* Do not allow twits to send Internet mail */
+       if (who->axlevel <= 2) return(0);
+
        /* Globally enabled? */
        if (config.c_restrict == 0) return(1);
 
@@ -2676,6 +2674,8 @@ void cmd_ent0(char *entargs)
        struct recptypes *valid = NULL;
        char subject[SIZ];
 
+       unbuffer_output();
+
        post = extract_int(entargs, 0);
        extract(recp, entargs, 1);
        anon_flag = extract_int(entargs, 2);
@@ -3224,7 +3224,7 @@ void CtdlWriteObject(char *req_room,              /* Room to stuff it in */
        if (getroom(&qrbuf, roomname) != 0) {
                create_room(roomname, 
                        ( (is_mailbox != NULL) ? 5 : 3 ),
-                       "", 0, 1, 0);
+                       "", 0, 1, 0, VIEW_BBS);
        }
        /* If the caller specified this object as unique, delete all
         * other objects of this type that are currently in the room.