SbuildSession

SbuildSession — session object

Synopsis




enum        SbuildSessionError;
#define     SBUILD_SESSION_ERROR
            SbuildSession;
            SbuildSessionClass;
SbuildSession* sbuild_session_new           (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);

Object Hierarchy


  GObject
   +----SbuildAuth
         +----SbuildSession

Properties


  "child-status"         gint                  : Read
  "chroots"              GStrv                 : Read / Write / Construct
  "config"               SbuildConfig          : Read / Write / Construct

Description

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

Details

enum SbuildSessionError

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

SBUILD_SESSION_ERROR

#define SBUILD_SESSION_ERROR sbuild_session_error_quark()

The error domain for sbuild session errors.


SbuildSession

typedef struct _SbuildSession SbuildSession;

SbuildSession object.


SbuildSessionClass

typedef struct {
  SbuildAuthClass parent;
} SbuildSessionClass;

SbuildSession class.

SbuildAuthClass parent; the parent class

sbuild_session_new ()

SbuildSession* sbuild_session_new           (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.

config : an SbuildConfig
chroots : the chroots to use
Returns : the newly created SbuildSession.

sbuild_session_get_config ()

SbuildConfig* sbuild_session_get_config     (const SbuildSession *restrict session);

Get the configuration associated with session.

session : an SbuildSession
Returns : an SbuildConfig.

sbuild_session_set_config ()

void        sbuild_session_set_config       (SbuildSession *session,
                                             SbuildConfig *config);

Set the configuration associated with session.

session : an SbuildSession
config : an SbuildConfig

sbuild_session_get_chroots ()

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.

sbuild_session_set_chroots ()

void        sbuild_session_set_chroots      (SbuildSession *session,
                                             char **chroots);

Set the chroots to use in session.

session : an SbuildSession
chroots : the chroots to use

sbuild_session_get_child_status ()

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.

Properties

The "child-status" property

  "child-status"         gint                  : Read

The exit (wait) status of the child process.

Allowed values: >= 0

Default value: 0


The "chroots" property

  "chroots"              GStrv                 : Read / Write / Construct

The chroots to use.


The "config" property

  "config"               SbuildConfig          : Read / Write / Construct

The chroot configuration data.