Seems we need to escape double quote chars in chat_${iface} array. Also, it wouldn't hurt to escape $ and \ as well. Look at http://forums.gentoo.org/viewtopic-t-414472.html for an example where escaping is needed.
I assume you're referring to the documentation in net.example rather than the pppd module?
Nope, I'm reffering to the pppd module's code. We launch pppd by using eval, remember?
pppd modules does not define anything chat - it merely references the chat variables. So if it needs to be escaped then this has to happen in the user config. If I'm wrong then either explain more clearly or submit a patch
Created attachment 79049 [details, diff] escape chat params This is what I had in mind. With this patch, chat params containing '," or \ are passed correctly on command line. The only problem is $ sign, for which I cannot find the proper escape sequence. Can you help me with this?
Created attachment 79096 [details, diff] requote properly This patch should do the trick - we do the same thing in rc-daemon.sh and I see no difference here. However, I also have no means of testing it! What do you think?
Created attachment 79107 [details, diff] requote in functions.sh Of course, you'll need the fixed requote function in /sbin/functions.sh too ;)
I'll test it in a few hours, when I return home.
Created attachment 79132 [details, diff] Requote even better New patch, no longer needs a patch to functions.sh
your patch works, but it has the same flaw - don't handle $ signs. the connect command line is particularly hard to escape. because parameters are interpreted in cascade: eval command => pppd => chat if you don't think it will be a problem, we can leave it as is. the important chars (quotes) are passed correctly to the chat program.
Handles $ signs perfectly as far as I can tell. Could you post a specfic chat_ppp0=( ... ) config and the output of cat /proc/$(pidof pppd)/cmdline && echo where you think it's failing?
you're right, it works! I've been fooled by the fact that $ is a metacharacter in chat scripts. I quote from man chat: ENVIRONMENT VARIABLES Environment variables are available within chat scripts, if the -E option was specified in the command line. The metacharacter $ is used to introduce the name of the environment variable to substitute. If the substition fails, because the requested environment variable is not set, noth- ing is replaced for the variable.
Cool. Patch is in svn and will be in pre16
Fixed in baselayout-1.12.0_pre16