Package: dpkg
Version: 1.20.0+rsc
Severity: normal
Tags: patch

Since installing dpkg 1.20 nothing is logged to /var/log/dpkg.log anymore. The
reason is that the logfile is opened read-only,
hence all writes fail (undetected).

Patch attached.

Cheers, Roderich



-- Package-specific info:
System tainted due to merged-usr-via-symlinks.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.5.9 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.8-2
ii  libc6        2.30-1
ii  liblzma5     5.2.4-1+b1
ii  libselinux1  3.0-1+b1
ii  tar          1.30+dfsg-6+b1
ii  zlib1g       1:1.2.11.dfsg-2

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt            2.0.0
pn  debsig-verify  <none>
--- a/lib/dpkg/log.c
+++ b/lib/dpkg/log.c
@@ -50,7 +50,7 @@
                return;
 
        if (logfd < 0) {
-               logfd = open(log_file, O_CREAT | O_APPEND, 0644);
+               logfd = open(log_file, O_WRONLY | O_CREAT | O_APPEND, 0644);
                if (logfd < 0) {
                        notice(_("could not open log '%s': %s"),
                               log_file, strerror(errno));

Reply via email to