Shell

This executable can spawn an interactive system shell.
  1. This function can be performed by any unprivileged user.
    less /etc/hosts
    !/bin/sh
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    less /etc/hosts
    !/bin/sh
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    RemarksThis executable runs commands using the system shell, e.g., via functions like system, so it only works for distributions where the shell does not drop SUID privileges.
    less /etc/hosts
    !/bin/sh
  2. CommentThe optional reset command is needed to receive the echo back of the typed keystrokes.
    This function can be performed by any unprivileged user.
    LESSOPEN="/bin/sh -s 1>&0 2>&0 # %s" less /etc/hosts
    reset
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    LESSOPEN="/bin/sh -s 1>&0 2>&0 # %s" less /etc/hosts
    reset
  3. This function can be performed by any unprivileged user.
    VISUAL='/bin/sh -s --' less /etc/hosts
    v
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    VISUAL='/bin/sh -s --' less /etc/hosts
    v

Command

This executable can run non-interactive system commands.
  1. This function can be performed by any unprivileged user.
    cp /path/to/command ~/.lessfilter
    less /etc/hosts
  2. This function can be performed by any unprivileged user.
    LESSOPEN='/path/to/command # %s' less /etc/hosts
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    LESSOPEN='/path/to/command # %s' less /etc/hosts

File write

This executable can write data to local files.
  1. This function can be performed by any unprivileged user.
    echo DATA | less
    s/path/to/output-file
    q
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    echo DATA | less
    s/path/to/output-file
    q
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    echo DATA | less
    s/path/to/output-file
    q

File read

This executable can read data from local files.
  1. This function can be performed by any unprivileged user.
    less /path/to/input-file
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    less /path/to/input-file
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    less /path/to/input-file
  2. CommentThis can be used to read another file, e.g., when invoked as a pager with some fixed content.
    This function can be performed by any unprivileged user.
    less /etc/hosts
    :e /path/to/input-file
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    less /etc/hosts
    :e /path/to/input-file
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    less /etc/hosts
    :e /path/to/input-file
  3. CommentThis can be used to read another file.
    This function can be performed by any unprivileged user.
    LESSOPEN='echo /path/to/input-file # %s' less /etc/hosts
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    LESSOPEN='echo /path/to/input-file # %s' less /etc/hosts

Inherit

This executable can inherit functions from another.
  1. This function can be performed by any unprivileged user.
    less /etc/hosts
    v
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    less /etc/hosts
    v
    This function is performed by the privileged user if the executable has the SUID bit set and the right ownership because the effective privileges are not dropped.
    less /etc/hosts
    v
    Functions

    Inherits from vi, thus possibly granting its functions.