label.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. func ROMountLabel() string {
  10. return ""
  11. }
  12. func GenLabels(options string) (string, string, error) {
  13. return "", "", nil
  14. }
  15. func FormatMountLabel(src string, mountLabel string) string {
  16. return src
  17. }
  18. func SetProcessLabel(processLabel string) error {
  19. return nil
  20. }
  21. func ProcessLabel() (string, error) {
  22. return "", nil
  23. }
  24. func SetSocketLabel(processLabel string) error {
  25. return nil
  26. }
  27. func SocketLabel() (string, error) {
  28. return "", nil
  29. }
  30. func SetKeyLabel(processLabel string) error {
  31. return nil
  32. }
  33. func KeyLabel() (string, error) {
  34. return "", nil
  35. }
  36. func FileLabel(path string) (string, error) {
  37. return "", nil
  38. }
  39. func SetFileLabel(path string, fileLabel string) error {
  40. return nil
  41. }
  42. func SetFileCreateLabel(fileLabel string) error {
  43. return nil
  44. }
  45. func Relabel(path string, fileLabel string, shared bool) error {
  46. return nil
  47. }
  48. func PidLabel(pid int) (string, error) {
  49. return "", nil
  50. }
  51. func Init() {
  52. }
  53. // ClearLabels clears all reserved labels
  54. func ClearLabels() {
  55. return
  56. }
  57. func ReserveLabel(label string) error {
  58. return nil
  59. }
  60. func ReleaseLabel(label string) error {
  61. return nil
  62. }
  63. // DupSecOpt takes a process label and returns security options that
  64. // can be used to set duplicate labels on future container processes
  65. func DupSecOpt(src string) ([]string, error) {
  66. return nil, nil
  67. }
  68. // DisableSecOpt returns a security opt that can disable labeling
  69. // support for future container processes
  70. func DisableSecOpt() []string {
  71. return nil
  72. }
  73. // Validate checks that the label does not include unexpected options
  74. func Validate(label string) error {
  75. return nil
  76. }
  77. // RelabelNeeded checks whether the user requested a relabel
  78. func RelabelNeeded(label string) bool {
  79. return false
  80. }
  81. // IsShared checks that the label includes a "shared" mark
  82. func IsShared(label string) bool {
  83. return false
  84. }