Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
41ca8908
Commit
41ca8908
authored
Oct 18, 2013
by
Dwight Engen
Committed by
Serge Hallyn
Oct 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lsm op for getting name of enabled lsm
Signed-off-by:
Dwight Engen
<
dwight.engen@oracle.com
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
3d460a38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
lsm.c
src/lxc/lsm/lsm.c
+8
-1
lsm.h
src/lxc/lsm/lsm.h
+14
-12
No files found.
src/lxc/lsm/lsm.c
View file @
41ca8908
...
@@ -62,13 +62,20 @@ void lsm_init(void)
...
@@ -62,13 +62,20 @@ void lsm_init(void)
INFO
(
"Initialized LSM security driver %s"
,
drv
->
name
);
INFO
(
"Initialized LSM security driver %s"
,
drv
->
name
);
}
}
int
lsm_enabled
()
int
lsm_enabled
(
void
)
{
{
if
(
drv
)
if
(
drv
)
return
drv
->
enabled
();
return
drv
->
enabled
();
return
0
;
return
0
;
}
}
const
char
*
lsm_name
(
void
)
{
if
(
drv
)
return
drv
->
name
;
return
"none"
;
}
char
*
lsm_process_label_get
(
pid_t
pid
)
char
*
lsm_process_label_get
(
pid_t
pid
)
{
{
if
(
!
drv
)
{
if
(
!
drv
)
{
...
...
src/lxc/lsm/lsm.h
View file @
41ca8908
...
@@ -37,19 +37,21 @@ struct lsm_drv {
...
@@ -37,19 +37,21 @@ struct lsm_drv {
};
};
#if HAVE_APPARMOR || HAVE_SELINUX
#if HAVE_APPARMOR || HAVE_SELINUX
void
lsm_init
(
void
);
void
lsm_init
(
void
);
int
lsm_enabled
(
void
);
int
lsm_enabled
(
void
);
char
*
lsm_process_label_get
(
pid_t
pid
);
const
char
*
lsm_name
(
void
);
int
lsm_process_label_set
(
const
char
*
label
,
int
use_default
);
char
*
lsm_process_label_get
(
pid_t
pid
);
int
lsm_proc_mount
(
struct
lxc_conf
*
lxc_conf
);
int
lsm_process_label_set
(
const
char
*
label
,
int
use_default
);
void
lsm_proc_unmount
(
struct
lxc_conf
*
lxc_conf
);
int
lsm_proc_mount
(
struct
lxc_conf
*
lxc_conf
);
void
lsm_proc_unmount
(
struct
lxc_conf
*
lxc_conf
);
#else
#else
static
inline
void
lsm_init
(
void
)
{
}
static
inline
void
lsm_init
(
void
)
{
}
static
inline
int
lsm_enabled
(
void
)
{
return
0
;
}
static
inline
int
lsm_enabled
(
void
)
{
return
0
;
}
static
inline
char
*
lsm_process_label_get
(
pid_t
pid
)
{
return
NULL
;
}
static
inline
const
char
*
lsm_name
(
void
)
{
return
"none"
;
}
static
inline
int
lsm_process_label_set
(
char
*
label
,
int
use_default
)
{
return
0
;
}
static
inline
char
*
lsm_process_label_get
(
pid_t
pid
)
{
return
NULL
;
}
static
inline
int
lsm_proc_mount
(
struct
lxc_conf
*
lxc_conf
)
{
return
0
;
}
static
inline
int
lsm_process_label_set
(
char
*
label
,
int
use_default
)
{
return
0
;
}
static
inline
void
lsm_proc_unmount
(
struct
lxc_conf
*
lxc_conf
)
{
}
static
inline
int
lsm_proc_mount
(
struct
lxc_conf
*
lxc_conf
)
{
return
0
;
}
static
inline
void
lsm_proc_unmount
(
struct
lxc_conf
*
lxc_conf
)
{
}
#endif
#endif
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment