Summary: | portage can't handle embedded quotes in env.d/* files | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Ryan Koski <ryan> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | InVCS |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 147007 | ||
Attachments: |
files/conf-escaped-quotes.patch
support escaped quotes with shlex posix mode don't try to expand variables in env.d values |
Description
Ryan Koski
2003-01-19 21:52:34 UTC
Created attachment 8767 [details, diff]
files/conf-escaped-quotes.patch
Here's a fix for this problem. When aquiring a double-quoted string token, it
checks to see if it ends with '\"', and if so removes the last double-quote
and backs up the input stream by a byte before calling get_token again. This
sort of kludge is necessary due to the utter lack of sophistication in the
shlex parsing engine.
This patch also causes Portage to report filenames and line numbers that errors
occur on, which can aid greatly in tracking down where problems lie.
After some horsing around I have applied the patch to stable ( 2.0.51.22-r2 ) and it does fixed the parsing problems, however LESS is still not set correctly using the example given. antarus: you were playing with this, could you please update status? (In reply to comment #3) > antarus: you were playing with this, could you please update status? > Dead. It seems like we need to put the shlex parser into posix mode. I'm experimenting with it now. Created attachment 98900 [details, diff]
support escaped quotes with shlex posix mode
This patch seems to cause escaped quotes to parse correctly while maintaining compatibility with previous behavior.
Created attachment 98903 [details, diff]
don't try to expand variables in env.d values
This patch prevents the variable expansion code from destroying the escaped quotes. We should probably fix the varexpand code so that it doesn't eat quotes like that...
This has been released in 2.1.2_pre2-r5. |