Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] nfs-utils: FQDNs in the rmtab causes exportfs to seg fault
Date: Tue, 24 Jun 2008 21:04:17 -0400	[thread overview]
Message-ID: <48619991.5030704@RedHat.com> (raw)

When a FQDN exists in /var/lib/nfs/rmtab it causes 
the exportfs command to seg fault due to the nfs_export pointer 
not being allocated. Reworking the parentheses in rmtab_read() 
so the htype variable is evaluated correctly fix the problem.

Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/support/export/rmtab.c b/support/export/rmtab.c
index 0ce3682..e11a22a 100644
--- a/support/export/rmtab.c
+++ b/support/export/rmtab.c
@@ -31,10 +31,10 @@ rmtab_read(void)
 		int			htype;
 		
 		htype = client_gettype(rep->r_client);
-		if (htype == MCL_FQDN || (htype == MCL_SUBNETWORK
+		if ((htype == MCL_FQDN || htype == MCL_SUBNETWORK)
 		    && (hp = gethostbyname (rep->r_client))
 		    && (hp = hostent_dup (hp),
-			(exp = export_allowed (hp, rep->r_path))))) {
+			exp = export_allowed (hp, rep->r_path))) {
 			/* see if the entry already exists, otherwise this was an instantiated
 			 * wild card, and we must add it
 			 */

                 reply	other threads:[~2008-06-25  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48619991.5030704@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox