#1151266 npm: manpages packaged with strange symlink

#1151266#5
Date:
2026-10-19 10:50:45 UTC
From:
To:
I noticed this symlink in the npm package:

$ ls -l /usr/share/nodejs/npm
total 28
drwxr-xr-x  3 root root 4096 Oct  6 14:09 bin
-rw-r--r--  1 root root  145 Oct  3 23:01 index.js
drwxr-xr-x  5 root root 4096 Oct  6 14:09 lib
lrwxrwxrwx  1 root root    9 Dec 27  2025 man -> ../../man
drwxr-xr-x 39 root root 4096 Sep 16 10:44 node_modules
-rw-r--r--  1 root root   95 Oct  3 20:44 npmrc
-rw-r--r--  1 root root 6860 Oct  3 23:01 package.json

This causes `npm help login` to open `login(1)`, which is very confusing.

```
$ PAGER=cat strace --trace=execve -ff -s99 npm help login

execve("/usr/bin/npm", ["npm", "help", "login"], 0x7ffdaf2d3478 /* 71 vars */) = 0
execve("/home/MYUSER/.cargo/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = -1 ENOENT (No such file or directory)
execve("/home/MYUSER/.local/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = -1 ENOENT (No such file or directory)
execve("/home/MYUSER/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = -1 ENOENT (No such file or directory)
execve("/home/MYUSER/.local/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/bin/node", ["node", "/usr/bin/npm", "help", "login"], 0x7ffe469df978 /* 71 vars */) = 0
strace: Process 158418 attached
strace: Process 158419 attached
strace: Process 158420 attached
strace: Process 158421 attached
strace: Process 158422 attached
strace: Process 158423 attached
strace: Process 158424 attached
strace: Process 158425 attached
strace: Process 158426 attached
strace: Process 158427 attached
strace: Process 158428 attached
[pid 158428] execve("/home/MYUSER/.cargo/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = -1 ENOENT (No such file or directory)
[pid 158428] execve("/home/MYUSER/.local/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = -1 ENOENT (No such file or directory)
[pid 158428] execve("/home/MYUSER/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = -1 ENOENT (No such file or directory)
[pid 158428] execve("/home/MYUSER/.local/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = -1 ENOENT (No such file or directory)
[pid 158428] execve("/usr/local/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = -1 ENOENT (No such file or directory)
[pid 158428] execve("/usr/bin/man", ["man", "/usr/share/nodejs/npm/man/man1/login.1.gz"], 0x55788c77b5e0 /* 92 vars */) = 0
strace: Process 158429 attached
strace: Process 158430 attached
[pid 158429] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158429, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 158431 attached
strace: Process 158432 attached
strace: Process 158433 attached
strace: Process 158434 attached
strace: Process 158435 attached
strace: Process 158436 attached
strace: Process 158437 attached
[pid 158432] execve("/home/MYUSER/.cargo/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */strace: Process 158438 attached
) = -1 ENOENT (No such file or directory)
[pid 158432] execve("/home/MYUSER/.local/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158432] execve("/home/MYUSER/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158432] execve("/home/MYUSER/.local/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158432] execve("/usr/local/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158432] execve("/usr/bin/preconv", ["preconv", "-e", "UTF-8"], 0x5625037e8c00 /* 96 vars */) = 0
[pid 158438] +++ exited with 0 +++
[pid 158433] execve("/home/MYUSER/.cargo/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158433] execve("/home/MYUSER/.local/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158435] execve("/home/MYUSER/.cargo/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158433] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158435] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158433] execve("/home/MYUSER/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158435] execve("/home/MYUSER/.local/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158433] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158435] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158433] execve("/home/MYUSER/.local/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158435] execve("/home/MYUSER/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158433] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158435] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158433] execve("/usr/local/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158435] execve("/home/MYUSER/.local/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158433] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158435] <... execve resumed>)      = -1 ENOENT (No such file or directory)
[pid 158433] execve("/usr/bin/tbl", ["tbl"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158435] execve("/usr/local/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158435] execve("/usr/bin/col", ["col", "-b", "-p", "-x"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158430] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158430, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158433] <... execve resumed>)      = 0
[pid 158435] <... execve resumed>)      = 0
[pid 158434] execve("/home/MYUSER/.cargo/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158434] execve("/home/MYUSER/.local/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158434] execve("/home/MYUSER/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158434] execve("/home/MYUSER/.local/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158434] execve("/usr/local/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */) = -1 ENOENT (No such file or directory)
[pid 158434] execve("/usr/bin/nroff", ["nroff", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x5625037e8c00 /* 96 vars */ <unfinished ...>
[pid 158437] +++ exited with 0 +++
[pid 158434] <... execve resumed>)      = 0
[pid 158431] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158431, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 158439 attached
[pid 158439] execve("/bin/bash", ["/bin/bash", "-c", "prog=${0##*/}"], 0x564fbd21e918 /* 96 vars */ <unfinished ...>
[pid 158432] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158432, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158439] <... execve resumed>)      = 0
[pid 158433] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158433, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158439] +++ exited with 0 +++
[pid 158434] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158439, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 158440 attached
[pid 158440] execve("/usr/bin/groff", ["groff", "-Tutf8", "-mtty-char", "-mandoc", "-rLL=254n", "-rLT=254n"], 0x564fbd220ab8 /* 97 vars */) = 0
strace: Process 158441 attached
[pid 158441] execve("/usr/bin/troff", ["troff", "-mtty-char", "-mandoc", "-rLL=254n", "-rLT=254n", "-Tutf8"], 0x55c7132ef100 /* 98 vars */strace: Process 158442 attached
 <unfinished ...>
[pid 158442] execve("/usr/bin/grotty", ["grotty"], 0x55c7132ef100 /* 98 vars */ <unfinished ...>
[pid 158441] <... execve resumed>)      = 0
[pid 158442] <... execve resumed>)      = 0
[pid 158442] +++ exited with 0 +++
[pid 158441] +++ exited with 0 +++
[pid 158440] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158442, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158440] +++ exited with 0 +++
[pid 158434] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158440, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158434] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158434, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
LOGIN(1)                                                                                                                 User Commands                                                                                                                LOGIN(1)

NAME
     login - begin session on the system

SYNOPSIS
     login [-p] [-s shell] [-h host] [-H] [[-f] username|UID]

DESCRIPTION
     login is used when signing onto a system. If no argument is given, login prompts for the username.

     The  user is then prompted for a password, where appropriate. Echoing is disabled to prevent revealing the password. Only a number of password failures are permitted before login exits and the communications link is severed. See LOGIN_RETRIES in the
     CONFIG FILE ITEMS section.

     If password aging has been enabled for the account, the user may be prompted for a new password before proceeding. In such a case, the old password must be provided and the new password entered before continuing. Please refer to passwd(1)  for  more
     information.

     The  user  and  group ID will be set according to their values in the /etc/passwd file. There is one exception if the user ID is zero. In this case, only the primary group ID of the account is set. This should allow the system administrator to login
     even in case of network problems. The environment variable values for $HOME, $USER, $SHELL, $PATH, $LOGNAME, and $MAIL are set according to the appropriate fields in the password entry.  $PATH  defaults  to  /usr/local/bin:/bin:/usr/bin  for  normal
     users, and to /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin for root, if not otherwise configured.

     The environment variable $TERM will be preserved, if it exists, else it will be initialized to the terminal type on your tty. The environment variables $COLORTERM and $NO_COLOR will be preserved if they exist.

     Other environment variables are preserved if the -p option is given or if LOGIN_ENV_SAFELIST defined in /etc/login.defs (see below).

     The environment variables defined by PAM are always preserved.

     Then  the  user’s  shell  is  started.  If  no  shell  is  specified  for  the user with -s or in /etc/passwd, then /bin/sh is used. If the specified shell contains a space, it is treated as a shell script. If there is no home directory specified in
     /etc/passwd, then / is used, followed by .hushlogin check as described below.

     If the file .hushlogin exists, then a "quiet" login is performed. This disables the checking of mail and the printing of the last login time and message of the day. Otherwise, if /var/log/lastlog exists, the last login time is printed, and the  cur‐
     rent login is recorded.

OPTIONS
     -p
         Used by getty(8) to tell login to preserve the environment. See also LOGIN_ENV_SAFELIST config file item.

     -f
         Used to skip a login authentication. This option is usually used by the getty(8) autologin feature.

     -h
         Used by other servers (such as telnetd(8) to pass the name of the remote host to login so that it can be placed in utmp and wtmp. Only the superuser is allowed use this option.

         Note  that  the  -h option has an impact on the PAM service name. The standard service name is login, but with the -h option, the name is remote. It is necessary to create proper PAM config files (for example, /etc/pam.d/login and /etc/pam.d/re‐
         mote).

     -H
         Used by other servers (for example, telnetd(8)) to tell login that printing the hostname should be suppressed in the login: prompt. See also LOGIN_PLAIN_PROMPT below.

     -s, --shell shell
         Specify a shell, other than the one defined in /etc/passwd, to log in to.

     -h, --help
         Display help text and exit.

     -V, --version
         Display version and exit.

CONFIG FILE ITEMS
     login reads the /etc/login.defs configuration file (see login.defs(5)). Note that the configuration file could be distributed with another package (usually shadow-utils). The following configuration items are relevant for login:

     MOTD_FILE (string)
         Specifies a ":" delimited list of "message of the day" files and directories to be displayed upon login. If the specified path is a directory then displays all files with .motd file extension in version-sort order from the directory.

         The default value is /usr/share/misc/motd:/run/motd:/etc/motd. If the MOTD_FILE item is empty or a quiet login is enabled, then the message of the day is not displayed. Note that the same functionality is also provided  by  the  pam_motd(8)  PAM
         module.

         The directories in the MOTD_FILE are supported since version 2.36.

         Note  that  login  does  not implement any filenames overriding behavior like pam_motd (see also MOTD_FIRSTONLY), but all content from all files is displayed. It is recommended to keep extra logic in content generators and use /run/motd.d rather
         than rely on overriding behavior hardcoded in system tools.

     MOTD_FIRSTONLY (boolean)
         Forces login to stop display content specified by MOTD_FILE after the first accessible item in the list. Note that a directory is one item in this case. This option allows login semantics to be configured to be more compatible with pam_motd. The
         default value is no.

     LOGIN_ENV_SAFELIST (string)
         Forces login to protect the specified environment variables if -p is not used. The string value is a comma-separated list of variable names. For example: "LANG,LC_MESSAGES,LC_COLLATE". The safelist is ignored for the environment variables  HOME,
         SHELL and USER.

     LOGIN_PLAIN_PROMPT (boolean)
         Tell login that printing the hostname should be suppressed in the login: prompt. This is an alternative to the -H command line option. The default value is no.

     LOGIN_TIMEOUT (number)
         Maximum time in seconds for login. The default value is 60.

     LOGIN_RETRIES (number)
         Maximum number of login retries in case of a bad password. The default value is 3.

     LOGIN_KEEP_USERNAME (boolean)
         Tell login to only re-prompt for the password if authentication failed, but the username is valid. The default value is no.

     FAIL_DELAY (number)
         Delay in seconds before being allowed another three tries after a login failure. The default value is 5.

     TTYPERM (string)
         The terminal permissions. The default value is 0600 or 0620 if tty group is used. See also mesg(1).

     TTYGROUP (string)
         The login tty will be owned by the TTYGROUP. The default value is tty. If the TTYGROUP does not exist, then the ownership of the terminal is set to the user’s primary group.

         The TTYGROUP can be either the name of a group or a numeric group identifier. See also mesg(1).

     HUSHLOGIN_FILE (string)
         If defined, this file can inhibit all the usual chatter during the login sequence. If a full pathname (for example, /etc/hushlogins) is specified, then hushed mode will be enabled if the user’s name or shell are found in the file. If this global
         hush login file is empty then the hushed mode will be enabled for all users.

         If a full pathname is not specified, then hushed mode will be enabled if the file exists in the user’s home directory.

         The default is to check /etc/hushlogins and if it does not exist then ~/.hushlogin.

         If the HUSHLOGIN_FILE item is empty, then all the checks are disabled.

     DEFAULT_HOME (boolean)
         Indicate if login is allowed if we cannot change directory to the home directory. If set to yes, the user will login in the root (/) directory if it is not possible to change directory to their home. The default value is yes.

     LASTLOG_UID_MAX (unsigned number)
         Highest user ID number for which the lastlog entries should be updated. As higher user IDs are usually tracked by remote user identity and authentication services there is no need to create a huge sparse lastlog file for them. No LASTLOG_UID_MAX
         option present in the configuration means that there is no user ID limit for writing [pid 158435] +++ exited with 0 +++
lastlog entries. The default value is ULONG_MAX.

     LOG_UNKFAIL_ENAB (boolean)
         Enable display of unknown usernames when login failures are recorded. The default value is no.

         Note that logging unknown usernames may be a security issue if a user enters their password instead of their login name.

     ENV_PATH (string)
         If set, it will be used to define the PATH environment variable when a regular user logs in. The default value is /usr/local/bin:/bin:/usr/bin.

     ENV_ROOTPATH (string), ENV_SUPATH (string)
         If set, it will be used to define the PATH environment variable when the superuser logs in. ENV_ROOTPATH takes precedence. The default value is /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin.

     LOGIN_SHELL_FALLBACK (boolean)
         If set to yes, login will provide a valid shell from /etc/shells when the shell specified in /etc/passwd is invalid or inaccessible due to administrative errors. This ensures users can still log in. However, it may bypass intended shell restric‐
         tions, potentially causing unexpected behavior if the fallback shell differs from the configured one.

FILES
     /var/run/utmp, /var/log/wtmp, /var/log/lastlog, /var/spool/mail/*, /etc/motd, /etc/passwd, /etc/nologin, /etc/pam.d/login, /etc/pam.d/remote, /etc/hushlogins, $HOME/.hushlogin

CREDENTIALS
     login supports configuration via systemd credentials (see https://systemd.io/CREDENTIALS/). login reads the following systemd credentials:

     login.noauth (boolean)
         If set, configures login to skip login authentication, similarly to the -f option.

BUGS
     The undocumented BSD -r option is not supported. This may be required by some rlogind(8) programs.

     A  recursive  login,  as used to be possible in the good old days, no longer works; for most purposes su(1) is a satisfactory substitute. Indeed, for security reasons, login does a vhangup(2) system call to remove any possible listening processes on
     the tty. This is to avoid password sniffing. If one uses the command login, then the surrounding shell gets killed by vhangup(2) because it’s no longer the true owner of the tty. This can be avoided by using exec login in a top-level shell or xterm.

AUTHORS
     Derived from BSD login 5.40 (5/9/89) by Michael Glad <glad@daimi.dk> for HP-UX. Ported to Linux 0.12: Peter Orbaek <poe@daimi.aau.dk>. Rewritten to a PAM-only version by Karel Zak <kzak@redhat.com>

SEE ALSO
     mail(1), passwd(1), passwd(5), utmp(5), environ(7), getty(8), init(8), lastlog(8), shutdown(8)

REPORTING BUGS
     For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.

AVAILABILITY
     The login command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.

util-linux 2.42.4                                                                                                         2026-08-04                                                                                                                  LOGIN(1)
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158435, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158436] +++ exited with 0 +++
[pid 158428] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158436, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
[pid 158428] +++ exited with 0 +++
[pid 158417] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=158428, si_uid=1000, si_status=0, si_utime=0, si_stime=1 /* 0.01 s */} ---
[pid 158425] +++ exited with 0 +++
[pid 158427] +++ exited with 0 +++
[pid 158426] +++ exited with 0 +++
[pid 158424] +++ exited with 0 +++
[pid 158419] +++ exited with 0 +++
[pid 158422] +++ exited with 0 +++
[pid 158421] +++ exited with 0 +++
[pid 158420] +++ exited with 0 +++
[pid 158418] +++ exited with 0 +++
[pid 158423] +++ exited with 0 +++
+++ exited with 0 +++
```