Package: apt
Version: 0.5.26
Severity: minor
The apt configuration class can't reliably be used to store and
retrieve configuration data, because it doesn't provide any mechanism
for escaping quotation marks. In other words, storing a string like
'mail -s "the subject" foo' in a configuration file seems to be
impossible.
A simple way of solving this is to allow quotation marks to be
escaped:
Program::MailCmd "mail -s \"the subject\" foo";
*pokes around*
Apparently %-escapes are already understood by libapt, so all that's
needed is to escape outgoing quotation marks...but placing %-escapes in
a configuration file manually doesn't seem to work.aaa Ok, that only
works for tag names. Tag values are handled by ParseCWord.
I've attached a patch that does the following:
- modifies LoadConfigFile to ignore backslash-escaped metacharacters.
- modifies Dump to backslash-escape outgoing backslashes and
quotation marks.
- modifies ParseCWord to handle backslash-escapes.
It seems to work in my tests here.
Daniel
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.6
Locale: LANG=en_US, LC_CTYPE=en_US (ignored: LC_ALL set to en_US)
Versions of packages apt depends on:
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an
ii libgcc1 1:3.3.4-3 GCC support library
ii libstdc++5 1:3.3.4-3 The GNU Standard C++ Library v3
-- no debconf information
It's been three years and there's been no reply on this bug, nor is
there a documented way of escaping double-quote characters. Would it be
possible for someone to take a quick look at this patch? I could easily
tweak the code to create a new quoted-string format (eg, using '') that
supports backslash-escapes and not support them in the old format.
Thanks,
Daniel
On Fri, Jan 25, 2008 at 06:42:40PM -0800, Daniel Burrows <[email protected]> was heard to say:
> It's been three years and there's been no reply on this bug, nor is
> there a documented way of escaping double-quote characters. Would it be
> possible for someone to take a quick look at this patch? I could easily
> tweak the code to create a new quoted-string format (eg, using '') that
> supports backslash-escapes and not support them in the old format.
Whoops, I edited my mail down until it stopped making sense,
apparently. ;-)
What I meant to say was: I wonder if the reason my patch hasn't been
applied is due to concerns about backwards-compatibility? i.e., if
users are already using backslashes in configuration options, then
suddenly giving them a new meaning is a bit unkind.
One way around this is to also support the use of single quote
characters for output, and to support backslash-escapes inside them.
OTOH, it looks like single-quotes are currently treated as part of the
option value, so I guess there may not be a loophole that you can drive
a format fix through without breaking compatibility :-(.
Daniel
Dear Daniel,
Kindly checkout this code modification in apt.diff file attached with font
color green. After implementing new logic and handling outgoing qoutation
marks with escape character, the mail system on shell is working fine. I
believe that bug is fixed now and running efficiently on my system. Please
acknowledge our effort.
Regards
Qaiser Abbas
Subject: Re: Bug#260446: bug fixed and acknowledgement required
Date: Sat, 24 May 2008 11:58:14 -0300
"l070906 Lahore" <[email protected]> writes:
> Dear Daniel,
>
> Kindly checkout this code modification in apt.diff file attached
> with font color green. After implementing new logic and handling
> outgoing qoutation marks with escape character, the mail system on
> shell is working fine. I believe that bug is fixed now and running
> efficiently on my system. Please acknowledge our effort.
Hello,
Please update your patch against latest apt from sid and do a longer
description about what you're doing/fixing.
Thanks by the work and interest in helping APT development.
Cheers,
--
O T A V I O S A L V A D O R
---------------------------------------------
E-mail: [email protected] UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
you the whole house."