X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmountd%2Fcache.c;h=caef5b235c692804af81e2c3a569ef43d5928807;hb=refs%2Ftags%2Fnfs-utils-1-2-3-rc3;hp=45397db66dcd8c66d36aad9f6608456ab16cf1de;hpb=a064fde8c2615333227de97d159bb338d4ac640d;p=nfs-utils.git diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 45397db..caef5b2 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -614,12 +614,12 @@ static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *ex return qword_eol(f); } -static int is_subdirectory(char *subpath, char *path) +static int is_subdirectory(char *child, char *parent) { - int l = strlen(path); + int l = strlen(parent); - return strcmp(subpath, path) == 0 - || (strncmp(subpath, path, l) == 0 && subpath[l] == '/'); + return strcmp(child, parent) == 0 + || (strncmp(child, parent, l) == 0 && child[l] == '/'); } static int path_matches(nfs_export *exp, char *path) @@ -863,6 +863,7 @@ int cache_export_ent(char *domain, struct exportent *exp, char *path) int cache_export(nfs_export *exp, char *path) { + struct sockaddr_in *sin = get_addrlist_in(exp->m_client, 0); int err; FILE *f; @@ -871,7 +872,7 @@ int cache_export(nfs_export *exp, char *path) return -1; qword_print(f, "nfsd"); - qword_print(f, inet_ntoa(exp->m_client->m_addrlist[0])); + qword_print(f, inet_ntoa(sin->sin_addr)); qword_printint(f, time(0)+30*60); qword_print(f, exp->m_client->m_hostname); err = qword_eol(f);