[augeas-devel] Re: [Augeas] #48: sudoers lens does not handle multiline strings

Augeas trac at fedorahosted.org
Sat Mar 21 21:32:36 UTC 2009


#48: sudoers lens does not handle multiline strings
------------------------+---------------------------------------------------
  Reporter:  fsweetser  |       Owner:  raphink 
      Type:  defect     |      Status:  assigned
  Priority:  minor      |   Milestone:  next    
 Component:  Augeas     |     Version:  0.4.1   
Resolution:             |    Keywords:  sudoers 
------------------------+---------------------------------------------------
Comment (by raphink):

 Here is at least one thing that doesn't work with this patch :[[BR]]

 Let's say we have an env_keep with only one value put within double quotes
 (which is optional, but possible) :[[BR]]


 Defaults env_keep = "TEST"[[BR]]


 which will get mapped as[[BR]]
 /files/etc/sudoers/Defaults/env_keep[[BR]]
 /files/etc/sudoers/Defaults/env_keep/var[1] = "\"TEST\""[[BR]]


 If we add a second variable to this env_keep, we will get :[[BR]]
 /files/etc/sudoers/Defaults/env_keep[[BR]]
 /files/etc/sudoers/Defaults/env_keep/var[1] = "\"TEST\""[[BR]]
 /files/etc/sudoers/Defaults/env_keep/var[2] = "TEST2"[[BR]]

 which fails to save because "\"TEST\"" is only an acceptable value if you
 have only one variable. [[BR]]

 On the other hand, the options to fix this are :[[BR]]

 * force the use of double quotes for all number of variables, even if
 there is only one. In this case, Augeas will not be able to parse a single
 variable without double quotes...[[BR]]

 * consider that double quotes are not part of the value when it's a single
 value, but ignore them instead. In that case, the double quotes will have
 to be optional on both sides of the value, hence independent from one
 another, so that '"TEST' will be an acceptable value, eventhough it is not
 correct in the sudoers format.

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/48#comment:3>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list