2 * support/export/rmntab.c
4 * Interface to the rmnt file.
27 while ((rep = getrmtabent(1)) != NULL) {
28 exp = export_lookup(rep->r_client, rep->r_path);
34 htype = client_gettype(rep->r_client);
36 && (hp = gethostbyname (rep->r_client), hp)
37 && (hp = hostent_dup (hp),
38 xp = export_allowed (hp, rep->r_path))) {
39 strncpy (xp->e_hostname, rep->r_client,
40 sizeof (xp->e_hostname) - 1);
41 xp->e_hostname[sizeof (xp->e_hostname) -1] = '\0';
42 exp = export_create(xp);
51 if (errno == EINVAL) {
52 /* Something goes wrong. We need to fix the rmtab
56 if ((lockid = xflock(_PATH_RMTAB, "w")) < 0)
59 if (!(fp = fsetrmtabent(_PATH_RMTABTMP, "w"))) {
64 while ((rep = getrmtabent(0)) != NULL) {
65 fputrmtabent(fp, rep);
67 if (rename(_PATH_RMTABTMP, _PATH_RMTAB) < 0) {
68 xlog(L_ERROR, "couldn't rename %s to %s",
69 _PATH_RMTABTMP, _PATH_RMTAB);