nfs is left to an inconsistent state when /etc/default/nfs-* parameters have options without quotes

Bug #883257 reported by Leonardo Borda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
New
Low
Unassigned

Bug Description

When a space+option is left without quotes in NEED_IDMAPD it leaves nfs to an inconsistent state upon start.

Steps to reproduce
1. in /etc/default/nfs-common change NEED_IDMAPD= to
NEED_IDMAPD= yes
2. stop idmapd, start idmapd

This is probably caused by /etc/init/idmapd that runs the following code.
env DEFAULTFILE=/etc/default/nfs-common
 if [ -f "$DEFAULTFILE" ]; then
  . "$DEFAULTFILE"
 fi

In this case NEED_IDMAPD is empty which causes issues when starting the service.

PS: in my tests since /etc/init/idmapd.conf tries to source the variable NEED_IDMAPD= yes ( without quotes ), it also starts the following linux util /usr/bin/yes :-P

I know having spaces in variable assignment must not happen without quotes though we should find a way of enforcing or sanitize variables.

Leonardo

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: nfs-common 1:1.2.2-4ubuntu5.1
Uname: Linux 2.6.39-020639rc4-generic i686
Architecture: i386
Date: Fri Oct 28 15:33:08 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110426)
ProcEnviron:
 LANGUAGE=en_CA:en
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: nfs-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Leonardo Borda (lborda) wrote :
Revision history for this message
Steve Langasek (vorlon) wrote :

> I know having spaces in variable assignment must not happen without
> quotes though we should find a way of enforcing or sanitize variables.

I don't agree. We should instead make it unnecessary to ever edit this file.

(BTW, NEED_IDMAPD= is no longer supported as of the latest nfs-utils upload to precise; idmapd is always started.)

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

It could have 'FOO=""', showing that the options should be inserted inside the quotes..

Changed in nfs-utils (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.