.. | .. |
---|
165 | 165 | |
---|
166 | 166 | if (!l->sens || l->sens > p->p_levels.nprim) |
---|
167 | 167 | return 0; |
---|
168 | | - levdatum = hashtab_search(p->p_levels.table, |
---|
169 | | - sym_name(p, SYM_LEVELS, l->sens - 1)); |
---|
| 168 | + levdatum = symtab_search(&p->p_levels, |
---|
| 169 | + sym_name(p, SYM_LEVELS, l->sens - 1)); |
---|
170 | 170 | if (!levdatum) |
---|
171 | 171 | return 0; |
---|
172 | 172 | |
---|
.. | .. |
---|
293 | 293 | *(next_cat++) = '\0'; |
---|
294 | 294 | |
---|
295 | 295 | /* Parse sensitivity. */ |
---|
296 | | - levdatum = hashtab_search(pol->p_levels.table, sensitivity); |
---|
| 296 | + levdatum = symtab_search(&pol->p_levels, sensitivity); |
---|
297 | 297 | if (!levdatum) |
---|
298 | 298 | return -EINVAL; |
---|
299 | 299 | context->range.level[l].sens = levdatum->level->sens; |
---|
.. | .. |
---|
312 | 312 | *rngptr++ = '\0'; |
---|
313 | 313 | } |
---|
314 | 314 | |
---|
315 | | - catdatum = hashtab_search(pol->p_cats.table, cur_cat); |
---|
| 315 | + catdatum = symtab_search(&pol->p_cats, cur_cat); |
---|
316 | 316 | if (!catdatum) |
---|
317 | 317 | return -EINVAL; |
---|
318 | 318 | |
---|
.. | .. |
---|
325 | 325 | if (rngptr == NULL) |
---|
326 | 326 | continue; |
---|
327 | 327 | |
---|
328 | | - rngdatum = hashtab_search(pol->p_cats.table, rngptr); |
---|
| 328 | + rngdatum = symtab_search(&pol->p_cats, rngptr); |
---|
329 | 329 | if (!rngdatum) |
---|
330 | 330 | return -EINVAL; |
---|
331 | 331 | |
---|
.. | .. |
---|
458 | 458 | return 0; |
---|
459 | 459 | |
---|
460 | 460 | for (l = 0; l < 2; l++) { |
---|
461 | | - levdatum = hashtab_search(newp->p_levels.table, |
---|
462 | | - sym_name(oldp, SYM_LEVELS, |
---|
463 | | - oldc->range.level[l].sens - 1)); |
---|
| 461 | + char *name = sym_name(oldp, SYM_LEVELS, |
---|
| 462 | + oldc->range.level[l].sens - 1); |
---|
| 463 | + |
---|
| 464 | + levdatum = symtab_search(&newp->p_levels, name); |
---|
464 | 465 | |
---|
465 | 466 | if (!levdatum) |
---|
466 | 467 | return -EINVAL; |
---|
.. | .. |
---|
470 | 471 | node, i) { |
---|
471 | 472 | int rc; |
---|
472 | 473 | |
---|
473 | | - catdatum = hashtab_search(newp->p_cats.table, |
---|
474 | | - sym_name(oldp, SYM_CATS, i)); |
---|
| 474 | + catdatum = symtab_search(&newp->p_cats, |
---|
| 475 | + sym_name(oldp, SYM_CATS, i)); |
---|
475 | 476 | if (!catdatum) |
---|
476 | 477 | return -EINVAL; |
---|
477 | 478 | rc = ebitmap_set_bit(&newc->range.level[l].cat, |
---|
.. | .. |
---|
506 | 507 | rtr.source_type = scontext->type; |
---|
507 | 508 | rtr.target_type = tcontext->type; |
---|
508 | 509 | rtr.target_class = tclass; |
---|
509 | | - r = hashtab_search(p->range_tr, &rtr); |
---|
| 510 | + r = policydb_rangetr_search(p, &rtr); |
---|
510 | 511 | if (r) |
---|
511 | 512 | return mls_range_set(newcontext, r); |
---|
512 | 513 | |
---|
.. | .. |
---|
529 | 530 | return mls_context_cpy_high(newcontext, tcontext); |
---|
530 | 531 | case DEFAULT_TARGET_LOW_HIGH: |
---|
531 | 532 | return mls_context_cpy(newcontext, tcontext); |
---|
| 533 | + case DEFAULT_GLBLUB: |
---|
| 534 | + return mls_context_glblub(newcontext, |
---|
| 535 | + scontext, tcontext); |
---|
532 | 536 | } |
---|
533 | 537 | |
---|
534 | | - /* Fallthrough */ |
---|
| 538 | + fallthrough; |
---|
535 | 539 | case AVTAB_CHANGE: |
---|
536 | | - if ((tclass == p->process_class) || (sock == true)) |
---|
| 540 | + if ((tclass == p->process_class) || sock) |
---|
537 | 541 | /* Use the process MLS attributes. */ |
---|
538 | 542 | return mls_context_cpy(newcontext, scontext); |
---|
539 | 543 | else |
---|
.. | .. |
---|
542 | 546 | case AVTAB_MEMBER: |
---|
543 | 547 | /* Use the process effective MLS attributes. */ |
---|
544 | 548 | return mls_context_cpy_low(newcontext, scontext); |
---|
545 | | - |
---|
546 | | - /* fall through */ |
---|
547 | 549 | } |
---|
548 | 550 | return -EINVAL; |
---|
549 | 551 | } |
---|