~ubuntu-branches/ubuntu/oneiric/nfs-utils/oneiric

« back to all changes in this revision

Viewing changes to support/export/export.c

  • Committer: Steve Langasek
  • Date: 2010-06-04 09:53:57 UTC
  • mfrom: (14.1.5 sid)
  • Revision ID: vorlon@debian.org-20100604095357-zbu3na972v3nmgvg
mergeĀ versionĀ 1:1.2.2-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
static nfs_export *
29
29
                export_allowed_internal(struct hostent *hp, char *path);
30
30
 
 
31
static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
 
32
{
 
33
        if (exp->m_export.e_flags != eep->e_flags) {
 
34
                xlog(L_ERROR, "incompatible duplicated export entries:");
 
35
                xlog(L_ERROR, "\t%s:%s (0x%x) [IGNORED]", eep->e_hostname,
 
36
                                eep->e_path, eep->e_flags);
 
37
                xlog(L_ERROR, "\t%s:%s (0x%x)", exp->m_export.e_hostname,
 
38
                                exp->m_export.e_path, exp->m_export.e_flags);
 
39
        } else {
 
40
                xlog(L_ERROR, "duplicated export entries:");
 
41
                xlog(L_ERROR, "\t%s:%s", eep->e_hostname, eep->e_path);
 
42
                xlog(L_ERROR, "\t%s:%s", exp->m_export.e_hostname,
 
43
                                exp->m_export.e_path);
 
44
        }
 
45
}
 
46
 
31
47
int
32
48
export_read(char *fname)
33
49
{
36
52
 
37
53
        setexportent(fname, "r");
38
54
        while ((eep = getexportent(0,1)) != NULL) {
39
 
          exp = export_lookup(eep->e_hostname, eep->e_path, 0);
40
 
          if (!exp)
41
 
            export_create(eep,0);
42
 
          else {
43
 
            if (exp->m_export.e_flags != eep->e_flags) {
44
 
              xlog(L_ERROR, "incompatible duplicated export entries:");
45
 
              xlog(L_ERROR, "\t%s:%s (0x%x) [IGNORED]", eep->e_hostname,
46
 
                   eep->e_path, eep->e_flags);
47
 
              xlog(L_ERROR, "\t%s:%s (0x%x)", exp->m_export.e_hostname,
48
 
                   exp->m_export.e_path, exp->m_export.e_flags);
49
 
            }
50
 
            else {
51
 
              xlog(L_ERROR, "duplicated export entries:");
52
 
              xlog(L_ERROR, "\t%s:%s", eep->e_hostname, eep->e_path);
53
 
              xlog(L_ERROR, "\t%s:%s", exp->m_export.e_hostname,
54
 
                   exp->m_export.e_path);
55
 
            }
56
 
          }
 
55
                exp = export_lookup(eep->e_hostname, eep->e_path, 0);
 
56
                if (!exp)
 
57
                        export_create(eep, 0);
 
58
                else
 
59
                        warn_duplicated_exports(exp, eep);
57
60
        }
58
61
        endexportent();
59
 
 
60
62
        return 0;
61
63
}
62
64