From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Vlasov Date: Thu, 01 Feb 2007 19:01:58 +0000 Subject: Re: [PATCH 3/3] udev_rules_apply_format(): do not process substituted Message-Id: <20070201190158.GB6381@procyon.home> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0285821952==" List-Id: References: <1170342385293-git-send-email-vsu@altlinux.ru> In-Reply-To: <1170342385293-git-send-email-vsu@altlinux.ru> To: linux-hotplug@vger.kernel.org --===============0285821952== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 01, 2007 at 04:48:30PM +0100, Kay Sievers wrote: > On 2/1/07, Sergey Vlasov 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. >=20 > 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 progr= am? 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. --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFwjkmW82GfkQfsqIRAhoFAJ4hHiP6eKAVxLJwnrTnim6j9NBrwQCfR2Q7 OXhUjkDJ+snEovuHaNTy2Xc= =mpFq -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4-- --===============0285821952== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --===============0285821952== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0285821952==--