sbuild
1.6.10
|
Debian source builder components. More...
Classes | |
class | auth |
Authentication handler. More... | |
class | auth_null |
Null Authentication handler. More... | |
class | auth_pam |
Authentication handler. More... | |
class | auth_pam_conv |
Authentication conversation handler interface. More... | |
class | auth_pam_conv_tty |
Authentication conversation handler for terminal devices. More... | |
class | auth_pam_message |
Authentication messages. More... | |
class | basic_keyfile |
Configuration file parser. More... | |
class | basic_keyfile_parser |
Basic keyfile parser template. More... | |
class | basic_nbuf |
Null stream buffer. More... | |
class | basic_nostream |
Null output stream. More... | |
class | chroot |
Common chroot data. More... | |
class | chroot_block_device |
A chroot stored on an unmounted block device. More... | |
class | chroot_block_device_base |
A base class for block-device chroots. More... | |
class | chroot_btrfs_snapshot |
A chroot stored on an BTRFS logical volume (LV). More... | |
class | chroot_config |
Chroot configuration. More... | |
class | chroot_custom |
A chroot stored with custom parameters. More... | |
class | chroot_directory |
A chroot located in the filesystem. More... | |
class | chroot_directory_base |
A base class for chroots located in a local directory. More... | |
class | chroot_facet |
Common chroot data. More... | |
class | chroot_facet_mountable |
Chroot support for mountable devices and filesystems. More... | |
class | chroot_facet_personality |
Chroot support for kernel personalities (execution domains). More... | |
class | chroot_facet_session |
Chroot support for sessions. More... | |
class | chroot_facet_session_clonable |
Chroot support for creation of sessions. More... | |
class | chroot_facet_source |
Chroot support for clonable sources. More... | |
class | chroot_facet_source_clonable |
Chroot support for creation of source chroots. More... | |
class | chroot_facet_union |
Chroot support for filesystem union based sessions. More... | |
class | chroot_facet_userdata |
Chroot support for extensible user metadata. More... | |
class | chroot_file |
A chroot stored in a file archive (tar with optional compression). More... | |
class | chroot_loopback |
A chroot stored in a file for loopback mounting. More... | |
class | chroot_lvm_snapshot |
A chroot stored on an LVM logical volume (LV). More... | |
class | chroot_plain |
A chroot located in the filesystem (scripts disabled). More... | |
class | custom_error |
Custom error. More... | |
class | date |
A date representation in local time. More... | |
class | date_base |
A date representation. More... | |
class | environment |
Container of environment variables. More... | |
class | error |
Error exception class. More... | |
class | error_base |
Error exception base class. More... | |
class | feature |
class | file_lock |
File lock. More... | |
class | format_detail |
Format names and values for output. More... | |
class | gmdate |
A date representation in UTC. More... | |
class | group |
System group database entry. More... | |
class | isodate |
A date representation in ISO-8601 format. More... | |
class | keyfile_base |
Base class for key-value configuration file formats. More... | |
class | keyfile_parser |
Keyfile parser template. More... | |
struct | keyfile_traits |
Traits class for an INI-style configuration file. More... | |
class | lock |
Advisory locking. More... | |
class | mntstream |
Access mounts. More... | |
class | null |
Null. More... | |
class | parse_error |
Parse error. More... | |
class | passwd |
System passwd database entry. More... | |
class | personality |
Chroot personality. More... | |
class | regex |
POSIX extended regular expression. More... | |
class | run_parts |
Run all scripts or programs within a directory. More... | |
class | session |
Session handler. More... | |
class | stat |
Get file status. More... | |
Typedefs | |
typedef parse_error< ctty_error_code > | ctty_error |
Exception type. | |
typedef boost::iostreams::stream< boost::iostreams::file_descriptor > | fdstream |
typedef boost::iostreams::stream< boost::iostreams::file_descriptor_source > | fdistream |
typedef boost::iostreams::stream< boost::iostreams::file_descriptor_sink > | fdostream |
typedef basic_keyfile< keyfile_traits, keyfile_parser< keyfile_traits > > | keyfile |
Configuration file parser. More... | |
typedef basic_nostream< char > | nostream |
A null ostream. | |
typedef basic_nostream< wchar_t > | wnostream |
A wide null ostream. | |
typedef parse_error< parse_value_error_code > | parse_value_error |
Exception type. | |
typedef std::vector< std::string > | string_list |
A string vector. | |
typedef std::set< std::string > | string_set |
A string set. | |
typedef std::map< std::string, std::string > | string_map |
A string map. | |
Enumerations | |
enum | ctty_error_code { CTTY_CLOEXEC, CTTY_DUP } |
Error codes. More... | |
enum | debug_level { DEBUG_NONE = -1, DEBUG_NOTICE = 1, DEBUG_INFO = 2, DEBUG_WARNING = 3, DEBUG_CRITICAL = 4 } |
Debugging level. More... | |
enum | parse_value_error_code { BAD_VALUE } |
Error codes. More... | |
Functions | |
chroot::session_flags | operator| (chroot::session_flags const &lhs, chroot::session_flags const &rhs) |
Bitwise-OR of specifed session properties. More... | |
chroot::session_flags | operator& (chroot::session_flags const &lhs, chroot::session_flags const &rhs) |
Bitwise-AND of specifed session properties. More... | |
const char * | gettext (const char *message) |
Get a translated message. More... | |
const char * | _ (const char *message) |
Get a translated message. More... | |
const char * | gettext_noop (const char *message) |
Get a message with no translation. More... | |
const char * | N_ (const char *message) |
Get a message with no translation. More... | |
std::ostream & | log_info () |
Log an informational message. More... | |
std::ostream & | log_warning () |
Log a warning message. More... | |
std::ostream & | log_error () |
Log an error message. More... | |
std::ostream & | log_debug (debug_level level) |
Log a debug message. More... | |
std::ostream & | log_ctty_info () |
Log an informational message to the Controlling TTY. More... | |
std::ostream & | log_ctty_warning () |
Log a warning message to the Controlling TTY. More... | |
std::ostream & | log_ctty_error () |
Log an error message to the Controlling TTY. More... | |
void | log_exception_warning (std::exception const &e) |
Log an exception as a warning. More... | |
void | log_exception_error (std::exception const &e) |
Log an exception as an error. More... | |
void | log_ctty_exception_warning (std::exception const &e) |
Log an exception as a warning to the Controlling TTY. More... | |
void | log_ctty_exception_error (std::exception const &e) |
Log an exception as an error to the Controlling TTY. More... | |
void | log_unknown_exception_error () |
Log an unknown exception as an error. | |
mntstream & | operator>> (mntstream &stream, mntstream::mntentry &entry) |
The overloaded extraction operator. More... | |
void | parse_value (std::string const &value, bool &parsed_value) |
Parse a boolean value. More... | |
void | parse_value (std::string const &value, std::string &parsed_value) |
Parse a string value. More... | |
template<typename T > | |
void | parse_value (std::string const &value, T &parsed_value) |
Parse a value of type T. More... | |
bool | regex_search (const std::string &str, regex const ®ex) |
Search using the regular expression. | |
std::string | basename (std::string name) |
Strip the directory path from a filename. More... | |
std::string | dirname (std::string name) |
Strip the fileame from a pathname. More... | |
std::string | normalname (std::string name) |
Normalise a pathname. More... | |
bool | is_absname (std::string const &name) |
Check if a pathname is absolute. More... | |
bool | is_valid_sessionname (std::string const &name) |
Check if a filename matches the allowed pattern(s). More... | |
bool | is_valid_filename (std::string const &name, bool lsb_mode=true) |
Check if a filename matches the allowed pattern(s). More... | |
std::string | getcwd () |
Get the current working directory. More... | |
std::string | unique_identifier () |
Get a unique string for use as a session identifier. More... | |
std::string | string_list_to_string (string_list const &list, std::string const &separator) |
Convert a string_list into a string. More... | |
template<typename S > | |
std::vector< S > | split_string (S const &value, S const &separator) |
Split a string into a string_list. More... | |
std::vector< std::string > | split_string (std::string const &value, std::string const &separator) |
Split a string into a string_list. More... | |
template<typename S > | |
std::vector< S > | split_string_strict (S const &value, S const &separator) |
Split a string into a string_list. More... | |
std::vector< std::string > | split_string_strict (std::string const &value, std::string const &separator) |
Split a string into a string_list. More... | |
std::wstring | widen_string (std::string const &str, std::locale locale) |
Widen a string. More... | |
std::string | narrow_string (std::wstring const &str, std::locale locale) |
Narrow a string. More... | |
std::string | find_program_in_path (std::string const &program, std::string const &path, std::string const &prefix) |
Find a program in the PATH search path. More... | |
char ** | string_list_to_strv (string_list const &str) |
Create a string vector from a string_list. More... | |
void | strv_delete (char **strv) |
Delete a string vector. More... | |
int | exec (std::string const &file, string_list const &command, environment const &env) |
execve wrapper. More... | |
stat::mode_bits | operator| (stat::mode_bits const &lhs, stat::mode_bits const &rhs) |
Bitwise-OR of specifed mode bits. More... | |
stat::mode_bits | operator| (mode_t const &lhs, stat::mode_bits const &rhs) |
Bitwise-OR of specifed mode bits. More... | |
stat::mode_bits | operator| (stat::mode_bits const &lhs, mode_t const &rhs) |
Bitwise-OR of specifed mode bits. More... | |
stat::mode_bits | operator& (stat::mode_bits const &lhs, stat::mode_bits const &rhs) |
Bitwise-AND of specifed mode bits. More... | |
stat::mode_bits | operator& (mode_t const &lhs, stat::mode_bits const &rhs) |
Bitwise-AND of specifed mode bits. More... | |
stat::mode_bits | operator& (stat::mode_bits const &lhs, mode_t const &rhs) |
Bitwise-AND of specifed mode bits. More... | |
Variables | |
const int | CTTY_FILENO |
CTTY fd. More... | |
fdstream | cctty |
CTTY stream. More... | |
debug_level | debug_log_level = sbuild::DEBUG_NONE |
The debugging level in use. | |
nostream | cnull |
A null ostream. | |
Debian source builder components.
Configuration file parser.
This class loads an INI-style configuration file from a file or stream. The format is documented in schroot.conf(5).
enum sbuild::debug_level |
|
inline |
Get a translated message.
This function is a shorthand for gettext, which also marks up the string for translation.
message | the message to translate. |
References gettext().
Referenced by sbuild::format_detail::add(), sbuild::chroot_config::add(), sbuild::auth_null::authenticate(), sbuild::auth_pam::authenticate(), sbuild::chroot_facet_session_clonable::clone_session_setup(), sbuild::chroot_facet_source_clonable::clone_source_setup(), sbuild::date_base::get_date_format(), sbuild::chroot_directory_base::get_details(), sbuild::chroot_block_device_base::get_details(), sbuild::chroot_facet_personality::get_details(), sbuild::chroot_facet_userdata::get_details(), sbuild::chroot_loopback::get_details(), sbuild::chroot_lvm_snapshot::get_details(), sbuild::chroot_facet_mountable::get_details(), sbuild::chroot_facet_session::get_details(), sbuild::chroot_btrfs_snapshot::get_details(), sbuild::chroot_file::get_details(), sbuild::chroot_facet_union::get_details(), sbuild::chroot_facet_source_clonable::get_details(), sbuild::chroot::get_details(), sbuild::session::get_login_command(), sbuild::personality::get_personalities(), sbuild::format_detail::get_title(), sbuild::session::get_user_command(), log_ctty_error(), log_ctty_info(), log_ctty_warning(), log_debug(), log_error(), log_info(), log_unknown_exception_error(), log_warning(), sbuild::null::null_output(), sbuild::chroot_config::print_chroot_list_simple(), sbuild::chroot::print_details(), sbuild::session::restore_termios(), sbuild::run_parts::run_child(), sbuild::session::run_child(), sbuild::session::run_chroot(), sbuild::session::save_termios(), sbuild::chroot::set_aliases(), sbuild::chroot_facet_userdata::set_data(), sbuild::chroot::set_keyfile(), sbuild::chroot::set_name(), sbuild::chroot_facet_userdata::set_system_data(), sbuild::session::setup_chroot(), sbuild::chroot_facet_userdata::setup_env(), and sbuild::session::wait_for_child().
std::string sbuild::basename | ( | std::string | name | ) |
Strip the directory path from a filename.
This is similar to basename(3).
name | the filename to strip of its path. |
Referenced by sbuild::session::get_login_command(), and sbuild::chroot_lvm_snapshot::setup_env().
std::string sbuild::dirname | ( | std::string | name | ) |
Strip the fileame from a pathname.
This is similar to dirname(3).
name | the path to strip of its filename. |
Referenced by sbuild::chroot_facet_session_clonable::clone_session_setup().
int sbuild::exec | ( | std::string const & | file, |
string_list const & | command, | ||
environment const & | env | ||
) |
execve wrapper.
Run the command specified by file (an absolute pathname), using command and env as the argv and environment, respectively.
file | the program to execute. |
command | the arguments to pass to the executable. |
env | the environment. |
References sbuild::environment::get_strv(), string_list_to_strv(), and strv_delete().
Referenced by sbuild::run_parts::run_child(), sbuild::session::run_child(), and split_string_strict().
std::string sbuild::find_program_in_path | ( | std::string const & | program, |
std::string const & | path, | ||
std::string const & | prefix | ||
) |
Find a program in the PATH search path.
program | the program to search for. |
path | the search path; typically the value of $PATH. |
prefix | a directory prefix the add to the search path. This may be left empty to search the root filesystem. |
References sbuild::stat::is_regular(), and split_string().
Referenced by sbuild::session::get_user_command(), sbuild::session::run_child(), and split_string_strict().
std::string sbuild::getcwd | ( | ) |
Get the current working directory.
If it can't be found, fall back to root.
Referenced by sbuild::session::run_child().
|
inline |
Get a translated message.
message | the message to translate. |
Referenced by _().
|
inline |
Get a message with no translation.
message | the message to not translate. |
Referenced by N_().
bool sbuild::is_absname | ( | std::string const & | name | ) |
Check if a pathname is absolute.
name | the path to check. |
Referenced by sbuild::chroot_block_device_base::set_device(), sbuild::chroot_directory_base::set_directory(), sbuild::chroot_file::set_file(), sbuild::chroot_loopback::set_file(), sbuild::chroot_file::set_location(), sbuild::chroot_facet_mountable::set_location(), sbuild::chroot::set_mount_location(), sbuild::chroot_lvm_snapshot::set_snapshot_device(), sbuild::chroot_btrfs_snapshot::set_snapshot_directory(), sbuild::chroot_btrfs_snapshot::set_snapshot_name(), sbuild::chroot_btrfs_snapshot::set_source_subvolume(), sbuild::chroot_facet_union::set_union_overlay_directory(), and sbuild::chroot_facet_union::set_union_underlay_directory().
bool sbuild::is_valid_filename | ( | std::string const & | name, |
bool | lsb_mode = true |
||
) |
Check if a filename matches the allowed pattern(s).
This will not match dotfiles, backup files, dpkg configuration backup files, etc. This uses the same rules as run-parts(8).
name | the filename to check. |
lsb_mode | true to use LSB mode, otherwise false. |
References regex_search().
Referenced by sbuild::run_parts::run_parts().
bool sbuild::is_valid_sessionname | ( | std::string const & | name | ) |
Check if a filename matches the allowed pattern(s).
This will not match dotfiles, backup files, dpkg configuration backup files, etc.
name | the filename to check. |
References regex_search().
Referenced by sbuild::chroot_config::add_config_directory(), sbuild::chroot::set_aliases(), and sbuild::chroot::set_name().
std::ostream & sbuild::log_ctty_error | ( | ) |
Log an error message to the Controlling TTY.
Referenced by sbuild::auth_pam_conv_tty::conversation(), and log_ctty_exception_error().
void sbuild::log_ctty_exception_error | ( | std::exception const & | e | ) |
Log an exception as an error to the Controlling TTY.
e | the exception to log. |
References log_ctty_error().
void sbuild::log_ctty_exception_warning | ( | std::exception const & | e | ) |
Log an exception as a warning to the Controlling TTY.
e | the exception to log. |
References log_ctty_warning().
Referenced by sbuild::auth_pam_conv_tty::get_delay().
std::ostream & sbuild::log_ctty_info | ( | ) |
Log an informational message to the Controlling TTY.
Referenced by sbuild::auth_pam_conv_tty::conversation().
std::ostream & sbuild::log_ctty_warning | ( | ) |
Log a warning message to the Controlling TTY.
Referenced by log_ctty_exception_warning().
std::ostream & sbuild::log_debug | ( | sbuild::debug_level | level | ) |
Log a debug message.
level | the debug level of the message being logged. |
References _(), cnull, and debug_log_level.
Referenced by sbuild::auth_pam::account(), sbuild::format_detail::add(), sbuild::environment::add(), sbuild::chroot_config::add_config_directory(), sbuild::chroot_config::add_config_file(), sbuild::auth_null::authenticate(), sbuild::auth_pam::authenticate(), sbuild::chroot_facet_session_clonable::clone_session_setup(), sbuild::auth_pam::close_session(), sbuild::auth_pam_conv_tty::conversation(), sbuild::auth_pam::cred_delete(), sbuild::auth_pam::cred_establish(), sbuild::chroot_config::find_alias(), sbuild::chroot_config::find_chroot_in_namespace(), sbuild::environment::get(), sbuild::session::get_chroot_membership(), sbuild::session::get_login_command(), sbuild::session::get_user_command(), sbuild::basic_keyfile< K, P >::get_value(), sbuild::chroot::get_verbosity_string(), sbuild::session::is_group_member(), sbuild::chroot_config::load_data(), sbuild::chroot_config::load_keyfile(), sbuild::chroot_config::lookup_alias(), sbuild::auth_pam::open_session(), parse_value(), sbuild::run_parts::run_child(), sbuild::session::run_child(), sbuild::session::run_impl(), sbuild::auth::set_ruser(), sbuild::auth::set_user(), sbuild::session::setup_chroot(), sbuild::auth_pam::setupenv(), sbuild::auth_null::start(), sbuild::auth_pam::start(), and sbuild::auth_pam::stop().
std::ostream & sbuild::log_error | ( | ) |
Log an error message.
References _().
Referenced by log_exception_error(), log_unknown_exception_error(), sbuild::run_parts::run_child(), sbuild::session::run_chroot(), and sbuild::session::setup_chroot().
void sbuild::log_exception_error | ( | std::exception const & | e | ) |
Log an exception as an error.
e | the exception to log. |
References log_error().
Referenced by sbuild::run_parts::run_child(), sbuild::session::run_chroot(), sbuild::session::setup_chroot(), sbuild::session::wait_for_child(), sbuild::auth::~auth(), sbuild::auth_null::~auth_null(), and sbuild::auth_pam::~auth_pam().
void sbuild::log_exception_warning | ( | std::exception const & | e | ) |
Log an exception as a warning.
e | the exception to log. |
References log_warning().
Referenced by sbuild::chroot_config::add(), sbuild::chroot_config::add_config_directory(), sbuild::basic_keyfile< K, P >::get_list_value(), sbuild::basic_keyfile< K, P >::get_set_value(), sbuild::session::get_shell(), sbuild::basic_keyfile< K, P >::get_value(), sbuild::session::run_child(), sbuild::chroot::set_keyfile(), and sbuild::file_lock::~file_lock().
std::ostream & sbuild::log_info | ( | ) |
Log an informational message.
References _().
Referenced by sbuild::session::get_login_command(), sbuild::session::get_user_command(), and sbuild::run_parts::run_child().
std::ostream & sbuild::log_warning | ( | ) |
Log a warning message.
References _().
Referenced by sbuild::environment::get(), log_exception_warning(), sbuild::session::restore_termios(), and sbuild::session::save_termios().
|
inline |
Get a message with no translation.
This macro is a shorthand for gettext_noop, which also marks up the string for translation.
message | the message to not translate. |
References gettext_noop().
std::string sbuild::narrow_string | ( | std::wstring const & | str, |
std::locale | locale | ||
) |
Narrow a string.
The wide string is converted into a narrow string. Note that any conversion error will cause the string to be clipped at the point of error.
str | the string to narrow. |
locale | the locale to use for the conversion. |
Referenced by split_string_strict().
std::string sbuild::normalname | ( | std::string | name | ) |
Normalise a pathname.
This strips all trailing separators, and duplicate separators within a path.
name | the path to normalise. |
Referenced by sbuild::chroot::setup_env().
|
inline |
Bitwise-AND of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-AND of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-AND of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-AND of specifed session properties.
lhs | session properties |
rhs | session properties |
mntstream & sbuild::operator>> | ( | mntstream & | stream, |
mntstream::mntentry & | entry | ||
) |
The overloaded extraction operator.
This is used to pull mntentries from a mntstream.
stream | the mntstream to get input from. |
entry | the mntentry to set. |
References sbuild::mntstream::data, sbuild::mntstream::eof_status, and sbuild::mntstream::read().
|
inline |
Bitwise-OR of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-OR of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-OR of specifed mode bits.
lhs | mode bits |
rhs | mode bits |
|
inline |
Bitwise-OR of specifed session properties.
lhs | session properties |
rhs | session properties |
void sbuild::parse_value | ( | std::string const & | value, |
bool & | parsed_value | ||
) |
Parse a boolean value.
value | the value to parse. |
parsed_value | the variable to store the parsed value. |
References BAD_VALUE, DEBUG_NOTICE, and log_debug().
Referenced by sbuild::environment::get(), sbuild::basic_keyfile< K, P >::get_list_value(), sbuild::basic_keyfile< K, P >::get_set_value(), and sbuild::basic_keyfile< K, P >::get_value().
void sbuild::parse_value | ( | std::string const & | value, |
std::string & | parsed_value | ||
) |
Parse a string value.
value | the value to parse. |
parsed_value | the variable to store the parsed value. |
References DEBUG_NOTICE, and log_debug().
void sbuild::parse_value | ( | std::string const & | value, |
T & | parsed_value | ||
) |
Parse a value of type T.
value | the value to parse. |
parsed_value | the variable to store the parsed value. |
References BAD_VALUE, DEBUG_NOTICE, and log_debug().
std::vector<S> sbuild::split_string | ( | S const & | value, |
S const & | separator | ||
) |
Split a string into a string_list.
The string is split using separator as a delimiter. Note that only non-zero-length strings are preserved, so multiple concatenated delimiters or delimiters at the beginning and end of the string will not result in empty strings in the list.
value | the string to split. |
separator | the delimiting character or characters. |
Referenced by find_program_in_path(), sbuild::basic_keyfile< K, P >::get_list_value(), and sbuild::basic_keyfile< K, P >::get_set_value().
string_list sbuild::split_string | ( | std::string const & | value, |
std::string const & | separator | ||
) |
Split a string into a string_list.
The string is split using separator as a delimiter. Multiple delimiters, or delimiters at the start of the start or end of the string will be discarded and not result in empty strings being returned (see split_string_strict).
value | the string to split. |
separator | the delimiting character or characters. |
std::vector<S> sbuild::split_string_strict | ( | S const & | value, |
S const & | separator | ||
) |
Split a string into a string_list.
The string is split using separator as a delimiter. All delimiters are used as string separators, so delimiters at the beginning or end of a string, or which are concatenated together, will result in empty strings in the string list (use split_string to avoid this).
value | the string to split. |
separator | the delimiting character or characters. |
References exec(), find_program_in_path(), narrow_string(), string_list_to_strv(), strv_delete(), and widen_string().
Referenced by sbuild::run_parts::run_child().
string_list sbuild::split_string_strict | ( | std::string const & | value, |
std::string const & | separator | ||
) |
Split a string into a string_list.
The string is split using separator as a delimiter. All delimiters are used as string separators, so delimiters at the beginning or end of a string, or which are concatenated together, will result in empty strings in the string list.
value | the string to split. |
separator | the delimiting character or characters. |
std::string sbuild::string_list_to_string | ( | string_list const & | list, |
std::string const & | separator | ||
) |
Convert a string_list into a string.
The strings are concatenated using separator as a delimiter.
list | the list to concatenate. |
separator | the delimiting character. |
Referenced by sbuild::format_detail::add(), sbuild::session::get_user_command(), sbuild::run_parts::run_child(), sbuild::session::run_child(), and sbuild::chroot_config::validate_chroots().
char ** sbuild::string_list_to_strv | ( | string_list const & | str | ) |
Create a string vector from a string_list.
The strings in the vector, as well as the vector itself, are allocated with new, and should be freed as a whole with strv_delete.
str | the string_list to use. |
Referenced by exec(), and split_string_strict().
void sbuild::strv_delete | ( | char ** | strv | ) |
Delete a string vector.
The strings in the vector, as well as the vector itself, must have been previously allocated with new, for example sbuild::environment::get_strv.
strv | the string vector to delete. |
Referenced by exec(), and split_string_strict().
std::string sbuild::unique_identifier | ( | ) |
Get a unique string for use as a session identifier.
Depending upon the available facilities, this may be a UUID or a combinatin of the process ID and system time.
Referenced by sbuild::session::run_impl().
std::wstring sbuild::widen_string | ( | std::string const & | str, |
std::locale | locale | ||
) |
Widen a string.
The narrow string is converted into a wide string. Note that any conversion error will cause the string to be clipped at the point of error.
str | the string to widen. |
locale | the locale to use for the conversion. |
Referenced by split_string_strict().
fdstream sbuild::cctty |
CTTY stream.
A stream to the Controlling TTY, or standard input if not available.
Referenced by log_ctty_error(), log_ctty_info(), log_ctty_warning(), and sbuild::auth_pam_conv_tty::read_string().
const int sbuild::CTTY_FILENO |
CTTY fd.
The fd number of the Controlling TTY, or -1 if not available.
Referenced by sbuild::auth_pam_conv_tty::read_string(), sbuild::session::restore_termios(), and sbuild::session::save_termios().