Bump github.com/opencontainers/selinux from 1.8.0 to 1.8.1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
		
							
								
								
									
										5
									
								
								vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -25,6 +25,8 @@ var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be use
 | 
			
		||||
// the container.  A list of options can be passed into this function to alter
 | 
			
		||||
// the labels.  The labels returned will include a random MCS String, that is
 | 
			
		||||
// guaranteed to be unique.
 | 
			
		||||
// If the disabled flag is passed in, the process label will not be set, but the mount label will be set
 | 
			
		||||
// to the container_file label with the maximum category. This label is not usable by any confined label.
 | 
			
		||||
func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
 | 
			
		||||
	if !selinux.GetEnabled() {
 | 
			
		||||
		return "", "", nil
 | 
			
		||||
@@ -47,7 +49,8 @@ func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
 | 
			
		||||
		}
 | 
			
		||||
		for _, opt := range options {
 | 
			
		||||
			if opt == "disable" {
 | 
			
		||||
				return "", mountLabel, nil
 | 
			
		||||
				selinux.ReleaseLabel(mountLabel)
 | 
			
		||||
				return "", selinux.PrivContainerMountLabel(), nil
 | 
			
		||||
			}
 | 
			
		||||
			if i := strings.Index(opt, ":"); i == -1 {
 | 
			
		||||
				return "", "", errors.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user