LXC
Data Structures | Macros | Typedefs | Enumerations | Functions
attach_options.h File Reference
#include <sys/types.h>
Include dependency graph for attach_options.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lxc_attach_options_t
 
struct  lxc_attach_command_t
 

Macros

#define LXC_ATTACH_LSM   (LXC_ATTACH_LSM_EXEC | LXC_ATTACH_LSM_NOW)
 
#define LXC_ATTACH_OPTIONS_DEFAULT
 

Typedefs

typedef enum lxc_attach_env_policy_t lxc_attach_env_policy_t
 
typedef int(* lxc_attach_exec_t) (void *payload)
 
typedef struct lxc_attach_options_t lxc_attach_options_t
 
typedef struct lxc_attach_command_t lxc_attach_command_t
 

Enumerations

enum  lxc_attach_env_policy_t { LXC_ATTACH_KEEP_ENV, LXC_ATTACH_CLEAR_ENV }
 
enum  {
  LXC_ATTACH_MOVE_TO_CGROUP = 0x00000001, LXC_ATTACH_DROP_CAPABILITIES = 0x00000002, LXC_ATTACH_SET_PERSONALITY = 0x00000004, LXC_ATTACH_LSM_EXEC = 0x00000008,
  LXC_ATTACH_REMOUNT_PROC_SYS = 0x00010000, LXC_ATTACH_LSM_NOW = 0x00020000, LXC_ATTACH_DEFAULT = 0x0000FFFF
}
 

Functions

int lxc_attach_run_command (void *payload)
 Run a command in the container. More...
 
int lxc_attach_run_shell (void *payload)
 Run a shell command in the container. More...
 

Detailed Description

lxc: linux Container library

(C) Copyright IBM Corp. 2007, 2008

Authors: Daniel Lezcano <daniel.lezcano at free.fr>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Macro Definition Documentation

◆ LXC_ATTACH_LSM

#define LXC_ATTACH_LSM   (LXC_ATTACH_LSM_EXEC | LXC_ATTACH_LSM_NOW)

All Linux Security Module flags

◆ LXC_ATTACH_OPTIONS_DEFAULT

#define LXC_ATTACH_OPTIONS_DEFAULT
Value:
{ \
/* .attach_flags = */ LXC_ATTACH_DEFAULT, \
/* .namespaces = */ -1, \
/* .personality = */ -1, \
/* .initial_cwd = */ NULL, \
/* .uid = */ (uid_t)-1, \
/* .gid = */ (gid_t)-1, \
/* .env_policy = */ LXC_ATTACH_KEEP_ENV, \
/* .extra_env_vars = */ NULL, \
/* .extra_keep_env = */ NULL, \
/* .stdin_fd = */ 0, 1, 2 \
}
Mask of flags to apply by default.
Definition: attach_options.h:58
Retain the environment.
Definition: attach_options.h:38

Default attach options to use

Typedef Documentation

◆ lxc_attach_command_t

Representation of a command to run in a container.

◆ lxc_attach_env_policy_t

LXC environment policy.

◆ lxc_attach_exec_t

typedef int(* lxc_attach_exec_t) (void *payload)

LXC attach function type.

Function to run in container.

Parameters
payloadlxc_attach_command_t to run.
Returns
Function should return 0 on success, and any other value to denote failure.

◆ lxc_attach_options_t

LXC attach options for lxc_container attach().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LXC_ATTACH_MOVE_TO_CGROUP 

Move to cgroup.

LXC_ATTACH_DROP_CAPABILITIES 

Drop capabilities.

LXC_ATTACH_SET_PERSONALITY 

Set personality.

LXC_ATTACH_LSM_EXEC 

Execute under a Linux Security Module.

LXC_ATTACH_REMOUNT_PROC_SYS 

Remount /proc filesystem.

LXC_ATTACH_LSM_NOW 

FIXME: unknown.

LXC_ATTACH_DEFAULT 

Mask of flags to apply by default.

◆ lxc_attach_env_policy_t

LXC environment policy.

Enumerator
LXC_ATTACH_KEEP_ENV 

Retain the environment.

LXC_ATTACH_CLEAR_ENV 

Clear the environment.

Function Documentation

◆ lxc_attach_run_command()

int lxc_attach_run_command ( void *  payload)

Run a command in the container.

Parameters
payloadlxc_attach_command_t to run.
Returns
-1 on error, exit code of lxc_attach_command_t program on success.

◆ lxc_attach_run_shell()

int lxc_attach_run_shell ( void *  payload)

Run a shell command in the container.

Parameters
payloadNot used.
Returns
Exit code of shell.