sbuild  1.7.1
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sbuild Namespace Reference

Debian source builder components. More...

Namespaces

 auth
 Authentication and authorisation handling.
 
 chroot
 Handling and configuration of chroots.
 

Classes

class  custom_error
 Custom error. More...
 
class  environment
 Container of environment variables. More...
 
class  error_base
 Error exception base class. More...
 
class  error
 Error exception class. More...
 
class  feature
 
class  format_detail
 Format names and values for output. More...
 
class  keyfile_reader
 Keyfile reader. More...
 
class  keyfile_writer
 Keyfile writer. More...
 
class  keyfile
 Configuration file parser. More...
 
class  lock
 Advisory locking. More...
 
class  file_lock
 File lock. More...
 
class  mntstream
 Access mounts. More...
 
class  basic_nbuf
 Null stream buffer. More...
 
class  basic_nostream
 Null output stream. More...
 
class  parse_error
 Parse error. 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  date_base
 A date representation. More...
 
class  gmdate
 A date representation in UTC. More...
 
class  date
 A date representation in local time. More...
 
class  isodate
 A date representation in ISO-8601 format. More...
 
class  stat
 Get file status. More...
 
class  passwd
 System passwd database entry. More...
 
class  group
 System group database entry. 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_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

const int CTTY_FILENO (open_ctty())
 
fdstream cctty (cttybuf_fd(), boost::iostreams::close_handle)
 
const char * gettext (const char *message)
 Get a translated message. More...
 
