Jira (PUP-10710) Disable setting invalid sections in puppet.conf

2020-10-08 Thread Josh Cooper (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Josh Cooper commented on  PUP-10710  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Disable setting invalid sections in puppet.conf
 

  
 
 
 
 

 
 Ah I remembered something about this. Puppet supports specifying environments as a section, see https://puppet.com/docs/puppet/6.18/config_print.html#environments and https://github.com/puppetlabs/puppet/blob/main/lib/puppet/settings.rb#L832. We could at least verify that the section name is [:main, etc] or matches Puppet::Node::Environment.valid_name? A stricter check would be to verify that the environment exists, but that would break cases where the setting is set before the environment is created.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.374366.1602151803000.51819.1602171960086%40Atlassian.JIRA.


Jira (PUP-10710) Disable setting invalid sections in puppet.conf

2020-10-08 Thread Dorin Pleava (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dorin Pleava created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10710  
 
 
  Disable setting invalid sections in puppet.conf
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Affects Versions: 
 PUP 6.18.0  
 
 
Assignee: 
 Unassigned  
 
 
Created: 
 2020/10/08 3:10 AM  
 
 
Priority: 
  Normal  
 
 
Reporter: 
 Dorin Pleava  
 

  
 
 
 
 

 
 Puppet Version: 6.18.0 Puppet Server Version: N/A OS Name/Version: RedHat 8 Puppet does not reject setting an invalid section in puppet.conf via the set command. As the invalid section will be written into puppet.conf, the next time puppet.conf gets parsed, an error will be shown.  
 
 
 
 
 root@unlikely-beggar ~# puppet config set random213  --section random4212 root@unlikely-beggar ~# cat /etc/puppetlabs/puppet/puppet.conf [random4212] random213 =  root@unlikely-beggar ~# puppet config print server Error: Could not parse /etc/puppetlabs/puppet/puppet.conf: Illegal section 'random4212' in config file at (file: /etc/puppetlabs/puppet/puppet.conf, line: 1). The only valid puppet.conf sections are: [main, master, agent, user, server]. Please use the directory environments feature to specify environments. (See https://puppet.com/docs/puppet/latest/environments_about.html) puppet  
 
 
 
    Desired Behavior: Do not allow setting of invalid sections in puppet.conf Actual Behavior: Setting of invalid sections in puppet.conf works only on the first try