wrfengg / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

scripts/start-memcached: Cannot use # in /etc/memcached.conf #283

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This was originally reported in Ubuntu here:

https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/1005821

What steps will reproduce the problem?
1. create /etc/memcached.conf as:

# This is a comment
-D #

2. run scripts/start-memcached

What is the expected output? What do you see instead?

I would expect memcached to be run with -D # instead memcached is just run 
because the comment checking is a bit naive and filters all lines with any #'s

What version of the product are you using? On what operating system?

1.4.13 on Ubuntu (reported originally on 12.04)

Original Patch author is believed to be this launchpad user:

https://launchpad.net/~kswia

Original issue reported on code.google.com by superama...@gmail.com on 29 Jul 2012 at 6:26

Attachments:

GoogleCodeExporter commented 8 years ago
This patch prevents people from putting comments on the same line as options?

ie:

maxbytes = 12 # 12 megs should be enough for anybody.

uhhh... might need to require "escaping" that char for -D or... I dunno. Don't 
do that? check to see if there're characters after "-D #" ? remove any 
characters after "-D ?".

If I apply as is, within an hour someone will complain about the comment issue, 
I'm sure of it. :)

Original comment by dorma...@rydia.net on 30 Jul 2012 at 12:30

GoogleCodeExporter commented 8 years ago
Good point. Does seem like escaping should be required. I'll poke at a new 
regex.

Original comment by superama...@gmail.com on 31 Jul 2012 at 6:16

GoogleCodeExporter commented 8 years ago
Ok, using lookbehind one can now do what is expected by escaping the # with \

-D \# # This works
# This works
-m 64 # this works

Original comment by superama...@gmail.com on 31 Jul 2012 at 9:39

Attachments: