[Libct] [PATCH 5/7] libct: remove old stuff

Andrey Vagin avagin at openvz.org
Thu Oct 30 01:55:12 PDT 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 src/ct.c                 | 31 -------------------------------
 src/include/ct.h         | 12 ------------
 src/include/uapi/libct.h |  4 ----
 src/libct.c              | 13 -------------
 4 files changed, 60 deletions(-)

diff --git a/src/ct.c b/src/ct.c
index 785f31f..b3a13ff 100644
--- a/src/ct.c
+++ b/src/ct.c
@@ -614,35 +614,6 @@ static int local_uname(ct_handler_t h, char *host, char *dom)
 	return 0;
 }
 
-static int local_set_caps(ct_handler_t h, unsigned long mask, unsigned int apply_to)
-{
-	struct container *ct = cth2ct(h);
-
-	if (ct->state != CT_STOPPED)
-		return -LCTERR_BADCTSTATE;
-
-	if (apply_to & CAPS_BSET) {
-		ct->cap_mask |= CAPS_BSET;
-		ct->cap_bset = mask;
-	}
-
-	if (apply_to & CAPS_ALLCAPS) {
-		ct->cap_mask |= CAPS_ALLCAPS;
-		ct->cap_caps = mask;
-	}
-
-	return 0;
-}
-
-static int local_set_pdeathsig(ct_handler_t h, int sig)
-{
-	struct container *ct = cth2ct(h);
-
-	ct->pdeathsig = sig;
-
-	return 0;
-}
-
 char *local_ct_name(ct_handler_t h)
 {
 	return cth2ct(h)->name;
@@ -714,8 +685,6 @@ static const struct container_ops local_ct_ops = {
 	.net_del		= local_net_del,
 	.net_route_add		= local_net_route_add,
 	.uname			= local_uname,
-	.set_caps		= local_set_caps,
-	.set_pdeathsig		= local_set_pdeathsig,
 	.add_uid_map		= local_add_uid_map,
 	.add_gid_map		= local_add_gid_map,
 };
diff --git a/src/include/ct.h b/src/include/ct.h
index b08c0aa..ebce788 100644
--- a/src/include/ct.h
+++ b/src/include/ct.h
@@ -36,8 +36,6 @@ struct container_ops {
 	int (*net_del)(ct_handler_t h, enum ct_net_type, void *arg);
 	ct_net_route_t (*net_route_add)(ct_handler_t h);
 	int (*uname)(ct_handler_t h, char *host, char *domain);
-	int (*set_caps)(ct_handler_t h, unsigned long mask, unsigned int apply_to);
-	int (*set_pdeathsig)(ct_handler_t h, int sig);
 	int (*add_uid_map)(ct_handler_t ct, unsigned int first,
 			unsigned int lower_first, unsigned int count);
 	int (*add_gid_map)(ct_handler_t ct, unsigned int first,
@@ -79,16 +77,6 @@ struct container {
 	char			*domainname;
 
 	/*
-	 * Security 
-	 */
-
-	unsigned int		cap_mask;
-
-	unsigned long		cap_bset;
-	unsigned long		cap_caps;
-	int			pdeathsig;
-
-	/*
 	 * FS-specific fields
 	 */
 
diff --git a/src/include/uapi/libct.h b/src/include/uapi/libct.h
index edd94eb..5c4672a 100644
--- a/src/include/uapi/libct.h
+++ b/src/include/uapi/libct.h
@@ -78,10 +78,6 @@ extern int libct_controller_configure(ct_handler_t ct, enum ct_controller ctype,
 
 extern int libct_container_uname(ct_handler_t ct, char *host, char *domain);
 
-extern int libct_container_set_caps(ct_handler_t ct, unsigned long mask, unsigned int apply_to);
-
-extern int libct_container_set_pdeathsig(ct_handler_t ct, int sig);
-
 /*
  * FS configuration
  */
diff --git a/src/libct.c b/src/libct.c
index 2c1c56e..af109f0 100644
--- a/src/libct.c
+++ b/src/libct.c
@@ -155,19 +155,6 @@ int libct_container_uname(ct_handler_t ct, char *host, char *domain)
 	return ct->ops->uname(ct, host, domain);
 }
 
-int libct_container_set_caps(ct_handler_t ct, unsigned long mask, unsigned int apply_to)
-{
-	if (!apply_to || (apply_to & ~CAPS_ALL))
-		return -LCTERR_INVARG;
-
-	return ct->ops->set_caps(ct, mask, apply_to);
-}
-
-int libct_container_set_pdeathsig(ct_handler_t ct, int sig)
-{
-	return ct->ops->set_pdeathsig(ct, sig);
-}
-
 libct_session_t libct_session_open(char *how)
 {
 	if (!how || !strcmp(how, "local"))
-- 
1.9.1



More information about the Libct mailing list