Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Guillem Jover
Control: severity -1 serious

Hi!

On Mon, 2018-10-01 at 14:47:09 +0200, Vincent Lefevre wrote:
> Control: reassign -1 dpkg 1.19.1
> Control: retitle -1 dpkg execs $PAGER with execvp instead of sh -c, yielding 
> upgrade failure

> As a summary, when a pager needs to be invoked (e.g. for the
> conffile difference visualizer), one gets an upgrade failure
> if $PAGER contains the program name + options, as specified
> by POSIX.

Nice catch! Thanks for the analysis.

> On 2018-10-01 14:12:20 +0200, Vincent Lefevre wrote:
> > On 2018-10-01 14:08:17 +0200, Vincent Lefevre wrote:
> > > A possible bug might be that $PAGER is run as a program name,
> > > instead of something like system(), which allows options.
> > 
> > Hmm... I can see in /usr/share/doc/dpkg/changelog.Debian.gz that
> > there have been pager-related changes in dpkg 1.19.1 (26 Sep 2018).
> > The bug might actually be there.
> 
> Indeed, after a quick look at the code (pager_spawn in lib/dpkg/pager.c
> and lib/dpkg/command.c code), this seems to be the case.

I've queued a patch fixing this, which I'll be uploding around
Wednesday with dpkg 1.19.2. Although this will temporarily get in
the way of making the pager presence detection harder, but I'll
improve that later on.

Thanks,
Guillem



Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Vincent Lefevre
Control: reassign -1 dpkg 1.19.1
Control: retitle -1 dpkg execs $PAGER with execvp instead of sh -c, yielding 
upgrade failure

As a summary, when a pager needs to be invoked (e.g. for the
conffile difference visualizer), one gets an upgrade failure
if $PAGER contains the program name + options, as specified
by POSIX.

On 2018-10-01 14:12:20 +0200, Vincent Lefevre wrote:
> On 2018-10-01 14:08:17 +0200, Vincent Lefevre wrote:
> > A possible bug might be that $PAGER is run as a program name,
> > instead of something like system(), which allows options.
> 
> Hmm... I can see in /usr/share/doc/dpkg/changelog.Debian.gz that
> there have been pager-related changes in dpkg 1.19.1 (26 Sep 2018).
> The bug might actually be there.

Indeed, after a quick look at the code (pager_spawn in lib/dpkg/pager.c
and lib/dpkg/command.c code), this seems to be the case.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Vincent Lefevre
On 2018-10-01 14:08:17 +0200, Vincent Lefevre wrote:
> A possible bug might be that $PAGER is run as a program name,
> instead of something like system(), which allows options.

Hmm... I can see in /usr/share/doc/dpkg/changelog.Debian.gz that
there have been pager-related changes in dpkg 1.19.1 (26 Sep 2018).
The bug might actually be there.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Vincent Lefevre
On 2018-10-01 12:12:21 +0100, Adam D. Barratt wrote:
> On 2018-10-01 10:19, Vincent Lefevre wrote:
> > Package: exim4-config
> > Version: 4.91-8
> > Severity: grave
> > Justification: renders package unusable
> [...]
> > *** exim4.conf.template (Y/I/N/O/D/Z) [default=N] ? D
> > dpkg (subprocess): unable to execute conffile difference visualizer
> > (less -Lis): No such file or directory
> > dpkg: error processing package exim4-config (--configure):
> >  conffile difference visualizer subprocess returned error exit status 2
> 
> How is this possibly a bug in exim4-config? That package does not specify
> what command dpkg should use in order to page diffs.
> 
> Looking at the dpkg source code, it first checks $PAGER and if that's not
> set falls back to running the "pager" executable. That suggests one of two
> things:
> 
> - you have $PAGER set to "less -Lis" and for some reason don't have less
> available

It is set to "less -Lis", and I could check that it still works fine.
Note that I've used this value since December 2012 and had never had
any problem with it, including with the conffile difference visualizer:
the last time on this machine was on 2018-08-31, according to
/var/log/apt/term.log* files:

Log started: 2018-08-31  15:21:38
[...]
Installing new version of config file /etc/apparmor.d/abstractions/lightdm ...

Configuration file '/etc/lightdm/lightdm.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
  D : show the differences between the versions
  Z : start a shell to examine the situation
 The default action is to keep your current version.
*** lightdm.conf (Y/I/N/O/D/Z) [default=N] ? D
[blank lines]
--- /etc/lightdm/lightdm.conf   2016-07-01 13:06:09.139950327 +0200
+++ /etc/lightdm/lightdm.conf.dpkg-new  2018-08-28 11:29:22.0 +0200
[...]

So, there doesn't seem to be anything wrong with my config.

> - your /usr/bin/pager alternative points to something that's not installed
> on your system.

