]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/ctdlproto/serv_user.c
When opening a cursor, always read through to the end.
[citadel.git] / citadel / server / modules / ctdlproto / serv_user.c
index 48fe21d9f3ccb7c661d6ea14d4a3b7d8be5da54b..981b56ff77136fd5104e073bda8491057b466cba 100644 (file)
@@ -383,6 +383,7 @@ void cmd_forg(char *argbuf) {
 void cmd_gnur(char *argbuf) {
        struct cdbkeyval cdbus;
        struct ctdluser usbuf;
+       int found_it = 0;
 
        if (CtdlAccessCheck(ac_aide)) {
                return;
@@ -400,11 +401,14 @@ void cmd_gnur(char *argbuf) {
                memcpy(&usbuf, cdbus.val.ptr, ((cdbus.val.len > sizeof(struct ctdluser)) ? sizeof(struct ctdluser) : cdbus.val.len));
                if ((usbuf.flags & US_NEEDVALID) && (usbuf.axlevel > AxDeleted)) {
                        cprintf("%d %s\n", MORE_DATA, usbuf.fullname);
-                       cdb_close_cursor(CDB_USERS);
-                       return;
+                       found_it = 1;                                           // always read through to the end
                }
        }
 
+       if (found_it) {
+               return;
+       }
+
        // If we get to this point, there are no more unvalidated users.  Therefore we clear the "users need validation" flag.
        begin_critical_section(S_CONTROL);
        int flags;