X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Frmtab.c;h=844de511f48b07d76baac5b0b828b9e5520af33f;hp=8c4a5a978de904888bf9a5495b52095774fffeac;hb=refs%2Ftags%2Fnfs-utils-1-0-5-post1;hpb=9e07f5fc946f63e32028f860566c34432059c179 diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c index 8c4a5a9..844de51 100644 --- a/utils/mountd/rmtab.c +++ b/utils/mountd/rmtab.c @@ -46,7 +46,7 @@ slink_safe_rename(const char * oldpath, const char * newpath) } void -mountlist_add(nfs_export *exp, const char *path) +mountlist_add(char *host, const char *path) { struct rmtabent xe; struct rmtabent *rep; @@ -58,7 +58,7 @@ mountlist_add(nfs_export *exp, const char *path) setrmtabent("r+"); while ((rep = getrmtabent(1, &pos)) != NULL) { if (strcmp (rep->r_client, - exp->m_client->m_hostname) == 0 + host) == 0 && strcmp(rep->r_path, path) == 0) { rep->r_count++; putrmtabent(rep, &pos); @@ -68,7 +68,7 @@ mountlist_add(nfs_export *exp, const char *path) } } endrmtabent(); - strncpy(xe.r_client, exp->m_client->m_hostname, + strncpy(xe.r_client, host, sizeof (xe.r_client) - 1); xe.r_client [sizeof (xe.r_client) - 1] = '\0'; strncpy(xe.r_path, path, sizeof (xe.r_path) - 1); @@ -82,11 +82,10 @@ mountlist_add(nfs_export *exp, const char *path) } void -mountlist_del(nfs_export *exp, const char *path) +mountlist_del(char *hname, const char *path) { struct rmtabent *rep; FILE *fp; - char *hname = exp->m_client->m_hostname; int lockid; int match;