Debian Bug report logs - #260446
[libapt-pkg] No way to escape quotes in configuration files

version graph

Package: apt; Maintainer for apt is APT Development Team <[email protected]>; Source for apt is src:apt (PTS, buildd, popcon).

Reported by: Daniel Burrows <[email protected]>

Date: Tue, 20 Jul 2004 17:48:01 UTC

Severity: minor

Tags: patch

Found in version 0.5.26

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], APT Development Team <[email protected]>:
Bug#260446; Package apt. (full text, mbox, link).


Acknowledgement sent to Daniel Burrows <[email protected]>:
New Bug report received and forwarded. Copy sent to APT Development Team <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Daniel Burrows <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: [libapt-pkg] No way to escape quotes in configuration files
Date: Tue, 20 Jul 2004 13:34:03 -0400
[Message part 1 (text/plain, inline)]
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
[apt.diff (text/x-c++, attachment)]

Tags added: patch Request was from Daniel Burrows <[email protected]> to [email protected]. (Sat, 26 Jan 2008 02:33:02 GMT) (full text, mbox, link).


Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#260446; Package apt. (full text, mbox, link).


Acknowledgement sent to Daniel Burrows <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (full text, mbox, link).


Message #12 received at [email protected] (full text, mbox, reply):

From: Daniel Burrows <[email protected]>
To: [email protected]
Subject: *poke poke poke*
Date: Fri, 25 Jan 2008 18:42:40 -0800
  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




Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#260446; Package apt. (full text, mbox, link).


Acknowledgement sent to Daniel Burrows <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (full text, mbox, link).


Message #17 received at [email protected] (full text, mbox, reply):

From: Daniel Burrows <[email protected]>
To: [email protected]
Subject: Re: Bug#260446: *poke poke poke*
Date: Fri, 25 Jan 2008 21:47:11 -0800
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




Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#260446; Package apt. (full text, mbox, link).


Acknowledgement sent to "l070906 Lahore" <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (full text, mbox, link).


Message #22 received at [email protected] (full text, mbox, reply):

From: "l070906 Lahore" <[email protected]>
To: [email protected]
Subject: bug fixed and acknowledgement required
Date: Fri, 23 May 2008 15:56:22 +0500
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
[apt.diff (text/plain, attachment)]

Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#260446; Package apt. (full text, mbox, link).


Acknowledgement sent to Otavio Salvador <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (full text, mbox, link).


Message #27 received at [email protected] (full text, mbox, reply):

From: Otavio Salvador <[email protected]>
To: "l070906 Lahore" <[email protected]>
Cc: [email protected]
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."




Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon Nov 11 13:37:40 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.