diff options
author | Steve Dickson <steved@redhat.com> | 2014-07-08 10:29:52 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-07-09 15:09:26 -0400 |
commit | fe91df5e1d115015b31bb055ef0b4d5dfdc0635c (patch) | |
tree | 1ef7819e54b20fedfc3d39638222fd214a74c8a0 | |
parent | 595a390d612c22e9888ed547727f09a9e2a961cf (diff) | |
download | nfs-utils-fe91df5e1d115015b31bb055ef0b4d5dfdc0635c.tar.gz nfs-utils-fe91df5e1d115015b31bb055ef0b4d5dfdc0635c.tar.xz nfs-utils-fe91df5e1d115015b31bb055ef0b4d5dfdc0635c.zip |
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>
-rw-r--r-- | utils/gssd/gssd_main_loop.c | 11 |
1 files changed, 8 insertions, 3 deletions
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"); |