Blame SOURCES/nfs-utils-1.3.0-rpcgssd-noerror-message.patch

e19a30
commit fe91df5e1d115015b31bb055ef0b4d5dfdc0635c
e19a30
Author: Steve Dickson <steved@redhat.com>
e19a30
Date:   Tue Jul 8 10:29:52 2014 -0400
e19a30
e19a30
    gssd: Error out when rpc_pipefs directory is empty
e19a30
    
e19a30
    When there is no kernel modules loaded the rpc_pipefs
e19a30
    directory is empty, which cause rpc.gssd to silently
e19a30
    exit.
e19a30
    
e19a30
    This patch adds a check to see if the topdirs_list
e19a30
    is empty. If so error out without dropping a core.
e19a30
    
e19a30
    Signed-off-by: Steve Dickson <steved@redhat.com>
e19a30
e19a30
diff --git a/utils/gssd/gssd_main_loop.c b/utils/gssd/gssd_main_loop.c
e19a30
index 9970028..6946ab6 100644
e19a30
--- a/utils/gssd/gssd_main_loop.c
e19a30
+++ b/utils/gssd/gssd_main_loop.c
e19a30
@@ -173,6 +173,10 @@ topdirs_init_list(void)
e19a30
 		if (ret)
e19a30
 			goto out_err;
e19a30
 	}
e19a30
+	if (TAILQ_EMPTY(&topdirs_list)) {
e19a30
+		printerr(0, "ERROR: rpc_pipefs directory '%s' is empty!\n", pipefs_dir);
e19a30
+		return -1;
e19a30
+	}
e19a30
 	closedir(pipedir);
e19a30
 	return 0;
e19a30
 out_err:
e19a30
@@ -233,9 +237,10 @@ gssd_run()
e19a30
 	sigaddset(&set, DNOTIFY_SIGNAL);
e19a30
 	sigprocmask(SIG_UNBLOCK, &set, NULL);
e19a30
 
e19a30
-	if (topdirs_init_list() != 0)
e19a30
-		return;
e19a30
-
e19a30
+	if (topdirs_init_list() != 0) {
e19a30
+		/* Error msg is already printed */
e19a30
+		exit(1);
e19a30
+	}
e19a30
 	init_client_list();
e19a30
 
e19a30
 	printerr(1, "beginning poll\n");