const char * gettext (const std::string &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...
 
sbuild::keyfile operator+ (const sbuild::keyfile &lhs, const sbuild::keyfile &rhs)
 
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 (const std::exception &e)
 Log an exception as a warning. More...
 
void log_exception_error (const std::exception &e)
 Log an exception as an error. More...
 
void log_ctty_exception_warning (const std::exception &e)
 Log an exception as a warning to the Controlling TTY. More...
 
void log_ctty_exception_error (const std::exception &e)
 Log an exception as an error to the Controlling TTY. More...
 
void log_unknown_exception_error ()
 Log an unknown exception as an error.
 
mntstreamoperator>> (mntstream &stream, mntstream::mntentry &entry)
 The overloaded extraction operator. More...
 
void parse_value (const std::string &value, bool &parsed_value)
 Parse a boolean value. More...
 
void parse_value (const std::string &value, std::string &parsed_value)
 Parse a string value. More...
 
template<typename T >
void parse_value (const std::string &value, T &parsed_value)
 Parse a value of type T. More...
 
bool regex_search (const std::string &str, const regex &regex)
 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 (const std::string &name)
 Check if a pathname is absolute. More...
 
bool is_valid_sessionname (const std::string &name)
 Check if a filename matches the allowed pattern(s). More...
 
bool is_valid_filename (const std::string &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 (const string_list &list, const std::string &separator)
 Convert a string_list into a string. More...
 
string_list split_string (const std::string &value, const std::string &separator)
 Split a string into a string_list. More...
 
string_list split_string_strict (const std::string &value, const std::string &separator)
 Split a string into a string_list. More...
 
std::wstring widen_string (const std::string &str, std::locale locale)
 Widen a string. More...
 
std::string narrow_string (const std::wstring &str, std::locale locale)
 Narrow a string. More...
 
std::string find_program_in_path (const std::string &program, const std::string &path, const std::string &prefix)
 Find a program in the PATH search path. More...
 
char ** string_list_to_strv (const string_list &str)
 Create a string vector from a string_list. More...
 
void strv_delete (char **strv)
 Delete a string vector. More...
 
int exec (const std::string &file, const string_list &command, const environment &env)
 execve wrapper. More...
 
template<typename S >
std::vector< S > split_string (S const &value, S 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...
 
template<typename T >
std::string type_name ()
 Get the type name of a type, demangled if possible.
 
stat::mode_bits operator| (const stat::mode_bits &lhs, const stat::mode_bits &rhs)
 Bitwise-OR of specifed mode bits. More...
 
stat::mode_bits operator| (const mode_t &lhs, const stat::mode_bits &rhs)
 Bitwise-OR of specifed mode bits. More...
 
stat::mode_bits operator| (const stat::mode_bits &lhs, const mode_t &rhs)
 Bitwise-OR of specifed mode bits. More...
 
stat::mode_bits operator& (const stat::mode_bits &lhs, const stat::mode_bits &rhs)
 Bitwise-AND of specifed mode bits. More...
 
stat::mode_bits operator& (const mode_t &lhs, const stat::mode_bits &rhs)
 Bitwise-AND of specifed mode bits. More...
 
stat::mode_bits operator& (const stat::mode_bits &lhs, const mode_t &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 = DEBUG_NONE
 The debugging level in use.
 
nostream cnull
 A null ostream.
 

Detailed Description

Debian source builder components.

Enumeration Type Documentation

Error codes.

Enumerator
CTTY_CLOEXEC 

The controlling terminal close-on-execute flag could not be set.

CTTY_DUP 

The controlling terminal file descriptor could not be duplicated.

Debugging level.

Enumerator
DEBUG_NONE 

No debugging.

DEBUG_NOTICE 

Notification messages.

DEBUG_INFO 

Informational messages.

DEBUG_WARNING 

Warning messages.

DEBUG_CRITICAL 

Critical messages.

Error codes.

Enumerator
BAD_VALUE 

The value could not be parsed.

Function Documentation

const char* sbuild::_ ( const char *  message)
inline

Get a translated message.

This function is a shorthand for gettext, which also marks up the string for translation.

Parameters
messagethe message to translate.
Returns
the translated message.

References gettext().

Referenced by sbuild::format_detail::add(), sbuild::chroot::config::add(), sbuild::auth::deny::authenticate(), sbuild::auth::pam::authenticate(), sbuild::keyfile::check_keys(), sbuild::keyfile::check_priority(), sbuild::chroot::facet::session_clonable::clone_session(), sbuild::chroot::facet::source_clonable::clone_source(), sbuild::date_base::get_date_format(), sbuild::chroot::facet::personality::get_details(), sbuild::chroot::facet::directory_base::get_details(), sbuild::chroot::facet::userdata::get_details(), sbuild::chroot::facet::block_device_base::get_details(), sbuild::chroot::facet::loopback::get_details(), sbuild::chroot::facet::session::get_details(), sbuild::chroot::facet::mountable::get_details(), sbuild::chroot::facet::lvm_snapshot::get_details(), sbuild::chroot::facet::unshare::get_details(), sbuild::chroot::facet::file::get_details(), sbuild::chroot::facet::btrfs_snapshot::get_details(), sbuild::chroot::facet::source_clonable::get_details(), sbuild::chroot::facet::fsunion::get_details(), sbuild::chroot::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::chroot::config::print_chroot_list_simple(), sbuild::chroot::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::chroot::set_aliases(), sbuild::chroot::facet::userdata::set_data(), sbuild::chroot::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().

+ Here is the caller graph for this function:

std::string sbuild::basename ( std::string  name)

Strip the directory path from a filename.

This is similar to basename(3).

Parameters
namethe filename to strip of its path.
Returns
the base name.

Referenced by sbuild::session::get_login_command(), and sbuild::chroot::facet::lvm_snapshot::setup_env().

+ Here is the caller graph for this function:

std::string sbuild::dirname ( std::string  name)

Strip the fileame from a pathname.

This is similar to dirname(3).

Parameters
namethe path to strip of its filename.
Returns
the directory name.

Referenced by sbuild::chroot::facet::lvm_snapshot::chroot_session_setup().

+ Here is the caller graph for this function:

int sbuild::exec ( const std::string &  file,
const string_list &  command,
const environment &  env 
)

execve wrapper.

Run the command specified by file (an absolute pathname), using command and env as the argv and environment, respectively.

Parameters
filethe program to execute.
commandthe arguments to pass to the executable.
envthe environment.
Returns
the return value of the execve system call on failure.

References sbuild::environment::get_strv(), string_list_to_strv(), and strv_delete().

Referenced by sbuild::run_parts::run_child(), and sbuild::session::run_child().

+ Here is the caller graph for this function:

std::string sbuild::find_program_in_path ( const std::string &  program,
const std::string &  path,
const std::string &  prefix 
)

Find a program in the PATH search path.

Parameters
programthe program to search for.
paththe search path; typically the value of $PATH.
prefixa directory prefix the add to the search path. This may be left empty to search the root filesystem.
Returns
the absolute path of the program, or an empty string if the program could not be found.

References sbuild::stat::is_regular(), and split_string().

Referenced by sbuild::session::get_user_command(), and sbuild::session::run_child().

+ Here is the caller graph for this function:

std::string sbuild::getcwd ( )

Get the current working directory.

If it can't be found, fall back to root.

Returns
the current working directory.

Referenced by sbuild::session::run_child().

+ Here is the caller graph for this function:

const char* sbuild::gettext ( const char *  message)
inline

Get a translated message.

Parameters
messagethe message to translate.
Returns
the translated message.

Referenced by _(), sbuild::error< T >::get_error(), and gettext().

+ Here is the caller graph for this function:

const char* sbuild::gettext ( const std::string &  message)
inline

Get a translated message.

Parameters
messagethe message to translate.
Returns
the translated message.

References gettext().

const char* sbuild::gettext_noop ( const char *  message)
inline

Get a message with no translation.

Parameters
messagethe message to not translate.
Returns
the message.

Referenced by N_().

+ Here is the caller graph for this function:

bool sbuild::is_absname ( const std::string &  name)
bool sbuild::is_valid_filename ( const std::string &  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).

Parameters
namethe filename to check.
lsb_modetrue to use LSB mode, otherwise false.
Returns
true if it matches, false if not.

References regex_search().

Referenced by sbuild::run_parts::run_parts().

+ Here is the caller graph for this function:

bool sbuild::is_valid_sessionname ( const std::string &  name)

Check if a filename matches the allowed pattern(s).

This will not match dotfiles, backup files, dpkg configuration backup files, etc.

Parameters
namethe filename to check.
Returns
true if it matches, false if not.

References regex_search().

Referenced by sbuild::chroot::config::add_config_directory(), sbuild::chroot::chroot::set_aliases(), and sbuild::chroot::chroot::set_name().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_ctty_error ( )

Log an error message to the Controlling TTY.

Returns
an ostream.

References _(), and cctty.

Referenced by sbuild::auth::pam_conv_tty::conversation(), and log_ctty_exception_error().

+ Here is the caller graph for this function:

void sbuild::log_ctty_exception_error ( const std::exception &  e)

Log an exception as an error to the Controlling TTY.

Parameters
ethe exception to log.

References log_ctty_error().

void sbuild::log_ctty_exception_warning ( const std::exception &  e)

Log an exception as a warning to the Controlling TTY.

Parameters
ethe exception to log.

References log_ctty_warning().

Referenced by sbuild::auth::pam_conv_tty::get_delay().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_ctty_info ( )

Log an informational message to the Controlling TTY.

Returns
an ostream.

References _(), and cctty.

Referenced by sbuild::auth::pam_conv_tty::conversation().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_ctty_warning ( )

Log a warning message to the Controlling TTY.

Returns
an ostream.

References _(), and cctty.

Referenced by log_ctty_exception_warning().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_debug ( debug_level  level)

Log a debug message.

Parameters
levelthe debug level of the message being logged.
Returns
an ostream. This will be a valid stream if level is greater or equal to debug_level, or else a null stream will be returned, resulting in no output.

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::deny::authenticate(), sbuild::auth::pam::authenticate(), sbuild::chroot::facet::session_clonable::clone_session(), sbuild::auth::pam::close_session(), sbuild::auth::pam_conv_tty::conversation(), sbuild::auth::pam::cred_delete(), sbuild::auth::pam::cred_establish(), sbuild::chroot::facet::unshare::do_unshare(), 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::keyfile::get_value(), sbuild::chroot::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::auth::set_ruser(), sbuild::auth::auth::set_user(), sbuild::session::setup_chroot(), sbuild::auth::pam::setupenv(), sbuild::auth::deny::start(), sbuild::auth::pam::start(), and sbuild::auth::pam::stop().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_error ( )

Log an error message.

Returns
an ostream.

References _().

Referenced by log_exception_error(), log_unknown_exception_error(), sbuild::run_parts::run_child(), sbuild::session::run_chroot(), and sbuild::session::setup_chroot().

+ Here is the caller graph for this function:

void sbuild::log_exception_error ( const std::exception &  e)

Log an exception as an error.

Parameters
ethe 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::~auth(), sbuild::auth::deny::~deny(), and sbuild::auth::pam::~pam().

+ Here is the caller graph for this function:

void sbuild::log_exception_warning ( const std::exception &  e)
std::ostream & sbuild::log_info ( )

Log an informational message.

Returns
an ostream.

References _().

Referenced by sbuild::session::get_login_command(), sbuild::session::get_user_command(), and sbuild::run_parts::run_child().

+ Here is the caller graph for this function:

std::ostream & sbuild::log_warning ( )

Log a warning message.

Returns
an ostream.

References _().

Referenced by sbuild::environment::get(), log_exception_warning(), sbuild::session::restore_termios(), and sbuild::session::save_termios().

+ Here is the caller graph for this function:

const char* sbuild::N_ ( const char *  message)
inline

Get a message with no translation.

This macro is a shorthand for gettext_noop, which also marks up the string for translation.

Parameters
messagethe message to not translate.
Returns
the message.

References gettext_noop().

std::string sbuild::narrow_string ( const std::wstring &  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.

Parameters
strthe string to narrow.
localethe locale to use for the conversion.
Returns
a narrow string.
std::string sbuild::normalname ( std::string  name)

Normalise a pathname.

This strips all trailing separators, and duplicate separators within a path.

Parameters
namethe path to normalise.
Returns
the normalised name.

Referenced by sbuild::chroot::chroot::setup_env().

+ Here is the caller graph for this function:

stat::mode_bits sbuild::operator& ( const stat::mode_bits &  lhs,
const stat::mode_bits &  rhs 
)
inline

Bitwise-AND of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of AND.
stat::mode_bits sbuild::operator& ( const mode_t &  lhs,
const stat::mode_bits &  rhs 
)
inline

Bitwise-AND of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of AND.
stat::mode_bits sbuild::operator& ( const stat::mode_bits &  lhs,
const mode_t &  rhs 
)
inline

Bitwise-AND of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of AND.
sbuild::keyfile sbuild::operator+ ( const sbuild::keyfile lhs,
const sbuild::keyfile rhs 
)
Parameters
lhsthe keyfile to add to.
rhsthe values to add.
Returns
the new keyfile.
mntstream & sbuild::operator>> ( mntstream &  stream,
mntstream::mntentry &  entry 
)

The overloaded extraction operator.

This is used to pull mntentries from a mntstream.

Parameters
streamthe mntstream to get input from.
entrythe mntentry to set.
Returns
the mntstream.

References sbuild::mntstream::data, sbuild::mntstream::eof_status, and sbuild::mntstream::read().

stat::mode_bits sbuild::operator| ( const stat::mode_bits &  lhs,
const stat::mode_bits &  rhs 
)
inline

Bitwise-OR of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of OR.
stat::mode_bits sbuild::operator| ( const mode_t &  lhs,
const stat::mode_bits &  rhs 
)
inline

Bitwise-OR of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of OR.
stat::mode_bits sbuild::operator| ( const stat::mode_bits &  lhs,
const mode_t &  rhs 
)
inline

Bitwise-OR of specifed mode bits.

Parameters
lhsmode bits
rhsmode bits
Returns
result of OR.
void sbuild::parse_value ( const std::string &  value,
bool &  parsed_value 
)

Parse a boolean value.

Parameters
valuethe value to parse.
parsed_valuethe variable to store the parsed value.
Returns
true on success, false on failure.

References BAD_VALUE, DEBUG_NOTICE, and log_debug().

Referenced by sbuild::environment::get(), sbuild::keyfile::get_list_value(), sbuild::keyfile::get_set_value(), and sbuild::keyfile::get_value().

+ Here is the caller graph for this function:

void sbuild::parse_value ( const std::string &  value,
std::string &  parsed_value 
)

Parse a string value.

Parameters
valuethe value to parse.
parsed_valuethe variable to store the parsed value.
Returns
true on success, false on failure.

References DEBUG_NOTICE, and log_debug().

template<typename T >
void sbuild::parse_value ( const std::string &  value,
T &  parsed_value 
)

Parse a value of type T.

Parameters
valuethe value to parse.
parsed_valuethe variable to store the parsed value.
Returns
true on success, false on failure.

References BAD_VALUE, DEBUG_NOTICE, and log_debug().

template<typename S >
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.

Parameters
valuethe string to split.
separatorthe delimiting character or characters.
Returns
a string_list.
Todo:
Provide an alternative that splits the string in place using an iterator interface.
std::vector< std::string > sbuild::split_string ( const std::string &  value,
const std::string &  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).

Parameters
valuethe string to split.
separatorthe delimiting character or characters.
Returns
a string_list.

Referenced by find_program_in_path(), sbuild::keyfile::get_list_value(), and sbuild::keyfile::get_set_value().

+ Here is the caller graph for this function:

template<typename S >
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).

Parameters
valuethe string to split.
separatorthe delimiting character or characters.
Returns
a string_list.
Todo:
Provide an alternative that splits the string in place using an iterator interface.
std::vector< std::string > sbuild::split_string_strict ( const std::string &  value,
const std::string &  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.

Parameters
valuethe string to split.
separatorthe delimiting character or characters.
Returns
a string_list.

Referenced by sbuild::run_parts::run_child().

+ Here is the caller graph for this function:

std::string sbuild::string_list_to_string ( const string_list &  list,
const std::string &  separator 
)

Convert a string_list into a string.

The strings are concatenated using separator as a delimiter.

Parameters
listthe list to concatenate.
separatorthe delimiting character.
Returns
a string.

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().

+ Here is the caller graph for this function:

char ** sbuild::string_list_to_strv ( const string_list &  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.

Parameters
strthe string_list to use.
Returns
a string vector.

Referenced by exec().

+ Here is the caller graph for this function:

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.

Parameters
strvthe string vector to delete.

Referenced by exec().

+ Here is the caller graph for this function:

std::string sbuild::unique_identifier ( )

Get a unique string for use as a session identifier.

Returns
a session identifier.

Referenced by sbuild::session::run_impl().

+ Here is the caller graph for this function:

std::wstring sbuild::widen_string ( const std::string &  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.

Parameters
strthe string to widen.
localethe locale to use for the conversion.
Returns
a wide string.

Variable Documentation

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().