FreeBSD/usr.sbin/mountd/mountd.c
/*
 * Hang the dir list element off the dirpath binary tree as required
 * and update the entry for host.
 */
Hang the dir list element off the dirpath binary tree as required
and update the entry for host.
Hang the dir list element off the dirpath binary tree as required and update the entry for host .
static void
hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep,
	int flags)
{
	struct hostlist *hp;
	struct dirlist *dp2;
	if (flags & OP_ALLDIRS) {
		if (ep->ex_defdir)
			free((caddr_t)dp);
		else
			ep->ex_defdir = dp;
		if (grp == (struct grouplist *)NULL) {
			ep->ex_defdir->dp_flag |= DP_DEFSET;
			ep->ex_defnumsecflavors = ep->ex_numsecflavors;
			if (ep->ex_numsecflavors > 0)
				memcpy(ep->ex_defsecflavors, ep->ex_secflavors,
				    sizeof(ep->ex_secflavors));
		} else while (grp) {
			hp = get_ht();
			hp->ht_grp = grp;
			hp->ht_next = ep->ex_defdir->dp_hosts;
			ep->ex_defdir->dp_hosts = hp;
			grp->gr_numsecflavors = ep->ex_numsecflavors;
			if (ep->ex_numsecflavors > 0)
				memcpy(grp->gr_secflavors, ep->ex_secflavors,
				    sizeof(ep->ex_secflavors));
			grp = grp->gr_next;
		}
	} else {
		while (dp) {
			dp2 = dp->dp_left;
			add_dlist(&ep->ex_dirl, dp, grp, flags, ep);
			dp = dp2;
		}
	}
}
static void hang_dirp ( struct dirlist * dp , struct grouplist * grp , struct exportlist * ep , int flags ) { struct hostlist * hp ; struct dirlist * dp2 ; if ( flags & OP_ALLDIRS ) { if ( ep -> ex_defdir ) free ( ( caddr_t ) dp ) ; else ep -> ex_defdir = dp ; if ( grp == ( struct grouplist * ) NULL ) { ep -> ex_defdir -> dp_flag |= DP_DEFSET ; ep -> ex_defnumsecflavors = ep -> ex_numsecflavors ; if ( ep -> ex_numsecflavors > 0 ) memcpy ( ep -> ex_defsecflavors , ep -> ex_secflavors , sizeof ( ep -> ex_secflavors ) ) ; } else while ( grp ) { hp = get_ht ( ) ; hp -> ht_grp = grp ; hp -> ht_next = ep -> ex_defdir -> dp_hosts ; ep -> ex_defdir -> dp_hosts = hp ; grp -> gr_numsecflavors = ep -> ex_numsecflavors ; if ( ep -> ex_numsecflavors > 0 ) memcpy ( grp -> gr_secflavors , ep -> ex_secflavors , sizeof ( ep -> ex_secflavors ) ) ; grp = grp -> gr_next ; } } else { while ( dp ) { dp2 = dp -> dp_left ; add_dlist ( & ep -> ex_dirl , dp , grp , flags , ep ) ; dp = dp2 ; } } }
Hang the dir list element off the dirpath binary tree as required
 and update the entry for host.
Hang the dir list element off the dirpath binary tree as required and update the entry for host .
/* Save the default security flavors list. */ /* Save the security flavors list for this host set. */ /*
		 * Loop through the directories adding them to the tree.
		 */