void cmd_gnur(char *argbuf) {
struct cdbkeyval cdbus;
struct ctdluser usbuf;
+ int found_it = 0;
if (CtdlAccessCheck(ac_aide)) {
return;
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;