From: Sergey Vlasov <vsu@altlinux.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH 3/3] udev_rules_apply_format(): do not process substituted
Date: Thu, 01 Feb 2007 19:01:58 +0000 [thread overview]
Message-ID: <20070201190158.GB6381@procyon.home> (raw)
In-Reply-To: <1170342385293-git-send-email-vsu@altlinux.ru>
[-- Attachment #1.1: Type: text/plain, Size: 1876 bytes --]
On Thu, Feb 01, 2007 at 04:48:30PM +0100, Kay Sievers wrote:
> On 2/1/07, Sergey Vlasov <vsu@altlinux.ru> wrote:
> >Substituted values may contain parts which look like format elements,
> >but they must not be interpreted as such, so skip the substituted
> >value before looking for more format elements.
>
> I've seen people using this and returning format chars for further
> substitution. We also have a test for it, it break "make test",
> right?.
Oops, sorry. (Running these tests is a hassle, because they need root
permissions, therefore they cannot be run automatically when building
the package; and tests for big majors fail on XFS with 2.6.18 -
apparently this FS does not support them.)
> Do you have a special reason to preserve format-chars returned by a program?
The main problem is vol_id, which happily passes these chars into
ID_FS_LABEL_SAFE, where they then expand to something unexpected (or
even crash the event handling process if the label is something like
"%1000000m" - one of my patches fixes that bug). Should vol_id (and
other *_id programs) escape these characters? But then quoting would
become incompatible with shell (which, BTW, is also broken now; spaces
in the label break even udev, and '\n' leads to a complete disaster).
Also, this recursive expansion is unexpected in general and does not
seem to be documented in udev(7) (the man page says "printf-like",
which suggests non-recursive behavior). AFAIK, only m4 has similar
recursive expansion (and it is also very hard to use properly). I
understand that this feature could be useful, but it needs to be
documented in the man page in big letters - otherwise people will
continue to write unsafe rules.
In summary, all those expansion and quoting at various places needs to
be checked, documented and in most cases fixed to behave properly.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 374 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
prev parent reply other threads:[~2007-02-01 19:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 15:06 [PATCH 3/3] udev_rules_apply_format(): do not process substituted Sergey Vlasov
2007-02-01 15:48 ` Kay Sievers
2007-02-01 19:01 ` Sergey Vlasov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070201190158.GB6381@procyon.home \
--to=vsu@altlinux.ru \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).