Bug #6026

Config files don't allow for comments at the end of a line anymore

Added by f p over 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:01/27/2011
Priority:HighDue date:
Assignee:-% Done:

0%

Category:-
Target version:2.7.3
Affected Puppet version:0.25.5 Branch:https://github.com/masterzen/puppet/tree/tickets/2.7.x/5777
Keywords:fileserver.conf whitespace comments

Description

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 8.8.8.8 # 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 8.8.8.8 ” (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!


Related issues

Related to Puppet - Bug #5010: Trailing whitespace is not allowed in auth.conf files Closed 10/15/2010
Related to Puppet - Bug #16676: End of line comments in puppet.conf are not treated as co... Closed 10/01/2012

History

#1 Updated by Nigel Kersten over 2 years ago

  • Status changed from Unreviewed to Accepted
  • Priority changed from Normal to High
  • Target version set to 2.6.x

#2 Updated by James Turnbull over 2 years ago

  • Target version changed from 2.6.x to 2.6.6

#3 Updated by James Turnbull over 2 years ago

  • Target version changed from 2.6.6 to 2.6.x

#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

and

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 

#5 Updated by Nigel Kersten over 2 years ago

  • Priority changed from Low to Normal

We actually end up creating directories including the comment name when you do this :(

vardir=/var/lib/puppet  # comment

results in a directory called

"/var/lib/puppet  # comment"

#6 Updated by Nigel Kersten about 2 years ago

  • Priority changed from Normal to High

#7 Updated by Brice Figureau about 2 years ago

  • Branch set to https://github.com/masterzen/puppet/tree/tickets/2.6.x/5777

Fixed as of the 3rd patch in the branch.

#8 Updated by Brice Figureau about 2 years ago

  • Branch changed from https://github.com/masterzen/puppet/tree/tickets/2.6.x/5777 to https://github.com/masterzen/puppet/tree/tickets/2.7.x/5777

rebased the patch on 2.7.x

#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 <brice-puppet@daysofwonder.com>
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 <brice-puppet@daysofwonder.com>

#10 Updated by Michael Stahnke almost 2 years ago

  • Status changed from Merged - Pending Release to Closed

Released as part of 2.7.3rc1

Also available in: Atom PDF