Just in case, /usr/bin/pager works fine too (but since $PAGER is set,
this does not matter).

> 1) What is $PAGER set to in the environment in which you performed the
> upgrade?

less -Lis

> 2) What does /usr/bin/pager point to? (Please chase any symlinks to the
> ultmate endpoint)

/usr/bin/pager -> /etc/alternatives/pager
/etc/alternatives/pager -> /bin/less

> 3) How precisely did you invoke dpkg?

I used aptitude with its curses UI.

A possible bug might be that $PAGER is run as a program name,
instead of something like system(), which allows options.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Adam D. Barratt

Control: tags -1 + moreinfo unreproducible

On 2018-10-01 10:19, Vincent Lefevre wrote:

Package: exim4-config
Version: 4.91-8
Severity: grave
Justification: renders package unusable

[...]

*** exim4.conf.template (Y/I/N/O/D/Z) [default=N] ? D
dpkg (subprocess): unable to execute conffile difference visualizer
(less -Lis): No such file or directory
dpkg: error processing package exim4-config (--configure):
 conffile difference visualizer subprocess returned error exit status 2


How is this possibly a bug in exim4-config? That package does not 
specify what command dpkg should use in order to page diffs.


Looking at the dpkg source code, it first checks $PAGER and if that's 
not set falls back to running the "pager" executable. That suggests one 
of two things:


- you have $PAGER set to "less -Lis" and for some reason don't have less 
available
- your /usr/bin/pager alternative points to something that's not 
installed on your system.


1) What is $PAGER set to in the environment in which you performed the 
upgrade?
2) What does /usr/bin/pager point to? (Please chase any symlinks to the 
ultmate endpoint)

3) How precisely did you invoke dpkg?

Regards,

Adam



Bug#910009: exim4-config: upgrade fails when trying to execute conffile difference visualizer

2018-10-01 Thread Vincent Lefevre
Package: exim4-config
Version: 4.91-8
Severity: grave
Justification: renders package unusable

I got the following error:

Setting up exim4-config (4.91-8) ...
Installing new version of config file 
/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt ...
Installing new version of config file 
/etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs ...

Configuration file '/etc/exim4/exim4.conf.template'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
  D : show the differences between the versions
  Z : start a shell to examine the situation
 The default action is to keep your current version.
*** exim4.conf.template (Y/I/N/O/D/Z) [default=N] ? D
dpkg (subprocess): unable to execute conffile difference visualizer (less 
-Lis): No such file or directory
dpkg: error processing package exim4-config (--configure):
 conffile difference visualizer subprocess returned error exit status 2

This ended with:

Errors were encountered while processing:
 exim4-config
 exim4-base
 exim4
 exim4-daemon-light
E: Sub-process /usr/bin/dpkg returned an error code (1)

-- Package-specific info:
Exim version 4.91 #4 built 29-Sep-2018 17:08:52
Copyright (c) University of Cambridge, 1995 - 2018
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2018
Berkeley DB: Berkeley DB 5.3.28: (September  9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DANE DKIM DNSSEC 
Event OCSP PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz 
dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Configuration file is /var/lib/exim4/config.autogenerated
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='internet'
dc_other_hostnames='cventin.lip.ens-lyon.fr'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'
mailname:cventin.lip.ens-lyon.fr
# /etc/default/exim4
EX4DEF_VERSION=''

# 'combined' -   one daemon running queue and listening on SMTP port
# 'no'   -   no daemon running the queue
# 'separate' -   two separate daemons
# 'ppp'  -   only run queue with /etc/ppp/ip-up.d/exim4.
# 'nodaemon' - no daemon is started at all.
# 'queueonly' - only a queue running daemon is started, no SMTP listener.
# setting this to 'no' will also disable queueruns from /etc/ppp/ip-up.d/exim4
QUEUERUNNER='combined'
# how often should we run the queue
QUEUEINTERVAL='5m'
# options common to quez-runner and listening daemon
COMMONOPTIONS=''
# more options for the daemon/process running the queue (applies to the one
# started in /etc/ppp/ip-up.d/exim4, too.
QUEUERUNNEROPTIONS=''
# special flags given to exim directly after the -q. See exim(8)
QFLAGS=''
# Options for the SMTP listener daemon. By default, it is listening on
# port 25 only. To listen on more ports, it is recommended to use
# -oX 25:587:10025 -oP /var/run/exim4/exim.pid
SMTPLISTENEROPTIONS=''

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-1-amd64 (SMP w/12 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages exim4-config depends on:
ii  adduser3.118
ii  debconf [debconf-2.0]  1.5.69

exim4-config recommends no packages.

exim4-config suggests no packages.

-- Configuration Files:
/etc/exim4/exim4.conf.template changed:
exim_path = /usr/sbin/exim4
.ifndef CONFDIR