Config files don't allow for comments at the end of a line anymore
|Affected Puppet version:||0.25.5||Branch:||https://github.com/masterzen/puppet/tree/tickets/2.7.x/5777|
|Keywords:||fileserver.conf whitespace comments|
Hello, using the latest epel package (http://download.fedora.redhat.com/pub/epel/5/x86_64/puppet-0.25.5-1.el5.noarch.rpm) of puppet (centos 5.5) I initially added a comment like so in the fileserver.conf
[mydir] /dir allow 18.104.22.168 # my comment
this causes puppetmasterd to crash without any particular handy warnings as to why in any log files I could discover. I was able to find it with running ‘puppetmasterd —no-daemonize —debug —logdest console —verbose’ and watching for an error.
No big deal on comments not allowed this way, so I removed the “# my comment” leaving a single white space char “ ” so the entry was “allow 22.214.171.124 ” (space after the last 8) and that also causes puppetmasterd to crash without notice. This white space removal seems like a bug to me, but this is by no means critical. Even if the whitespace thing is on purpose the error message should say something rather then have users hunt for this (imo).
I searched for any known issues like this but did not find any, so if this is a dupe then I’m blind and sorry for wasting someone’s time.
keep up the good work puppet developers!
#4 Updated by Nigel Kersten over 2 years ago
- Subject changed from bug in string handler for fileserver.conf in puppet 0.25.5-1 to Config files don't allow for comments at the end of a line anymore
- Priority changed from High to Low
- Target version changed from 2.6.x to 2.7.x
To update this, it’s not just a fileserver.conf issue. This used to work in 0.24.x, in 0.25.x we broke the ability to have comments at the end of the line.
In 2.6.x, our behavior is:
info: mount[files]: allowing *.example.com # no evil access Could not run: Invalid pattern *.example.com # no evil at /etc/puppetlabs/puppet/fileserver.conf:3
err: /File[/var/opt/lib/pe-puppet # vardir/rrd]/ensure: change from absent to directory failed: Could not set 'directory on ensure: Permission denied - /var/opt/lib/pe-puppet # vardir/rrd Could not run: Got 1 failure(s) while initializing: change from absent to directory failed: Could not set 'directory on ensure: Permission denied - /var/opt/lib/pe-puppet
#9 Updated by Jacob Helwig almost 2 years ago
- Status changed from Accepted to Merged - Pending Release
- Target version changed from 2.7.x to 2.7.3
This has been merged into
2.7.x in commit:5682125e1800f4c7b69b20fdd28f97a473d5d93c and
master in commit:5b167eba2b602f5c6c6c224790fa1eb56b239ad4
This modifies the regex used to match and parse the rules:
commit 6401dfe5602fd39cc59ec1f1b3822110e4ad864a Author: Brice Figureau <firstname.lastname@example.org> Date: Mon May 30 11:31:14 2011 Fix #6026 - security file should support inline comments Auth.conf, namespaceauth.conf and fileserver.conf were not supporting trailing inlined comments. Also this commit fixes some indentation and error management. Signed-off-by: Brice Figureau <email@example.com>