lxc/0023-attach.c-change-uid-and-gid-from-lxc-container-confi.patch

32 lines
920 B
Diff
Raw Normal View History

From ecd40a856d039f7bc67ac076041a07cb369eaa77 Mon Sep 17 00:00:00 2001
2019-09-30 11:03:07 -04:00
From: tanyifeng <tanyifeng1@huawei.com>
Date: Mon, 14 Jan 2019 17:09:57 +0800
Subject: [PATCH 023/140] attach.c: change uid and gid from lxc container
2019-09-30 11:03:07 -04:00
config
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/attach.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/lxc/attach.c b/src/lxc/attach.c
index 570b9d0..e6e4b0d 100644
2019-09-30 11:03:07 -04:00
--- a/src/lxc/attach.c
+++ b/src/lxc/attach.c
@@ -1146,6 +1146,12 @@ int lxc_attach(const char *name, const char *lxcpath,
}
conf = init_ctx->container->lxc_conf;
+ // isulad: always switch uid and gid for attach
+ if (options->uid == -1)
+ options->uid = init_ctx->container->lxc_conf->init_uid;
+ if (options->gid == -1)
+ options->gid = init_ctx->container->lxc_conf->init_gid;
+
if (!fetch_seccomp(init_ctx->container, options))
WARN("Failed to get seccomp policy");
--
1.8.3.1
2019-09-30 11:03:07 -04:00