Blob Blame History Raw
commit fe91df5e1d115015b31bb055ef0b4d5dfdc0635c
Author: Steve Dickson <steved@redhat.com>
Date:   Tue Jul 8 10:29:52 2014 -0400

    gssd: Error out when rpc_pipefs directory is empty
    
    When there is no kernel modules loaded the rpc_pipefs
    directory is empty, which cause rpc.gssd to silently
    exit.
    
    This patch adds a check to see if the topdirs_list
    is empty. If so error out without dropping a core.
    
    Signed-off-by: Steve Dickson <steved@redhat.com>

diff --git a/utils/gssd/gssd_main_loop.c b/utils/gssd/gssd_main_loop.c
index 9970028..6946ab6 100644
--- a/utils/gssd/gssd_main_loop.c
+++ b/utils/gssd/gssd_main_loop.c
@@ -173,6 +173,10 @@ topdirs_init_list(void)
 		if (ret)
 			goto out_err;
 	}
+	if (TAILQ_EMPTY(&topdirs_list)) {
+		printerr(0, "ERROR: rpc_pipefs directory '%s' is empty!\n", pipefs_dir);
+		return -1;
+	}
 	closedir(pipedir);
 	return 0;
 out_err:
@@ -233,9 +237,10 @@ gssd_run()
 	sigaddset(&set, DNOTIFY_SIGNAL);
 	sigprocmask(SIG_UNBLOCK, &set, NULL);
 
-	if (topdirs_init_list() != 0)
-		return;
-
+	if (topdirs_init_list() != 0) {
+		/* Error msg is already printed */
+		exit(1);
+	}
 	init_client_list();
 
 	printerr(1, "beginning poll\n");