From 4ad8d9afa92e3b9a94d9ff099ae21bc771f903da Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
Date: Thu, 11 Jul 2024 19:40:00 +0800
Subject: [PATCH] runc:do not support set umask through native.umask

---
 libcontainer/rootfs_linux.go     | 6 ------
 libcontainer/setns_init_linux.go | 7 -------
 2 files changed, 13 deletions(-)

diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go
index 7d52b62..a948090 100644
--- a/libcontainer/rootfs_linux.go
+++ b/libcontainer/rootfs_linux.go
@@ -149,12 +149,6 @@ func finalizeRootfs(config *configs.Config) (err error) {
 		}
 	}
 
-	umask := libcontainerUtils.SearchLabels(config.Labels, "native.umask")
-	if umask == "normal" {
-		syscall.Umask(0022)
-	} else {
-		syscall.Umask(0027)
-	}
 	return nil
 }
 
diff --git a/libcontainer/setns_init_linux.go b/libcontainer/setns_init_linux.go
index 74a91a6..d80fec6 100644
--- a/libcontainer/setns_init_linux.go
+++ b/libcontainer/setns_init_linux.go
@@ -45,13 +45,6 @@ func (l *linuxSetnsInit) Init() error {
 			return err
 		}
 	}
-	// set exec process umask to 0027 or 0022 according to container's config
-	umask := utils.SearchLabels(l.config.Config.Labels, "native.umask")
-	if umask == "normal" {
-		syscall.Umask(0022)
-	} else {
-		syscall.Umask(0027)
-	}
 	if l.config.NoNewPrivileges {
 		if err := system.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
 			return err
-- 
2.33.0

