forked from containers/buildah
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve file and directory mount permissions
Before that change, all directory permissions were `0755` and all file permissions had `0700`, without taking umask into consideration. We now save the file permissions and map them correctly into the target container. All necessary integration tests have been added as well. Signed-off-by: Sascha Grunert <[email protected]> Closes: containers#1833 Approved by: rhatdan
- Loading branch information
1 parent
cc80ccc
commit 34f1ae6
Showing
6 changed files
with
82 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
// +build linux darwin | ||
|
||
package main | ||
package umask | ||
|
||
import ( | ||
"syscall" | ||
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
func checkUmask() { | ||
func CheckUmask() { | ||
oldUmask := syscall.Umask(0022) | ||
if (oldUmask & ^0022) != 0 { | ||
logrus.Debugf("umask value too restrictive. Forcing it to 022") | ||
} | ||
} | ||
|
||
func SetUmask(value int) int { | ||
return syscall.Umask(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build !linux,!darwin | ||
|
||
package umask | ||
|
||
func CheckUmask() {} | ||
|
||
func SetUmask(int) int { return 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters