🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4

Bug#1150204: /usr/sbin/paperconfig: PAPERSIZE in paperconfig clashes with PAPERSIZE in paper(1)

#4
From: Allen Nonymous
Date: Wed, 07 Oct 2026 02:20
111 lines
4986 bytes
Package: libpaper-utils
Version: 2.2.5-0.3+b2
Severity: normal
File: /usr/sbin/paperconfig

The /usr/sbin/paperconfig script uses an internal shell variable
named PAPERSIZE, which contains the full path to a papersize file.
This usage conflicts with the environment variable of the same name,
which according to the paper(1) man page, does not contain such a path,
but instead contains the name of a particular media size to be used.
The collision can be demonstrated with a simple sequence of commands:

    #!/bin/bash

    # Simple setup, to clarify the output.
    PATH=/usr/bin:/usr/sbin
    LINE=--------------------------------

    # Log the commands used in this test.
    set -x

    # First clear any inherited value in the environment,
    # and prove that the clearing has actually occurred.
    ( set +x; echo $LINE ) 2>/dev/null
    printenv PAPERSIZE
    export -n PAPERSIZE
    printenv PAPERSIZE

    # Look at the default paper size.
    ( set +x; echo $LINE ) 2>/dev/null
    paper
    paperconf
    paperconfig

    # Set the paper size to a known non-default value.
    ( set +x; echo $LINE ) 2>/dev/null
    export PAPERSIZE=Letter

    # Look to see what effect that environment variable has.
    ( set +x; echo $LINE ) 2>/dev/null
    paper
    paperconf
    paperconfig

    # End this test.
    ( set +x; echo $LINE ) 2>/dev/null

Here's the output I get from that script, when run in my local
Debian 13.7 context:

    --------------------------------
    + printenv PAPERSIZE
    Letter
    + export -n PAPERSIZE
    + printenv PAPERSIZE
    --------------------------------
    + paper
    A4: 210x297 mm
    + paperconf
    a4
    + paperconfig
    A4
    --------------------------------
    + export PAPERSIZE=Letter
    + PAPERSIZE=Letter
    --------------------------------
    + paper
    Letter: 8.5x11 in
    + paperconf
    letter
    + paperconfig
    /usr/bin/paper: unknown paper '/etc/papersize'
    --------------------------------

It's the output from that last paperconfig command that shows the problem.
Compare that to the earlier output from paperconfig when the PAPERSIZE
environment variable was not set.

Recommended fix:

    Change all references to the PAPERSIZE shell variable within the
    paperconfig script to be PAPERSIZEFILE instead.  This will in fact fit
    the actual semantics of that shell variable, which holds a filepath
    in contrast to the environment variable of the same original name,
    which holds a media-size name.

        sed --in-place -e "s/PAPERSIZE/PAPERSIZEFILE/g" paperconfig


-- System Information:
Debian Release: 13.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.111+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libpaper-utils depends on:
ii  libc6           2.41-12+deb13u4
ii  libpaper2       2.2.5-0.3+b2
ii  sensible-utils  0.0.25

libpaper-utils recommends no packages.

libpaper-utils suggests no packages.

-- no debconf information
Technical Details
Message-ID: <NLpq9-3ZKd-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Allen Nonymous <allen.scallop952@passinbox.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1150204: /usr/sbin/paperconfig: PAPERSIZE in paperconfig clashes with PAPERSIZE in paper(1)
Date: Wed, 07 Oct 2026 04:20:01 +0200
Message-ID: <NLpq9-3ZKd-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Oct  7 02:11:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Allen Nonymous <allen.scallop952@passinbox.com>, 1150204@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: eppesuig@debian.org
X-Debian-Pr-Message: report 1150204
X-Debian-Pr-Package: libpaper-utils
X-Debian-Pr-Source: libpaper
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1995473
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 111
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 06 Oct 2026 19:07:09 -0700
X-Original-Message-ID: <179133882916.10242.18087172969593708688.reportbug@goal>