Your message dated Sun, 16 Jun 2024 22:08:00 +0000
with message-id <[email protected]>
and subject line Bug#1063405: fixed in sensible-utils 0.0.23
has caused the Debian Bug report #1063405,
regarding sensible-utils: error "realpath: '': No such file or directory" / 
possible recursive loop
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1063405: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063405
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sensible-utils
Version: 0.0.22
Severity: normal

After the upgrade to 0.0.22, I'm getting the following error with
sensible-pager:

realpath: '': No such file or directory

(the other sensible-* utilities are likely to have the same issue
since the related code is very similar).

This is due to

    # Prevent recursive loops, where environment variables are set to this 
script
    [ x$(realpath "$(command -v "$candidate" || true)" || true) = x"$program" ] 
&& return

where $candidate is a command with arguments. For instance,
I have PAGER="less -Lis". Hence the issue.

The full string for "command -v" is expected to be the executable name
(without arguments). So the executable is not found, and "command -v"
fails without any output, so that realpath outputs an error to stderr
for this reason.

There is the same issue when the command doesn't exist:

cventin:~> PAGER=foo sensible-pager
realpath: '': No such file or directory
PAGER: 1: foo: not found
Missing filename ("less --help" for help)

In any case, the "realpath: '': No such file or directory" just
concerns internals and should be hidden from the user.

The problem is actually worse than the error message as there can
be a loop:

cventin:~> PAGER="sensible-pager " sensible-pager
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
[...]

So I suggest 2 fixes:

1. In the candidate, take only everything until the first space,
   i.e. use "${candidate%% *}" instead of "$candidate".

2. Redirect the realpath standard error to /dev/null in order to
   avoid the error message when the executable is not found.

This gives:

    # Prevent recursive loops, where environment variables are set to this 
script
    [ x$(realpath "$(command -v "${candidate%% *}" || true)" 2> /dev/null || 
true) = x"$program" ] && return

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

Kernel: Linux 6.6.13-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

--- End Message ---
--- Begin Message ---
Source: sensible-utils
Source-Version: 0.0.23
Done: Bastien Roucariès <[email protected]>

We believe that the bug you reported is fixed in the latest version of
sensible-utils, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bastien Roucariès <[email protected]> (supplier of updated sensible-utils 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 16 Jun 2024 21:44:53 +0000
Source: sensible-utils
Architecture: source
Version: 0.0.23
Distribution: unstable
Urgency: medium
Maintainer: Anibal Monsalve Salazar <[email protected]>
Changed-By: Bastien Roucariès <[email protected]>
Closes: 1063405 1063481 1063482
Changes:
 sensible-utils (0.0.23) unstable; urgency=medium
 .
   * Bug fix: "error realpath: No such file or
     directory; / possible recursive loop", thanks to Vincent Lefevre
     (Closes: #1063405).
   * Bug fix: "Errors in man page" thanks to Helge Kreutzmann (Closes: 
#1063482).
   * Bug fix: "[INTL:de] updated German man page translation" thanks to Helge
     kreutzmann (Closes: #1063481).
   * Update all translations and unfuzzy where possible.
   * Update de.add to match reality.
   * Use alias instead of local gettext thanks to наб.
   * eval instead of sh -c thanks to наб.
Checksums-Sha1:
 df3b89888f7bc40045bf0e07388cd0f0f9625d62 1743 sensible-utils_0.0.23.dsc
 6f1fb935d99941c7d7a405709a3e7221228061c2 73464 sensible-utils_0.0.23.tar.xz
 034c58c301895647c4e6da152e766d1be0c91119 6250 
sensible-utils_0.0.23_amd64.buildinfo
Checksums-Sha256:
 6b265b437ae5de65b70380d523c2aa686779834799b7db8d5aeca18b86a1895d 1743 
sensible-utils_0.0.23.dsc
 0de5526c06f7c41b2f3d68eba570d08ffc7c2883c567d9786eaf25d9e554d4d6 73464 
sensible-utils_0.0.23.tar.xz
 d31f433aaf5acdd4d1722e4d96c12cc4bcf3d88689aba63a2220d68d8f4a3f9b 6250 
sensible-utils_0.0.23_amd64.buildinfo
Files:
 9c2fa2ca89b97bd3071096846ab07c41 1743 utils required sensible-utils_0.0.23.dsc
 b7547fd32130a1a5f2e6e079431314f8 73464 utils required 
sensible-utils_0.0.23.tar.xz
 93cdd677ee812072d2f63955a8dad5b0 6250 utils required 
sensible-utils_0.0.23_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEEXQGHuUCiRbrXsPVqADoaLapBCF8FAmZvXqIRHHJvdWNhQGRl
Ymlhbi5vcmcACgkQADoaLapBCF8qwQ//Vr/BJTu4pIdnyjYzONpfPvnBu36qwIvs
i1FoxahEwrur1K/xZNoyr4uog4ysFELoCOVBjOVD5qUY0RUVIF7hkW8Q1oIJ/jst
IgYb1KNUsgrGj474qoygyHJWZ6n5LUFF6V2RNQIhvZRuaPGRhnnleyutgRsoP+W4
b4eTjwRjTxykt2mFgg/zGRbaUJwh4Ia5Shzi+woCBwUEaQRpJ/F0HCbVsm597nhR
PElODIbfHU2s7eGiuFEOOLZ5XlL98ANhze4oPkeYOLn/OoXh56wcKXu67zlTHoYh
mOQsd2jHLiWMb4YeP2qwHwDjvKoxOi9BV6irlGjG2pv0GFj2ez02rbbc1DIMY240
GfZEkfG6vellpTHFH8747GbDcdUdo8CAh6BOVxYVY7BuBrEiesA9LFehzPfQKVX9
UJ3JN2nVlCoILRW24+/xXRFQssEgUdDMZgfwfyo+9ubj75tKQ6lMGfcxOr9YGWhd
Boix1zcKgtdfKfHwaEPEHwfKymKsJO4eTPB3oDVvFI00mSOnnWAZDjsZfgMErBIS
j5JBtYxqkEDIoyuNtDv8qA042D1SMEYqzqukP6B5zle1yuCbk32EreOwbG5XKd4Z
/y7y/uLcK2oY6rOp8w66mKjOCbmsiIGA+2GKapiV3FzHVO4podXyhQ1kbAX6/iHR
rqkuMrgD0ko=
=wML1
-----END PGP SIGNATURE-----

Attachment: pgpQM98un43XH.pgp
Description: PGP signature


--- End Message ---

Reply via email to