[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] comment stripping in config files

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-04-27 20:16:21 CEST

There was an interesting post on the users list a while back about
comments in authz files having interesting (read: bad) effects on your
authz configuration.

If you have something like

[/foo]
* = # don't let anyone read foo

That actually gives everyone read access to foo because we check for
read access by doing a strchr(line, 'r'), and the line, against all
logic, includes the comment.

I've got a patch to fix this by stripping comments from values in the
config parser code, but I hesitate to change the behavior of this sort
of thing since someone might depend on it. Does anyone want to tell
me "you're being paranoid, this is insane, just commit it"?

Alternatively I can go make the authz code smart enough to avoid the
comments, but it feels more "Right" to fix it in the config parser.

-garrett

[[[
Strip comments from values in the config parser.

* subversion/libsvn_subr/config.c
  (make_string_from_option): Strip out everything after a # character.

* subversion/tests/libsvn_subr/config-test.cfg: Add a new section for the
  comments stripping test.

* subversion/tests/libsvn_subr/config-test.c
  (test_comments): New test.
  (test_funcs): Add the new test.
]]]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Apr 27 20:17:00 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.