d0559e92af
Added --selinux-enable switch to daemon to enable SELinux labeling. The daemon will now generate a new unique random SELinux label when a container starts, and remove it when the container is removed. The MCS labels will be stored in the daemon memory. The labels of containers will be stored in the container.json file. When the daemon restarts on boot or if done by an admin, it will read all containers json files and reserve the MCS labels. A potential problem would be conflicts if you setup thousands of containers, current scheme would handle ~500,000 containers. Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan) Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: crosbymichael)
30 lines
468 B
Go
30 lines
468 B
Go
// +build !selinux !linux
|
|
|
|
package label
|
|
|
|
func GenLabels(options string) (string, string, error) {
|
|
return "", "", nil
|
|
}
|
|
|
|
func FormatMountLabel(src string, mountLabel string) string {
|
|
return src
|
|
}
|
|
|
|
func SetProcessLabel(processLabel string) error {
|
|
return nil
|
|
}
|
|
|
|
func SetFileLabel(path string, fileLabel string) error {
|
|
return nil
|
|
}
|
|
|
|
func GetPidCon(pid int) (string, error) {
|
|
return "", nil
|
|
}
|
|
|
|
func Init() {
|
|
}
|
|
|
|
func ReserveLabel(label string) error {
|
|
return nil
|
|
}
|