Skip to content
Permalink
Browse files

A bit nicer checking for incorrect values in mount options

  • Loading branch information...
kobliha committed Nov 12, 2013
1 parent c90bf50 commit bc2ca8df38f5153406354f1ebbb9952acf4a20e2
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/modules/NfsOptions.rb
@@ -142,8 +142,7 @@ def validate(options)

error_message = ""
option_list.each do |opt|
key_value = opt.split("=")
key, value = key_value
key, value, *rest = opt.split("=")
# By now we have filtered out known options without values;
# so what is left is either unknown options, ...
# FIXME: this also triggers for "intr=bogus"
@@ -152,7 +151,7 @@ def validate(options)
# To translators: error popup
error_message = _("Unknown option: '%{key}'") % { :key => key }
# ... or known ones with badly specified values
elsif key_value.size > 2
elsif !rest.empty?
# To translators: error popup
error_message = _("Invalid option: '%{opt}'") % { :opt => opt }
elsif value.nil?

0 comments on commit bc2ca8d

Please sign in to comment.
You can’t perform that action at this time.