label_stub.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // +build !selinux !linux
  2. package label
  3. // InitLabels returns the process label and file labels to be used within
  4. // the container. A list of options can be passed into this function to alter
  5. // the labels.
  6. func InitLabels(options []string) (string, string, error) {
  7. return "", "", nil
  8. }
  9. // Deprecated: The GenLabels function is only to be used during the transition
  10. // to the official API. Use InitLabels(strings.Fields(options)) instead.
  11. func GenLabels(options string) (string, string, error) {
  12. return "", "", nil
  13. }
  14. func SetFileLabel(path string, fileLabel string) error {
  15. return nil
  16. }
  17. func SetFileCreateLabel(fileLabel string) error {
  18. return nil
  19. }
  20. func Relabel(path string, fileLabel string, shared bool) error {
  21. return nil
  22. }
  23. // DisableSecOpt returns a security opt that can disable labeling
  24. // support for future container processes
  25. func DisableSecOpt() []string {
  26. // TODO the selinux.DisableSecOpt stub returns []string{"disable"} instead of "nil"
  27. return nil
  28. }
  29. // Validate checks that the label does not include unexpected options
  30. func Validate(label string) error {
  31. return nil
  32. }
  33. // RelabelNeeded checks whether the user requested a relabel
  34. func RelabelNeeded(label string) bool {
  35. return false
  36. }
  37. // IsShared checks that the label includes a "shared" mark
  38. func IsShared(label string) bool {
  39. return false
  40. }