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

Package:
libpaper-utils
Source:
libpaper-utils
Description:
library for handling paper characteristics (utilities)
Submitter:
Allen Nonymous
Date:
2026-10-07 02:11:03 UTC
Severity:
normal
#1150204#5
Date:
2026-10-07 02:07:09 UTC
From:
To:
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: