mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-05 15:37:02 +08:00
libct/cg/fscommon.GetCgroupParamString: use ReadFile
1. Use own ReadFile wrapper instead of ioutils.ReadFile. This makes it use the security measures of ReadFile. 2. Improve doc. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -73,9 +73,9 @@ func GetCgroupParamUint(cgroupPath, cgroupFile string) (uint64, error) {
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets a string value from the specified cgroup file
|
// GetCgroupParamString reads a string from the specified cgroup file.
|
||||||
func GetCgroupParamString(cgroupPath, cgroupFile string) (string, error) {
|
func GetCgroupParamString(path, file string) (string, error) {
|
||||||
contents, err := ioutil.ReadFile(filepath.Join(cgroupPath, cgroupFile))
|
contents, err := ReadFile(path, file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user