Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
On 2013-03-22 11:01 +0100, Vincent Lefevre wrote: On 2013-03-22 22:50:40 +1300, Jan Larres wrote: version 457 of less, released in December, reverts to the old parsing behaviour and makes the new one available as an option instead. So it would probably be a better idea to upgrade to that version instead. I agree. And what's important is that compatible versions of less and man-db are installed at the same time. Unfortunately that's currently impossible in Jessie because the version of man-db there declares a Breaks: less ( 456), and less cannot transition to testing because of this bug. So it would be good to fix it or downgrade the severity, since not being able to install both man-db and less sucks. Cheers, Sven -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
On Sun, 5 May 2013, Sven Joachim wrote: On 2013-03-22 11:01 +0100, Vincent Lefevre wrote: On 2013-03-22 22:50:40 +1300, Jan Larres wrote: version 457 of less, released in December, reverts to the old parsing behaviour and makes the new one available as an option instead. So it would probably be a better idea to upgrade to that version instead. I agree. And what's important is that compatible versions of less and man-db are installed at the same time. Unfortunately that's currently impossible in Jessie because the version of man-db there declares a Breaks: less ( 456), and less cannot transition to testing because of this bug. So it would be good to fix it or downgrade the severity, since not being able to install both man-db and less sucks. Since upstream less has reverted this behavior, it seems to me that the right approach is to revert man-db's workaround, mark it as breaking less 456 only (since 456 and = 457 are then both okay), and upload the new less upstream release as closing this bug. Attached is a debdiff for the change to man-db needed to implement this. Since you can't have a Breaks field for a range bounded on both sides, I've just marked it as breaking less 456-1 and 456-1ubuntu1, the only known packaged versions. I've tested that building this patch works the way that you'd expect: apt neither installs the new version of less from unstable, nor attempts to remove it. I've also test-built the new less upstream release (458; 457 is no longer available) with no other changes to packaging, and it works fine and `man apt.conf` displays the right thing. If the other folks on this bug report think this looks sane, I'll clone this bug and assign it to man-db. In addition to uploading the new man-db packaging and the new less upstream, man-db upstream r1443 should be reverted. -- Geoffrey Thomas http://ldpreload.com geo...@ldpreload.comdiff -Nru man-db-2.6.3/debian/changelog man-db-2.6.3/debian/changelog --- man-db-2.6.3/debian/changelog 2012-12-16 04:18:24.0 -0800 +++ man-db-2.6.3/debian/changelog 2013-05-05 16:20:30.0 -0700 @@ -1,3 +1,10 @@ +man-db (2.6.3-3geofft1) unstable; urgency=low + + * The incompatible change from less 456 has been reverted, so revert +our patch and instead Break that version of less. + + -- Geoffrey Thomas geo...@ldpreload.com Sun, 05 May 2013 16:18:17 -0700 + man-db (2.6.3-3) unstable; urgency=low * Support parallel builds. diff -Nru man-db-2.6.3/debian/control man-db-2.6.3/debian/control --- man-db-2.6.3/debian/control 2012-12-16 04:17:47.0 -0800 +++ man-db-2.6.3/debian/control 2013-05-05 17:11:58.0 -0700 @@ -13,7 +13,7 @@ Suggests: groff, less, www-browser Provides: man, man-browser Conflicts: man, suidmanager ( 0.50) -Breaks: less ( 456) +Breaks: less (= 456-1), less (= 456-1ubuntu1) Replaces: man, nlsutils, manpages-de ( 0.5-4) Multi-Arch: foreign Description: on-line manual pager diff -Nru man-db-2.6.3/debian/patches/less-incompatibility.patch man-db-2.6.3/debian/patches/less-incompatibility.patch --- man-db-2.6.3/debian/patches/less-incompatibility.patch 2012-12-16 04:05:23.0 -0800 +++ man-db-2.6.3/debian/patches/less-incompatibility.patch 1969-12-31 16:00:00.0 -0800 @@ -1,52 +0,0 @@ -Description: Handle incompatible change to option string escaping in less 456 -Author: Colin Watson cjwat...@debian.org -Origin: backport, http://bazaar.launchpad.net/~cjwatson/man-db/trunk/revision/1443 -Bug-Debian: http://bugs.debian.org/695459 -Forwarded: not-needed -Last-Update: 2012-12-16 - -Index: b/src/man.c -=== a/src/man.c -+++ b/src/man.c -@@ -814,17 +814,35 @@ - static char *escaped_string; - char *ptr; - -- /* 2*strlen will always be long enough to hold the escaped string */ -+ /* 4*strlen will always be long enough to hold the escaped string */ - ptr = escaped_string = xrealloc (escaped_string, -- 2 * strlen (string) + 1); -- -+ 4 * strlen (string) + 1); -+ - while (*string) { -+ /* less 456 requires dollar and backslash to be escaped in -+ * the option string; this means that we need two -+ * backslashes to effectively escape characters special in -+ * prompt strings, and that displaying a backslash requires -+ * two levels of escaping. Note that this appears to be an -+ * incompatible change, so this will overescape for earlier -+ * versions of less. -+ */ - if (*string == '?' || - *string == ':' || - *string == '.' || -- *string == '%' || -- *string == '\\') -+ *string == '%') { -+ /* Special only in prompt strings */ -+
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
On 2013-05-05 17:55:44 -0700, Geoffrey Thomas wrote: Since upstream less has reverted this behavior, it seems to me that the right approach is to revert man-db's workaround, mark it as breaking less 456 only (since 456 and = 457 are then both okay), and upload the new less upstream release as closing this bug. Attached is a debdiff for the change to man-db needed to implement this. Since you can't have a Breaks field for a range bounded on both sides, I've just marked it as breaking less 456-1 and 456-1ubuntu1, the only known packaged versions. I've tested that building this patch works the way that you'd expect: apt neither installs the new version of less from unstable, nor attempts to remove it. I've also test-built the new less upstream release (458; 457 is no longer available) with no other changes to packaging, and it works fine and `man apt.conf` displays the right thing. I haven't tested, but I think this is the way to do. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
Hi, version 457 of less, released in December, reverts to the old parsing behaviour and makes the new one available as an option instead. So it would probably be a better idea to upgrade to that version instead. -Jan -- -[ OpenPGP key ID: 00A0FD5F ]- I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours. -- Sir Stephen Henry Roberts -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
On 2013-03-22 22:50:40 +1300, Jan Larres wrote: version 457 of less, released in December, reverts to the old parsing behaviour and makes the new one available as an option instead. So it would probably be a better idea to upgrade to that version instead. I agree. And what's important is that compatible versions of less and man-db are installed at the same time. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
On Sat, Dec 08, 2012 at 02:30:36PM +0100, Vincent Lefevre wrote: 2. break other packages that depend on the old behavior, at least man-db 2.6.3-2 and previous versions. Hello Vincent, I just wanted to check with you before uploading less 456-2. Do you know about other packages that less 456-1 break other than man-db 2.6.3-2? I know #695459 is already fixed. Thank you, Aníbal -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
Hi Aníbal, On 2013-03-12 11:36:14 +1100, Aníbal Monsalve Salazar wrote: Do you know about other packages that less 456-1 break other than man-db 2.6.3-2? No, I don't know any other package broken by less 456-1. The other packages I know that can use less a pager don't seem to pass less-specific options like -Pm. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
retitle 695361 less: backslash handling in option string has changed in less-456, breaking man severity 695361 serious thanks The problem is due to a change in the backslash handling in less-456, according to upstream (Mark Nudelman), who mentions the man page: A dollar sign or backslash may be included literally in an option string by preceding it with a backslash. So, now two backslashes are needed, one for the option string escaping (as said above) and one for prompt string escaping (just like before). As a consequence, the new less package should: 1. announce the incompatibility change in NEWS (it has only been done in the changelog, without being explicit on the incompatibility: Allow backslash escaping of metacharacters in LESS environment variable. - Also note that arguments are also affected, not just the LESS environment variable, as shown in the bug report); 2. break other packages that depend on the old behavior, at least man-db 2.6.3-2 and previous versions. I'm going to report another bug to get this fixed in man-db. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#695361: less: buggy backslash handling in prompt string: \ needs to be doubled
Package: less Version: 456-1 Severity: normal The command echo | less '-mPmfoo\.bar' gives the prompt foobar instead of foo.bar. To get the period, the backslash needs to be doubled, but this is not what the less man page says: Any characters other than the special ones (question mark, colon, period, percent, and backslash) become literally part of the prompt. Any of the special characters may be included in the prompt literally by preceding it with a backslash. As there is no reason to double the backslash, I suppose that it is a bug in the program, not in the documentation. Note that this bug affects man. For instance, man apt.conf gives the following prompt: Manual page aptconf(5) line 1 (press h for help or q to quit) where the period is missing. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.5-trunk-amd64 (SMP w/2 CPU cores) Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages less depends on: ii debianutils 4.3.4 ii libc62.13-37 ii libtinfo55.9-10 less recommends no packages. less suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org