mountall ignores NFS mount option "timeo"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mountall (Ubuntu) |
Fix Released
|
Medium
|
Dave Chiluk | ||
Precise |
Fix Released
|
Medium
|
Dave Chiluk | ||
Quantal |
Fix Released
|
Medium
|
Dave Chiluk | ||
Raring |
Fix Released
|
Medium
|
Dave Chiluk |
Bug Description
If the mount option "timeo" is specified for an NFS mount in /etc/fstab,
mountall does not pass it to mount.nfs. The bug is in the function
cut_options() in mountall.c. It is called with the following arguments:
opts = cut_options (NULL, mnt, "showthrough", "optional",
Although it should only remove the specified options, it also removes
any option that is a prefix of one of those, e.g. "timeo".
The call to strncmp() in line 661 compares only up to the length of the
option from the fstab, without comparing the length of both strings.
Hence I propose the following patch:
*(updated patch in comment #6).
--- mountall-
+++ mountall-
@@ -658,7 +658,8 @@
{
- if (j && ! strncmp (opts + i, option, j))
+ if (j && option[j] == '\0'
+ && ! strncmp (opts + i, option, j))
}
[Impact]
Mounts that have options that are substrings of (showthrough, optional, bootwait, nobootwait or timeout) Are being stripped by mountall and not being passed to the mount. Such is the case of timeo in nfs.
The change is minimal, and simply checks that the option being stripped matches the length of option being checked against. This solves the case where one is a substring of the other.
[Test Case]
1. Create an nfs mount option in /etc/fstab with the timeo=2 option. Like the below.
server:/raid /raid nfs user,timeo=
2. Run mountall as root
3. run mount and verify that the nfs mount specified above has the options user,timeo=2 , but not timeout=6.
[Regression Potential]
Regression potential is minimal, but regressions are most likely to manifest themselves in mount options disappearing or new options appearing (some new options appearing will be valid as is the case of timeo).
Changed in mountall (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: precise |
Changed in mountall (Ubuntu Precise): | |
importance: | Undecided → Medium |
Changed in mountall (Ubuntu Quantal): | |
importance: | Undecided → Medium |
Changed in mountall (Ubuntu Precise): | |
assignee: | nobody → Dave Chiluk (chiluk) |
Changed in mountall (Ubuntu Quantal): | |
assignee: | nobody → Dave Chiluk (chiluk) |
Changed in mountall (Ubuntu Raring): | |
assignee: | nobody → Chris J Arges (christopherarges) |
assignee: | Chris J Arges (christopherarges) → Dave Chiluk (chiluk) |
Changed in mountall (Ubuntu Quantal): | |
status: | New → Confirmed |
Changed in mountall (Ubuntu Precise): | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
tags: |
added: verification-done-precise verification-needed removed: verification-done |
I've tested and verified the above fix with the above linked branches. Please consider this for raring and an sru for precise and quantal.