Skip to content

Commit 8997559

Browse files
reddevillgdengbo11
authored andcommitted
fix: build run use current uid/gid
Signed-off-by: reddevillg <reddevillg@gmail.com>
1 parent 6525cb7 commit 8997559

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/ll-builder/src/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,14 @@ You can report bugs to the linyaps team under this project: https://github.com/O
992992
return -1;
993993
}
994994

995+
std::optional<uid_t> uid, gid;
996+
if (buildRun->parsed()) {
997+
uid = geteuid();
998+
gid = getegid();
999+
}
1000+
9951001
if (*res) {
996-
auto res = linglong::utils::runInNamespace(argc, argv);
1002+
auto res = linglong::utils::runInNamespace(argc, argv, uid, gid);
9971003
if (!res) {
9981004
LogE("failed to run in namespace {}", res.error());
9991005
return -1;

0 commit comments

Comments
 (0)