Bug #6793

mount provider fails when paths have a trailing slash

Added by John Spray about 2 years ago. Updated 6 days ago.

Status:Merged - Pending ReleaseStart date:03/21/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:mount
Target version:3.3.0
Affected Puppet version:2.6.6 Branch:https://github.com/puppetlabs/puppet/pull/1699
Keywords:

Description

A resource like “/mnt/foo” works fine, but “/mnt/foo/” only works on the first mount. On subsequent runs, puppet incorrectly determines the state as unmounted, tries to mount it, and fails.

This is because of puppet/provider/mount.rb function “mounted?” which searches for resource[:name] in the output of mount. Mount never prints the trailing slash, so puppet things the mount isn’t there.

It should either reject as invalid resources with a trailing slash, or make sure that they are correctly recognised when mounted.


Related issues

Related to Puppet - Feature #7188: Mount provider/type split for Solaris Needs Decision 04/20/2011

History

#1 Updated by Stefan Schulte about 2 years ago

  • Category set to mount

#2 Updated by Ben Hughes about 2 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

Thank you for doing the ground work with the problem, very helpful. While it’s only a small change to do the right thing, mounts are the kind of things you really don’t want to break!

I guess the options are:

  • warn/error in the parser about a “/” on the end.
  • Make the regexp take in to account a trailing “/” in lib/puppet/provider/mount.rb
  • Keep the current, safer mechanism and document it accordingly.

The reason I say the latter is safe as there’s less “magic” involved.

Perhaps even taking this to puppet-users?

#3 Updated by Nigel Kersten about 2 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Nigel Kersten)
  • Target version set to 2.7.x

We’re going to prohibit trailing slashes in the type, because of the uncertain semantics on exotic platforms when it is supplied.

This will mean that existing resources with a trailing slash will no longer parse, but they were causing the above issue for users anyway.

This must be called out loudly in the release notes.

#4 Updated by Christian Ruppert 7 months ago

I think, trailing slashes should just be removed/ignored when parsing it.

Actually any directory path should have a trailing slash to make it easier for other, to know whether it’s a file or a directory. For mount, ok.. it’s actually ok to not add a trailing slash because mount is pretty clear although I think it wouldn’t hurt to just ignore/strip it anyway. But that should be really be made in the parser as it will also add duplicate fstab entries.

#5 Updated by Andrew Parker 6 months ago

  • Target version deleted (2.7.x)

#6 Updated by Andrew Parker 6 months ago

As the 2.7.x line is winding down, I am removing the target at 2.7.x from tickets in the system. The 2.7 line should only receive fixes for major problems (crashes, for instance) or security problems.

#7 Updated by Adrien Thebo 6 days ago

  • Status changed from Accepted to Merged - Pending Release
  • Target version set to 3.3.0
  • Branch set to https://github.com/puppetlabs/puppet/pull/1699

Issue fixed in PR/1699 and merged into master in 67e1ff6. This should be released in 3.3.0.

Also available in: Atom PDF