SB++
Sandbox applications
Loading...
Searching...
No Matches
generate Namespace Reference

Generator functions. This header contains generator functions, either used to assemble the bwrap command, or auxiliary functions. More...

Functions

std::pair< std::string, int > xorg ()
 
void encrypted (const std::string_view &program)
 Handle an encrypted FS Sandbox.
 
void script (const std::string &binary)
 Generate a script for the sandbox.
 
void desktop_entry (const std::string &name)
 Generate a desktop file for the sandbox.
 
void flatpak_info (const std::string_view &program, const std::string_view &instance, const shared::TemporaryDirectory &work_dir)
 Create a .flatpak-info file for the program.
 
std::pair< std::filesystem::path, std::future< void > > proxy_lib ()
 Setup the Proxy's SOF.
 
std::pair< int, std::future< int > > xdg_dbus_proxy (const std::string &program, const shared::TemporaryDirectory &work_dir)
 Spawn an instance of the xdg-dbus-proxy for the application instance.
 
vector cmd (const std::string &program)
 Generate the bulk of the main program command.
 

Detailed Description

Generator functions. This header contains generator functions, either used to assemble the bwrap command, or auxiliary functions.

Function Documentation

◆ cmd()

shared::vector generate::cmd ( const std::string & program)

Generate the bulk of the main program command.

Parameters
programThe name of the program.
Returns
The generated command.
Note
Parts of the command that should be computed at runtime, like environment variables, should be done outside this function.
+ Here is the call graph for this function:

◆ desktop_entry()

void generate::desktop_entry ( const std::string & name)

Generate a desktop file for the sandbox.

Parameters
pathThe desktop name.
+ Here is the call graph for this function:

◆ encrypted()

void generate::encrypted ( const std::string_view & program)

Handle an encrypted FS Sandbox.

Parameters
programThe program
+ Here is the call graph for this function:

◆ flatpak_info()

void generate::flatpak_info ( const std::string_view & program,
const std::string_view & instance,
const shared::TemporaryDirectory & work_dir )

Create a .flatpak-info file for the program.

Parameters
programThe name of the program.
instanceThe instance name, located in $XDG_RUNTIME_DIR/.flatpak.
work_dirThe working dir for the program instance.
+ Here is the call graph for this function:

◆ proxy_lib()

std::pair< std::filesystem::path, std::future< void > > generate::proxy_lib ( )

Setup the Proxy's SOF.

Returns
The path to the Proxy's SOF, and a future to wait for the path to be populated.
Note
We run this on –dry, such that the Proxy SOF gets generated along with all the others.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script()

void generate::script ( const std::string & binary)

Generate a script for the sandbox.

Parameters
binaryWhere to write the script to.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xdg_dbus_proxy()

std::pair< int, std::future< int > > generate::xdg_dbus_proxy ( const std::string & program,
const shared::TemporaryDirectory & work_dir )

Spawn an instance of the xdg-dbus-proxy for the application instance.

Parameters
programThe name of the program attached to this proxy.
work_dirThe application's instance work dir.
Returns
A pair, including the wd to wait for the bus, and a future to return the pid of the proxy.
+ Here is the call graph for this function: