* [PATCH 3/3] udev_rules_apply_format(): do not process substituted
@ 2007-02-01 15:06 Sergey Vlasov
2007-02-01 15:48 ` Kay Sievers
2007-02-01 19:01 ` Sergey Vlasov
0 siblings, 2 replies; 3+ messages in thread
From: Sergey Vlasov @ 2007-02-01 15:06 UTC (permalink / raw)
To: linux-hotplug
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.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
---
udev_rules.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/udev_rules.c b/udev_rules.c
index 90a83e5..a481712 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -562,6 +562,7 @@ found:
head[len] = '\0';
dbg("truncate to %i chars, subtitution string becomes '%s'", len, head);
}
+ head = strchr(string, '\0');
strlcat(string, temp, maxsize);
}
}
--
1.5.0.rc2.gd894fb
-------------------------------------------------------------------------
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\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 3/3] udev_rules_apply_format(): do not process substituted
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
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2007-02-01 15:48 UTC (permalink / raw)
To: linux-hotplug
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?.
Do you have a special reason to preserve format-chars returned by a program?
Kay
-------------------------------------------------------------------------
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\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] udev_rules_apply_format(): do not process substituted
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
1 sibling, 0 replies; 3+ messages in thread
From: Sergey Vlasov @ 2007-02-01 19:01 UTC (permalink / raw)
To: linux-hotplug
[-- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-01 19:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).