| 877 | } |
| 878 | |
| 879 | struct ace * copyacl (struct ace *ac){ |
| 880 | struct ace * ret = NULL; |
| 881 | struct iplist *ipl; |
| 882 | struct portlist *pl; |
| 883 | struct userlist *ul; |
| 884 | struct chain *ch; |
| 885 | struct period *pel; |
| 886 | struct hostname *hst; |
| 887 | |
| 888 | ret = ac = itcopy(ac, sizeof(struct ace)); |
| 889 | for( ; ac; ac = ac->next = itcopy(ac->next, sizeof(struct ace))){ |
| 890 | ac->src = itcopy(ac->src, sizeof(struct iplist)); |
| 891 | for(ipl = ac->src; ipl; ipl = ipl->next = itcopy(ipl->next, sizeof(struct iplist))); |
| 892 | ac->dst = itcopy(ac->dst, sizeof(struct iplist)); |
| 893 | for(ipl = ac->dst; ipl; ipl = ipl->next = itcopy(ipl->next, sizeof(struct iplist))); |
| 894 | ac->ports = itcopy(ac->ports, sizeof(struct portlist)); |
| 895 | for(pl = ac->ports; pl; pl = pl->next = itcopy(pl->next, sizeof(struct portlist))); |
| 896 | ac->periods = itcopy(ac->periods, sizeof(struct period)); |
| 897 | for(pel = ac->periods; pel; pel = pel->next = itcopy(pel->next, sizeof(struct period))); |
| 898 | ac->users = itcopy(ac->users, sizeof(struct userlist)); |
| 899 | for(ul = ac->users; ul; ul = ul->next = itcopy(ul->next, sizeof(struct userlist))){ |
| 900 | if(ul->user) ul->user = (unsigned char*)mystrdup((char *)ul->user); |
| 901 | } |
| 902 | ac->dstnames = itcopy(ac->dstnames, sizeof(struct hostname)); |
| 903 | for(hst = ac->dstnames; hst; hst = hst->next = itcopy(hst->next, sizeof(struct hostname))){ |
| 904 | if(hst->name) hst->name = (unsigned char*)mystrdup((char *)hst->name); |
| 905 | } |
| 906 | ac->chains = itcopy(ac->chains, sizeof(struct chain)); |
| 907 | for(ch = ac->chains; ch; ch = ch->next = itcopy(ch->next, sizeof(struct chain))){ |
| 908 | if(ch->extuser)ch->extuser = (unsigned char*)mystrdup((char *)ch->extuser); |
| 909 | if(ch->extpass)ch->extpass = (unsigned char*)mystrdup((char *)ch->extpass); |
| 910 | } |
| 911 | } |
| 912 | return ret; |
| 913 | } |
| 914 | |
| 915 | |
| 916 | void copyfilter (struct filter *filter, struct srvparam *srv){ |
no test coverage detected