Text   |  XML   |  ReML   |   Visible Warnings:

Ignored Return Value  at acl-mailbox-list.c:265

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

iter_mailbox_has_visible_children

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/acl/acl-mailbox-list.c)expand/collapse
Show more  
 226  iter_mailbox_has_visible_children(struct acl_mailbox_list_iterate_context *ctx,
 227                                    bool only_nonpatterns)
 228  {
 229          struct mailbox_list_iterate_context *iter;
 230          const struct mailbox_info *info;
 231          enum mailbox_list_iter_flags flags;
 232          string_t *pattern;
 233          const char *prefix;
 234          unsigned int i, prefix_len;
 235          bool stars = FALSE, ret = FALSE;
 236   
 237          /* do we have child mailboxes with LOOKUP right that don't match 
 238             the list pattern? */
 239          if (ctx->lookup_boxes != NULL) {
 240                  /* we have a list of mailboxes with LOOKUP rights. before 
 241                     starting the slow list iteration, check check first 
 242                     if there even are any children with LOOKUP rights. */
 243                  struct mailbox_node *node;
 244   
 245                  node = mailbox_tree_lookup(ctx->lookup_boxes, ctx->info.name);
 246                  i_assert(node != NULL);
 247                  if (node->children == NULL)
 248                          return FALSE;
 249          }
 250   
 251          /* if mailbox name has '*' characters in it, they'll conflict with the 
 252             LIST wildcard. replace then with '%' and verify later that all 
 253             results have the correct prefix. */
 254          pattern = t_str_new(128);
 255          for (i = 0; ctx->info.name[i] != '\0'; i++) {
 256                  if (ctx->info.name[i] != '*')
 257                          str_append_c(pattern, ctx->info.name[i]);
 258                  else {
 259                          stars = TRUE;
 260                          str_append_c(pattern, '%');
 261                  }
 262          }
 263          str_append_c(pattern, ctx->sep);
 264          str_append_c(pattern, '*');
 265          prefix = str_c(pattern);
 266          prefix_len = str_len(pattern) - 1;
 267   
 268          flags = (ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) |
 269                  MAILBOX_LIST_ITER_RETURN_NO_FLAGS;
 270          iter = mailbox_list_iter_init(ctx->ctx.list, str_c(pattern), flags);
 271          while ((info = mailbox_list_iter_next(iter)) != NULL) {
 272                  if (only_nonpatterns &&
 273                      imap_match(ctx->glob, info->name) == IMAP_MATCH_YES) {
 274                          /* at least one child matches also the original list 
 275                             patterns. we don't need to show this mailbox. */
 276                          ret = FALSE;
 277                          break;
 278                  }
 279                  if (!stars || strncmp(info->name, prefix, prefix_len) == 0)
 280                          ret = TRUE;
 281          }
 282          (void)mailbox_list_iter_deinit(&iter);
 283          return ret;
 284  }
Show more  




Change Warning 8175.26084 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: