[systemd-devel] [RFC PATCH] condition: add ConditionFileContains=

Lennart Poettering lennart at poettering.net
Thu Jul 11 15:43:22 PDT 2013


On Thu, 11.07.13 13:37, Dave Reisner (d at falconindy.com) wrote:

> > +        p = strchr(path, ':');
> 
> This is going to fail for a file:value pair such as /foo:/bar/baz:value.
> You could use strrchr(), but then you have to be concerned about
> matching values with a colon.

This might become a problem, but then again, I think it is OK if some
files cannot be checked with this. I'd prefer using a space or "=" as
separator as a better choice though, as that's probably less frequent
than ":" in the names of files one would check with this condition
setting.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list