Date: Thu, 20 Apr 2006 14:39:27 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95679 for review Message-ID: <200604201439.k3KEdR9M059027@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95679 Change 95679 by millert@millert_g5tower on 2006/04/20 14:38:54 Add back avtab_map() since security_get_file_sids() needs it. Expand an instance of avtab_allowed() I missed. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/avtab.c#6 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/avtab.h#6 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/services.c#10 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/avtab.c#6 (text+ko) ==== @@ -238,6 +238,31 @@ h->htable = NULL; } + +int avtab_map(struct avtab *h, + int (*apply) (struct avtab_key *k, + struct avtab_datum *d, + void *args), + void *args) +{ + int i, ret; + struct avtab_node *cur; + + if (!h) + return 0; + + for (i = 0; i < AVTAB_SIZE; i++) { + cur = h->htable[i]; + while (cur != NULL) { + ret = apply(&cur->key, &cur->datum, args); + if (ret) + return ret; + cur = cur->next; + } + } + return 0; +} + int avtab_init(struct avtab *h) { int i; ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/avtab.h#6 (text+ko) ==== @@ -55,6 +55,11 @@ int avtab_init(struct avtab *); struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k); void avtab_destroy(struct avtab *h); +int avtab_map(struct avtab *h, + int (*apply) (struct avtab_key *k, + struct avtab_datum *d, + void *args), + void *args); void avtab_hash_eval(struct avtab *h, char *tag); int avtab_read_item(void *fp, u32 vers, struct avtab *a, ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/ss/services.c#10 (text+ko) ==== @@ -1624,7 +1624,7 @@ if (avk->source_type != p->scon->type || avk->target_class != p->sclass || (specified & AVTAB_AV) == 0 || - (avtab_allowed(avd) & COMMON_FILE__RELABELTO) == 0) + (avd->data & COMMON_FILE__RELABELTO) == 0) return 0; fc.type = avk->target_type;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604201439.k3KEdR9M059027>