Bug 151389

Summary: NFS init script writes "#\n" into empty exports file
Product: [Fedora] Fedora Reporter: Nils Philippsen <nphilipp>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 3Keywords: EasyFix
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-06 07:01:43 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Proposed patch none

Description Nils Philippsen 2005-03-17 10:16:28 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0 StumbleUpon/1.998

Description of problem:
When testing system-config-nfs, I wondered why removing all entries still gave me a non-empty /etc/exports. Using strace revealed that /etc/init.d/nfs actually writes a hash mark into /etc/exports while it is not really necessary (/etc/exports must be readable, but can be empty for the NFS server to function).

Version-Release number of selected component (if applicable):
nfs-utils-1.0.6-52

How reproducible:
Always

Steps to Reproduce:
1. "> /etc/exports"
2. "service nfs restart"
  

Actual Results:  nils@wombat:~> cat /etc/exports
#
nils@wombat:~>

Expected Results:  nils@wombat:~> cat /etc/exports
nils@wombat:~>

Additional info:
Comment 1 Nils Philippsen 2005-03-17 10:23:32 EST
Likewise with nfs-utils-1.0.7-2 on fc4test1.
Comment 2 Nils Philippsen 2005-03-17 10:24:09 EST
Created attachment 112095 [details]
Proposed patch
Comment 3 Nils Philippsen 2005-03-17 10:25:57 EST
The patch above only touches and chmods /etc/exports if it's not xistent or not
readable instead of if it's non-existent or empty.