QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
Executor::WslCommand Struct Reference

A configured executable that runs a Linux program through WSL. More...

#include <executor.h>

Public Member Functions

auto argv (const QStringList &args) const -> QStringList
 Arguments for launcher that run command with args.
auto with (const QString &program) const -> WslCommand
 The same launcher and options running another program.

Public Attributes

QString launcher
 What to start.
QStringList options
 wsl.exe options that go before the program (-d Debian, -u me), without any -e/--exec: argv() always adds that.
QString command
 The Linux program to run, looked up on the WSL PATH.

Detailed Description

A configured executable that runs a Linux program through WSL.

The one definition of "a WSL command" in QtPass; see parseWslCommand().

Definition at line 328 of file executor.h.

Member Function Documentation

◆ argv()

auto Executor::WslCommand::argv ( const QStringList & args) const -> QStringList

Arguments for launcher that run command with args.

Always through --exec, so WSL starts the program itself instead of handing the joined command line to the distribution's default shell. Without it every argument (entry paths, .gpg-id recipients, commit messages) is word-split and $()-expanded by that shell, and a hostile password store gets code execution.

Parameters
argsArguments for command, passed through verbatim.
Returns
options, --exec, command, then args.

Definition at line 106 of file executor.cpp.

Here is the caller graph for this function:

◆ with()

auto Executor::WslCommand::with ( const QString & program) const -> WslCommand

The same launcher and options running another program.

Parameters
programLinux program to run instead of command.
Returns
A copy with command replaced by program.

Definition at line 110 of file executor.cpp.

Member Data Documentation

◆ command

QString Executor::WslCommand::command

The Linux program to run, looked up on the WSL PATH.

Definition at line 344 of file executor.h.

◆ launcher

QString Executor::WslCommand::launcher

What to start.

On Windows a bare wsl/wsl.exe in any case becomes wsl, which the PATH lookup resolves; elsewhere (QtPass itself running inside WSL, where wsl.exe is reachable through interop but wsl need not be) and for a launcher given as a path it stays as configured.

Definition at line 337 of file executor.h.

◆ options

QStringList Executor::WslCommand::options

wsl.exe options that go before the program (-d Debian, -u me), without any -e/--exec: argv() always adds that.

Definition at line 342 of file executor.h.


The documentation for this struct was generated from the following files: