label_stub.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 FormatMountLabel(src string, mountLabel string) string {
  15. return src
  16. }
  17. func SetFileLabel(path string, fileLabel string) error {
  18. return nil
  19. }
  20. func SetFileCreateLabel(fileLabel string) error {
  21. return nil
  22. }
  23. func Relabel(path string, fileLabel string, shared bool) error {
  24. return nil
  25. }
  26. // DisableSecOpt returns a security opt that can disable labeling
  27. // support for future container processes
  28. func DisableSecOpt() []string {
  29. // TODO the selinux.DisableSecOpt stub returns []string{"disable"} instead of "nil"
  30. return nil
  31. }
  32. // Validate checks that the label does not include unexpected options
  33. func Validate(label string) error {
  34. return nil
  35. }
  36. // RelabelNeeded checks whether the user requested a relabel
  37. func RelabelNeeded(label string) bool {
  38. return false
  39. }
  40. // IsShared checks that the label includes a "shared" mark
  41. func IsShared(label string) bool {
  42. return false
  43. }