![]() |
![]() |
![]() |
Schroot Reference Manual | ![]() |
---|
SbuildSessionSbuildSession — session object |
enum SbuildSessionError; #define SBUILD_SESSION_ERROR SbuildSession; SbuildSessionClass; SbuildSession* sbuild_session_new (const char *service, SbuildConfig *config, char **chroots); SbuildConfig* sbuild_session_get_config (const SbuildSession *restrict session); void sbuild_session_set_config (SbuildSession *session, SbuildConfig *config); char** sbuild_session_get_chroots (const SbuildSession *restrict session); void sbuild_session_set_chroots (SbuildSession *session, char **chroots); int sbuild_session_get_child_status (SbuildSession *session);
"child-status" gint : Read "chroots" GStrv : Read / Write / Construct "config" SbuildConfig : Read / Write / Construct
This object provides the session handling for schroot. It derives from SbuildAuth, which performs all the necessary PAM actions, specialising it by overriding its virtual functions. This allows more sophisticated handling of user authorisation (groups and root-groups membership in the configuration file) and session management (setting up the session, entering the chroot and running the requested commands or shell).
typedef enum { SBUILD_SESSION_ERROR_FORK, SBUILD_SESSION_ERROR_CHILD, SBUILD_SESSION_ERROR_CHROOT } SbuildSessionError;
The errors which can occur while running a session.
SBUILD_SESSION_ERROR_FORK |
A child process could not be created |
SBUILD_SESSION_ERROR_CHILD |
An error occured during execution of the child process |
SBUILD_SESSION_ERROR_CHROOT |
An error occured finding the chroot |
#define SBUILD_SESSION_ERROR sbuild_session_error_quark()
The error domain for sbuild session errors.
typedef struct { SbuildAuthClass parent; } SbuildSessionClass;
SbuildSession class.
SbuildAuthClass parent ; |
the parent class |
SbuildSession* sbuild_session_new (const char *service, SbuildConfig *config, char **chroots);
Creates a new SbuildSession. The session will use the provided
configuration data, and will run in the list of chroots specified.
service
MUST be a constant string literal, for security reasons;
the application service name should be hard-coded.
service : |
the PAM service name |
config : |
an SbuildConfig |
chroots : |
the chroots to use |
Returns : | the newly created SbuildSession. |
SbuildConfig* sbuild_session_get_config (const SbuildSession *restrict session);
Get the configuration associated with session
.
session : |
an SbuildSession |
Returns : | an SbuildConfig. |
void sbuild_session_set_config (SbuildSession *session, SbuildConfig *config);
Set the configuration associated with session
.
session : |
an SbuildSession |
config : |
an SbuildConfig |
char** sbuild_session_get_chroots (const SbuildSession *restrict session);
Get the chroots to use in session
.
session : |
an SbuildSession |
Returns : | a string vector. This string vector points to internally allocated storage in the chroot and must not be freed, modified or stored. |
void sbuild_session_set_chroots (SbuildSession *session, char **chroots);
Set the chroots to use in session
.
session : |
an SbuildSession |
chroots : |
the chroots to use |
int sbuild_session_get_child_status (SbuildSession *session);
Get the exit (wait) status of the last child process to run in this session.
session : |
an SbuildSession |
Returns : | the exit status. |
child-status
" property"child-status" gint : Read
The exit (wait) status of the child process.
Allowed values: >= 0
Default value: 0
config
" property"config" SbuildConfig : Read / Write / Construct
The chroot configuration data.
<< SbuildAuth | Closure Marshallers >> |