* fixups. subscribers only post mailinglists work now.
authorWilfried Göesgens <willi@citadel.org>
Thu, 13 Dec 2007 21:19:20 +0000 (21:19 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 13 Dec 2007 21:19:20 +0000 (21:19 +0000)
citadel/modules/network/serv_network.c
citadel/msgbase.c

index cf9c9800b2b4a2373619f2654c531441c09cb95c..ebac0f6b4de0a4d859316532edc3939efce07804 100644 (file)
@@ -1063,24 +1063,26 @@ int writenfree_spoolcontrol_file(SpoolControl **scc, char *filename)
 int is_recipient(SpoolControl *sc, const char *Name)
 {
        namelist *nptr;
+       size_t len;
 
+       len = strlen(Name);
        nptr = sc->listrecps;
        while (nptr != NULL) {
-               if (strcmp(Name, nptr->name)==0)
+               if (strncmp(Name, nptr->name, len)==0)
                        return 1;
                nptr = nptr->next;
        }
        /* Do the same for digestrecps */
        nptr = sc->digestrecps;
        while (nptr != NULL) {
-               if (strcmp(Name, nptr->name)==0)
+               if (strncmp(Name, nptr->name, len)==0)
                        return 1;
                nptr = nptr->next;
        }
        /* Do the same for participates */
        nptr = sc->participates;
        while (nptr != NULL) {
-               if (strcmp(Name, nptr->name)==0)
+               if (strncmp(Name, nptr->name, len)==0)
                        return 1;
                nptr = nptr->next;
        }
index d5f22580a791927fa5caae99ee8def656fbe9194..9c65dc0307081dfee2d22de518422d8eae93567a 100644 (file)
@@ -3113,19 +3113,14 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf,
                else if (CC->room.QRflags2 & QR2_SUBSONLY){
                        SpoolControl *sc;
                        char filename[SIZ];
-                       char room_to_spool[SIZ];
                        int found;
 
                        if (RemoteIdentifier == NULL)
                        {
                                snprintf(errmsgbuf, n, "Need sender to permit access.");
-                               return (0);
-                       }
-                       if (getroom(&CC->room, room_to_spool) != 0) {
-                               lprintf(CTDL_CRIT, "ERROR: cannot load <%s>\n", room_to_spool);
-                               return (0);
+                               return (ERROR + USERNAME_REQUIRED);
                        }
-               
+
                        assoc_file_name(filename, sizeof filename, &CC->room, ctdl_netcfg_dir);
                
                        lprintf(CTDL_INFO, "Networking started for <%s>\n", CC->room.QRname);
@@ -3134,12 +3129,15 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf,
                        {
                                end_critical_section(S_NETCONFIGS);
                                snprintf(errmsgbuf, n, "No Subscribers found.");
-                               return (0);
+                               return (ERROR + NO_SUCH_USER);
                        }
                        end_critical_section(S_NETCONFIGS);
                        found = is_recipient (sc, RemoteIdentifier);
                        free_spoolcontrol_struct(&sc);
-                       return (found);
+                       if (found)
+                               return (0);
+                       else
+                               return (ERROR + NO_SUCH_USER);
                }
                else if (CC->room.QRflags2 & QR2_MODERATED) {
                        return (0);