• Home
  • Raw
  • Download

Lines Matching refs:newc

290 	ocontext_t *newc = 0, *c, *head;  in define_initial_sid()  local
303 newc = (ocontext_t *) malloc(sizeof(ocontext_t)); in define_initial_sid()
304 if (!newc) { in define_initial_sid()
308 memset(newc, 0, sizeof(ocontext_t)); in define_initial_sid()
309 newc->u.name = id; in define_initial_sid()
310 context_init(&newc->context[0]); in define_initial_sid()
314 if (!strcmp(newc->u.name, c->u.name)) { in define_initial_sid()
321 newc->sid[0] = head->sid[0] + 1; in define_initial_sid()
323 newc->sid[0] = 1; in define_initial_sid()
325 newc->next = head; in define_initial_sid()
326 policydbp->ocontexts[OCON_ISID] = newc; in define_initial_sid()
333 if (newc) in define_initial_sid()
334 free(newc); in define_initial_sid()
4555 ocontext_t *newc, *c, *head; in define_fs_context() local
4568 newc = (ocontext_t *) malloc(sizeof(ocontext_t)); in define_fs_context()
4569 if (!newc) { in define_fs_context()
4573 memset(newc, 0, sizeof(ocontext_t)); in define_fs_context()
4575 newc->u.name = (char *)malloc(6); in define_fs_context()
4576 if (!newc->u.name) { in define_fs_context()
4578 free(newc); in define_fs_context()
4581 sprintf(newc->u.name, "%02x:%02x", major, minor); in define_fs_context()
4583 if (parse_security_context(&newc->context[0])) { in define_fs_context()
4584 free(newc->u.name); in define_fs_context()
4585 free(newc); in define_fs_context()
4588 if (parse_security_context(&newc->context[1])) { in define_fs_context()
4589 context_destroy(&newc->context[0]); in define_fs_context()
4590 free(newc->u.name); in define_fs_context()
4591 free(newc); in define_fs_context()
4597 if (!strcmp(newc->u.name, c->u.name)) { in define_fs_context()
4599 newc->u.name); in define_fs_context()
4600 context_destroy(&newc->context[0]); in define_fs_context()
4601 context_destroy(&newc->context[1]); in define_fs_context()
4602 free(newc->u.name); in define_fs_context()
4603 free(newc); in define_fs_context()
4608 newc->next = head; in define_fs_context()
4609 policydbp->ocontexts[OCON_FS] = newc; in define_fs_context()
4616 ocontext_t *newc, *c, *l, *head; in define_pirq_context() local
4631 newc = malloc(sizeof(ocontext_t)); in define_pirq_context()
4632 if (!newc) { in define_pirq_context()
4636 memset(newc, 0, sizeof(ocontext_t)); in define_pirq_context()
4638 newc->u.pirq = pirq; in define_pirq_context()
4640 if (parse_security_context(&newc->context[0])) { in define_pirq_context()
4641 free(newc); in define_pirq_context()
4657 l->next = newc; in define_pirq_context()
4659 policydbp->ocontexts[OCON_XEN_PIRQ] = newc; in define_pirq_context()
4664 free(newc); in define_pirq_context()
4670 ocontext_t *newc, *c, *l, *head; in define_iomem_context() local
4685 newc = malloc(sizeof(ocontext_t)); in define_iomem_context()
4686 if (!newc) { in define_iomem_context()
4690 memset(newc, 0, sizeof(ocontext_t)); in define_iomem_context()
4692 newc->u.iomem.low_iomem = low; in define_iomem_context()
4693 newc->u.iomem.high_iomem = high; in define_iomem_context()
4697 free(newc); in define_iomem_context()
4701 if (parse_security_context(&newc->context[0])) { in define_iomem_context()
4702 free(newc); in define_iomem_context()
4721 l->next = newc; in define_iomem_context()
4723 policydbp->ocontexts[OCON_XEN_IOMEM] = newc; in define_iomem_context()
4728 free(newc); in define_iomem_context()
4734 ocontext_t *newc, *c, *l, *head; in define_ioport_context() local
4749 newc = malloc(sizeof(ocontext_t)); in define_ioport_context()
4750 if (!newc) { in define_ioport_context()
4754 memset(newc, 0, sizeof(ocontext_t)); in define_ioport_context()
4756 newc->u.ioport.low_ioport = low; in define_ioport_context()
4757 newc->u.ioport.high_ioport = high; in define_ioport_context()
4761 free(newc); in define_ioport_context()
4765 if (parse_security_context(&newc->context[0])) { in define_ioport_context()
4766 free(newc); in define_ioport_context()
4785 l->next = newc; in define_ioport_context()
4787 policydbp->ocontexts[OCON_XEN_IOPORT] = newc; in define_ioport_context()
4792 free(newc); in define_ioport_context()
4798 ocontext_t *newc, *c, *l, *head; in define_pcidevice_context() local
4813 newc = malloc(sizeof(ocontext_t)); in define_pcidevice_context()
4814 if (!newc) { in define_pcidevice_context()
4818 memset(newc, 0, sizeof(ocontext_t)); in define_pcidevice_context()
4820 newc->u.device = device; in define_pcidevice_context()
4822 if (parse_security_context(&newc->context[0])) { in define_pcidevice_context()
4823 free(newc); in define_pcidevice_context()
4840 l->next = newc; in define_pcidevice_context()
4842 policydbp->ocontexts[OCON_XEN_PCIDEVICE] = newc; in define_pcidevice_context()
4847 free(newc); in define_pcidevice_context()
4853 ocontext_t *newc, *c, *l, *head; in define_devicetree_context() local
4866 newc = malloc(sizeof(ocontext_t)); in define_devicetree_context()
4867 if (!newc) { in define_devicetree_context()
4871 memset(newc, 0, sizeof(ocontext_t)); in define_devicetree_context()
4873 newc->u.name = (char *)queue_remove(id_queue); in define_devicetree_context()
4874 if (!newc->u.name) { in define_devicetree_context()
4875 free(newc); in define_devicetree_context()
4879 if (parse_security_context(&newc->context[0])) { in define_devicetree_context()
4880 free(newc->u.name); in define_devicetree_context()
4881 free(newc); in define_devicetree_context()
4887 if (strcmp(newc->u.name, c->u.name) == 0) { in define_devicetree_context()
4888 yyerror2("duplicate devicetree entry for '%s'", newc->u.name); in define_devicetree_context()
4894 l->next = newc; in define_devicetree_context()
4896 policydbp->ocontexts[OCON_XEN_DEVICETREE] = newc; in define_devicetree_context()
4901 free(newc->u.name); in define_devicetree_context()
4902 free(newc); in define_devicetree_context()
4908 ocontext_t *newc, *c, *l, *head; in define_port_context() local
4924 newc = malloc(sizeof(ocontext_t)); in define_port_context()
4925 if (!newc) { in define_port_context()
4929 memset(newc, 0, sizeof(ocontext_t)); in define_port_context()
4933 free(newc); in define_port_context()
4949 newc->u.port.protocol = protocol; in define_port_context()
4950 newc->u.port.low_port = low; in define_port_context()
4951 newc->u.port.high_port = high; in define_port_context()
4958 if (parse_security_context(&newc->context[0])) { in define_port_context()
4985 l->next = newc; in define_port_context()
4987 policydbp->ocontexts[OCON_PORT] = newc; in define_port_context()
4994 free(newc); in define_port_context()
5000 ocontext_t *newc, *c, *l, *head; in define_ibpkey_context() local
5017 newc = malloc(sizeof(*newc)); in define_ibpkey_context()
5018 if (!newc) { in define_ibpkey_context()
5022 memset(newc, 0, sizeof(*newc)); in define_ibpkey_context()
5052 memcpy(&newc->u.ibpkey.subnet_prefix, &subnet_prefix.s6_addr[0], in define_ibpkey_context()
5053 sizeof(newc->u.ibpkey.subnet_prefix)); in define_ibpkey_context()
5055 newc->u.ibpkey.low_pkey = low; in define_ibpkey_context()
5056 newc->u.ibpkey.high_pkey = high; in define_ibpkey_context()
5064 rc = parse_security_context(&newc->context[0]); in define_ibpkey_context()
5077 c->u.ibpkey.subnet_prefix == newc->u.ibpkey.subnet_prefix) { in define_ibpkey_context()
5084 c->u.ibpkey.subnet_prefix == newc->u.ibpkey.subnet_prefix) { in define_ibpkey_context()
5093 l->next = newc; in define_ibpkey_context()
5095 policydbp->ocontexts[OCON_IBPKEY] = newc; in define_ibpkey_context()
5100 free(newc); in define_ibpkey_context()
5106 ocontext_t *newc, *c, *l, *head; in define_ibendport_context() local
5127 newc = malloc(sizeof(*newc)); in define_ibendport_context()
5128 if (!newc) { in define_ibendport_context()
5132 memset(newc, 0, sizeof(*newc)); in define_ibendport_context()
5134 newc->u.ibendport.dev_name = queue_remove(id_queue); in define_ibendport_context()
5135 if (!newc->u.ibendport.dev_name) { in define_ibendport_context()
5141 if (strlen(newc->u.ibendport.dev_name) > IB_DEVICE_NAME_MAX - 1) { in define_ibendport_context()
5147 newc->u.ibendport.port = port; in define_ibendport_context()
5149 if (parse_security_context(&newc->context[0])) { in define_ibendport_context()
5150 free(newc); in define_ibendport_context()
5163 newc->u.ibendport.dev_name)) { in define_ibendport_context()
5165 newc->u.ibendport.dev_name, port); in define_ibendport_context()
5172 l->next = newc; in define_ibendport_context()
5174 policydbp->ocontexts[OCON_IBENDPORT] = newc; in define_ibendport_context()
5179 free(newc->u.ibendport.dev_name); in define_ibendport_context()
5180 free(newc); in define_ibendport_context()
5186 ocontext_t *newc, *c, *head; in define_netif_context() local
5200 newc = (ocontext_t *) malloc(sizeof(ocontext_t)); in define_netif_context()
5201 if (!newc) { in define_netif_context()
5205 memset(newc, 0, sizeof(ocontext_t)); in define_netif_context()
5207 newc->u.name = (char *)queue_remove(id_queue); in define_netif_context()
5208 if (!newc->u.name) { in define_netif_context()
5209 free(newc); in define_netif_context()
5212 if (parse_security_context(&newc->context[0])) { in define_netif_context()
5213 free(newc->u.name); in define_netif_context()
5214 free(newc); in define_netif_context()
5217 if (parse_security_context(&newc->context[1])) { in define_netif_context()
5218 context_destroy(&newc->context[0]); in define_netif_context()
5219 free(newc->u.name); in define_netif_context()
5220 free(newc); in define_netif_context()
5226 if (!strcmp(newc->u.name, c->u.name)) { in define_netif_context()
5228 newc->u.name); in define_netif_context()
5229 context_destroy(&newc->context[0]); in define_netif_context()
5230 context_destroy(&newc->context[1]); in define_netif_context()
5231 free(newc->u.name); in define_netif_context()
5232 free(newc); in define_netif_context()
5237 newc->next = head; in define_netif_context()
5238 policydbp->ocontexts[OCON_NETIF] = newc; in define_netif_context()
5247 ocontext_t *newc, *c, *l, *head; in define_ipv4_node_context() local
5293 newc = malloc(sizeof(ocontext_t)); in define_ipv4_node_context()
5294 if (!newc) { in define_ipv4_node_context()
5300 memset(newc, 0, sizeof(ocontext_t)); in define_ipv4_node_context()
5301 newc->u.node.addr = addr.s_addr; in define_ipv4_node_context()
5302 newc->u.node.mask = mask.s_addr; in define_ipv4_node_context()
5304 if (parse_security_context(&newc->context[0])) { in define_ipv4_node_context()
5305 free(newc); in define_ipv4_node_context()
5313 if (newc->u.node.mask > c->u.node.mask) in define_ipv4_node_context()
5317 newc->next = c; in define_ipv4_node_context()
5320 l->next = newc; in define_ipv4_node_context()
5322 policydbp->ocontexts[OCON_NODE] = newc; in define_ipv4_node_context()
5333 ocontext_t *newc, *c, *l, *head; in define_ipv6_node_context() local
5379 newc = malloc(sizeof(ocontext_t)); in define_ipv6_node_context()
5380 if (!newc) { in define_ipv6_node_context()
5386 memset(newc, 0, sizeof(ocontext_t)); in define_ipv6_node_context()
5387 memcpy(&newc->u.node6.addr[0], &addr.s6_addr[0], 16); in define_ipv6_node_context()
5388 memcpy(&newc->u.node6.mask[0], &mask.s6_addr[0], 16); in define_ipv6_node_context()
5390 if (parse_security_context(&newc->context[0])) { in define_ipv6_node_context()
5391 free(newc); in define_ipv6_node_context()
5400 if (memcmp(&newc->u.node6.mask, &c->u.node6.mask, 16) > 0) in define_ipv6_node_context()
5404 newc->next = c; in define_ipv6_node_context()
5407 l->next = newc; in define_ipv6_node_context()
5409 policydbp->ocontexts[OCON_NODE6] = newc; in define_ipv6_node_context()
5418 ocontext_t *newc, *c, *head; in define_fs_use() local
5431 newc = (ocontext_t *) malloc(sizeof(ocontext_t)); in define_fs_use()
5432 if (!newc) { in define_fs_use()
5436 memset(newc, 0, sizeof(ocontext_t)); in define_fs_use()
5438 newc->u.name = (char *)queue_remove(id_queue); in define_fs_use()
5439 if (!newc->u.name) { in define_fs_use()
5440 free(newc); in define_fs_use()
5443 newc->v.behavior = behavior; in define_fs_use()
5444 if (parse_security_context(&newc->context[0])) { in define_fs_use()
5445 free(newc->u.name); in define_fs_use()
5446 free(newc); in define_fs_use()
5453 if (!strcmp(newc->u.name, c->u.name)) { in define_fs_use()
5455 newc->u.name); in define_fs_use()
5456 context_destroy(&newc->context[0]); in define_fs_use()
5457 free(newc->u.name); in define_fs_use()
5458 free(newc); in define_fs_use()
5463 newc->next = head; in define_fs_use()
5464 policydbp->ocontexts[OCON_FSUSE] = newc; in define_fs_use()
5471 ocontext_t *newc, *c, *head, *p; in define_genfs_context_helper() local
5516 newc = (ocontext_t *) malloc(sizeof(ocontext_t)); in define_genfs_context_helper()
5517 if (!newc) { in define_genfs_context_helper()
5521 memset(newc, 0, sizeof(ocontext_t)); in define_genfs_context_helper()
5523 newc->u.name = (char *)queue_remove(id_queue); in define_genfs_context_helper()
5524 if (!newc->u.name) in define_genfs_context_helper()
5568 newc->v.sclass = cladatum->s.value; in define_genfs_context_helper()
5570 if (parse_security_context(&newc->context[0])) in define_genfs_context_helper()
5576 if (!strcmp(newc->u.name, c->u.name) && in define_genfs_context_helper()
5577 (!newc->v.sclass || !c->v.sclass in define_genfs_context_helper()
5578 || newc->v.sclass == c->v.sclass)) { in define_genfs_context_helper()
5580 genfs->fstype, newc->u.name); in define_genfs_context_helper()
5583 len = strlen(newc->u.name); in define_genfs_context_helper()
5589 newc->next = c; in define_genfs_context_helper()
5591 p->next = newc; in define_genfs_context_helper()
5593 genfs->head = newc; in define_genfs_context_helper()
5599 context_destroy(&newc->context[0]); in define_genfs_context_helper()
5602 if (newc->u.name) in define_genfs_context_helper()
5603 free(newc->u.name); in define_genfs_context_helper()
5604 free(newc); in define_genfs_context_helper()