Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:Update
nfs-utils.18671
0001-exportfs-Do-not-fail-on-empty-exports-file...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-exportfs-Do-not-fail-on-empty-exports-file.patch of Package nfs-utils.18671
From e725def62c73b4aa269fefc4c0d96abb41927fcb Mon Sep 17 00:00:00 2001 From: Steve Dickson <steved@redhat.com> Date: Mon, 17 Nov 2014 13:17:20 -0500 Subject: [PATCH] exportfs: Do not fail on empty exports file. Commit 076dd80 introduced a regression that causes exportfs to fail when there is an empty /etc/exports file. A empty /etc/exports file is valid and should not cause exportfs to fail. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com> --- support/export/export.c | 17 ++++++++++++----- support/include/exportfs.h | 4 ++-- systemd/nfs-server-generator.c | 4 ++-- utils/exportfs/exportfs.c | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) --- a/support/export/export.c +++ b/support/export/export.c @@ -81,12 +81,13 @@ export_avoid_host_lookup(int i) * */ void -export_read(char *fname) +export_read(char *fname, int verbose) { struct exportent *eep; nfs_export *exp; int volumes = 0; + int bad_entry = 0; setexportent(fname, "r"); while ((eep = getexportent(0,1)) != NULL) { @@ -95,19 +96,25 @@ export_read(char *fname) exp = export_create(eep, assume_canonical); if (exp) volumes++; + else + bad_entry++; } else warn_duplicated_exports(exp, eep); } endexportent(); - if (volumes == 0) - xlog(L_WARNING, "No file systems exported!"); + if (volumes == 0) { + if (bad_entry > 0) + xlog(L_WARNING, "No file systems exported!"); + else if (verbose) + xlog(L_WARNING, "No file systems exported!"); + } } /* Based on mnt_table_parse_dir() in util-linux-ng/shlibs/mount/src/tab_parse.c */ void -export_d_read(const char *dname) +export_d_read(const char *dname, int verbose) { int n = 0, i; struct dirent **namelist = NULL; @@ -150,7 +157,7 @@ export_d_read(const char *dname) continue; } - export_read(fname); + export_read(fname, verbose); } for (i = 0; i < n; i++) --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -134,8 +134,8 @@ int client_member(const char *client const char *name); void export_avoid_host_lookup(int i); -void export_read(char *fname); -void export_d_read(const char *dname); +void export_read(char *fname, int verbose); +void export_d_read(const char *dname, int verbose); void export_reset(nfs_export *); nfs_export * export_lookup(char *hname, char *path, int caconical); nfs_export * export_find(const struct addrinfo *ai, --- a/systemd/nfs-server-generator.c +++ b/systemd/nfs-server-generator.c @@ -128,8 +128,8 @@ int main(int argc, char *argv[]) path = malloc(strlen(argv[1]) + sizeof(dirbase) + sizeof(filebase)); if (!path) exit(2); - export_read(_PATH_EXPORTS); - export_d_read(_PATH_EXPORTS_D); + export_read(_PATH_EXPORTS, 0); + export_d_read(_PATH_EXPORTS_D, 0); strcat(strcpy(path, argv[1]), dirbase); mkdir(path, 0755); --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -187,8 +187,8 @@ main(int argc, char **argv) * to be reliably run before the network is fully up. */ export_avoid_host_lookup(1); - export_read(_PATH_EXPORTS); - export_d_read(_PATH_EXPORTS_D); + export_read(_PATH_EXPORTS, f_verbose); + export_d_read(_PATH_EXPORTS_D, f_verbose); } if (f_export) { if (f_all)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor