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

Signed-off-by: zhongjiawei <zhongjiawei1@huawei.com>
---
 libcontainer/rootfs_linux.go     | 6 ------
 libcontainer/setns_init_linux.go | 6 ------
 2 files changed, 12 deletions(-)

diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go
index 8749114..ef81f5f 100644
--- a/libcontainer/rootfs_linux.go
+++ b/libcontainer/rootfs_linux.go
@@ -190,12 +190,6 @@ func finalizeRootfs(config *configs.Config) (err error) {
 	} else {
 		unix.Umask(0o022)
 	}
-	umask := utils.SearchLabels(config.Labels, "native.umask")
-	if umask == "normal" {
-		unix.Umask(0o022)
-	} else {
-		unix.Umask(0o027)
-	}
 	return nil
 }
 
diff --git a/libcontainer/setns_init_linux.go b/libcontainer/setns_init_linux.go
index f1dcab6..d8cdfdf 100644
--- a/libcontainer/setns_init_linux.go
+++ b/libcontainer/setns_init_linux.go
@@ -56,12 +56,6 @@ func (l *linuxSetnsInit) Init() error {
 			return err
 		}
 	}
-        umask := utils.SearchLabels(l.config.Config.Labels, "native.umask")
-        if umask == "normal" {
-                unix.Umask(0o022)
-        } else {
-                unix.Umask(0o027)
-        }
 	if l.config.NoNewPrivileges {
 		if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
 			return err
-- 
2.33.0

