Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675648 - =net-fs/nfs-utils-2.3.3 - /etc/init.d/nfs start doesn't run exportfs -r in some cases
Summary: =net-fs/nfs-utils-2.3.3 - /etc/init.d/nfs start doesn't run exportfs -r in so...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-16 22:05 UTC by bspot
Modified: 2019-09-02 07:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bspot 2019-01-16 22:05:35 UTC
/etc/init.d/nfs start 

only runs exportfs -r when the following condition hold:

/etc/init.d/nfs:91: if grep -qs '^[[:space:]]*/' /etc/exports /etc/exports.d/*.exports ; then

This appears to have the purpose of skipping exportfs -r when there are no exports defined. It fails when all exports are defined with quoted paths.

Steps to reproduce:
1. Create /etc/exports:
"/home/bspot/a dir with spaces" 172.28.128.4(rw)
2. Run /etc/init.d/nfs start
3. Observe that the output is *missing* the line
   * Exporting NFS directories ...     [ ok ]
4. Run exportfs and observe that the output is empty.

Possible fix:
Replace /etc/init.d/nfs:91 with
if grep -qs '^[[:space:]]*[^#]' /etc/exports /etc/exports.d/*.exports ; then
Comment 1 Larry the Git Cow gentoo-dev 2019-09-02 07:08:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71ce315b0913d1562f8c7cfb0e018d3f9e39b60e

commit 71ce315b0913d1562f8c7cfb0e018d3f9e39b60e
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2019-09-02 06:07:43 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2019-09-02 07:08:13 +0000

    net-fs/nfs-utils: Handle quoted export directories
    
    exports(5) says
    
           Blank lines are ignored.  A pound sign ("#") introduces a comment
           to the end of the line. Entries may be continued across newlines
           using a backslash. If an export name contains spaces it  should
           be quoted using double quotes. You can also specify spaces or
           other unusual character in the export name using a backslash
           followed by the character code as three octal digits.
    
    Thus, allow an optional single double-quote character before the /.
    
    Closes: https://bugs.gentoo.org/675648
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 net-fs/nfs-utils/files/nfs.initd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)