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

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