Skip to content

Commit 6f9de93

Browse files
committed
label: remove deprecated stuff
This was mostly deprecated in 2020 and I was not able to find any existing users (except for very old vendor directories in a dozen of unmaintained repos). Time to move on. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 931542d commit 6f9de93

File tree

3 files changed

+0
-84
lines changed

3 files changed

+0
-84
lines changed

go-selinux/label/label.go

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,11 @@ import (
66
"github.com/opencontainers/selinux/go-selinux"
77
)
88

9-
// Deprecated: use selinux.ROFileLabel
10-
var ROMountLabel = selinux.ROFileLabel
11-
12-
// SetProcessLabel takes a process label and tells the kernel to assign the
13-
// label to the next program executed by the current process.
14-
// Deprecated: use selinux.SetExecLabel
15-
var SetProcessLabel = selinux.SetExecLabel
16-
17-
// ProcessLabel returns the process label that the kernel will assign
18-
// to the next program executed by the current process. If "" is returned
19-
// this indicates that the default labeling will happen for the process.
20-
// Deprecated: use selinux.ExecLabel
21-
var ProcessLabel = selinux.ExecLabel
22-
23-
// SetSocketLabel takes a process label and tells the kernel to assign the
24-
// label to the next socket that gets created
25-
// Deprecated: use selinux.SetSocketLabel
26-
var SetSocketLabel = selinux.SetSocketLabel
27-
28-
// SocketLabel retrieves the current default socket label setting
29-
// Deprecated: use selinux.SocketLabel
30-
var SocketLabel = selinux.SocketLabel
31-
32-
// SetKeyLabel takes a process label and tells the kernel to assign the
33-
// label to the next kernel keyring that gets created
34-
// Deprecated: use selinux.SetKeyLabel
35-
var SetKeyLabel = selinux.SetKeyLabel
36-
37-
// KeyLabel retrieves the current default kernel keyring label setting
38-
// Deprecated: use selinux.KeyLabel
39-
var KeyLabel = selinux.KeyLabel
40-
41-
// FileLabel returns the label for specified path
42-
// Deprecated: use selinux.FileLabel
43-
var FileLabel = selinux.FileLabel
44-
45-
// PidLabel will return the label of the process running with the specified pid
46-
// Deprecated: use selinux.PidLabel
47-
var PidLabel = selinux.PidLabel
48-
499
// Init initialises the labeling system
5010
func Init() {
5111
_ = selinux.GetEnabled()
5212
}
5313

54-
// ClearLabels will clear all reserved labels
55-
// Deprecated: use selinux.ClearLabels
56-
var ClearLabels = selinux.ClearLabels
57-
58-
// ReserveLabel will record the fact that the MCS label has already been used.
59-
// This will prevent InitLabels from using the MCS label in a newly created
60-
// container
61-
// Deprecated: use selinux.ReserveLabel
62-
func ReserveLabel(label string) error {
63-
selinux.ReserveLabel(label)
64-
return nil
65-
}
66-
67-
// ReleaseLabel will remove the reservation of the MCS label.
68-
// This will allow InitLabels to use the MCS label in a newly created
69-
// containers
70-
// Deprecated: use selinux.ReleaseLabel
71-
func ReleaseLabel(label string) error {
72-
selinux.ReleaseLabel(label)
73-
return nil
74-
}
75-
76-
// DupSecOpt takes a process label and returns security options that
77-
// can be used to set duplicate labels on future container processes
78-
// Deprecated: use selinux.DupSecOpt
79-
var DupSecOpt = selinux.DupSecOpt
80-
8114
// FormatMountLabel returns a string to be used by the mount command. Using
8215
// the SELinux `context` mount option. Changing labels of files on mount
8316
// points with this option can never be changed.

go-selinux/label/label_linux.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
7979
return processLabel, mountLabel, nil
8080
}
8181

82-
// Deprecated: The GenLabels function is only to be used during the transition
83-
// to the official API. Use InitLabels(strings.Fields(options)) instead.
84-
func GenLabels(options string) (string, string, error) {
85-
return InitLabels(strings.Fields(options))
86-
}
87-
8882
// SetFileLabel modifies the "path" label to the specified file label
8983
func SetFileLabel(path string, fileLabel string) error {
9084
if !selinux.GetEnabled() || fileLabel == "" {
@@ -123,11 +117,6 @@ func Relabel(path string, fileLabel string, shared bool) error {
123117
return selinux.Chcon(path, fileLabel, true)
124118
}
125119

126-
// DisableSecOpt returns a security opt that can disable labeling
127-
// support for future container processes
128-
// Deprecated: use selinux.DisableSecOpt
129-
var DisableSecOpt = selinux.DisableSecOpt
130-
131120
// Validate checks that the label does not include unexpected options
132121
func Validate(label string) error {
133122
if strings.Contains(label, "z") && strings.Contains(label, "Z") {

go-selinux/label/label_stub.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ func InitLabels([]string) (string, string, error) {
1010
return "", "", nil
1111
}
1212

13-
// Deprecated: The GenLabels function is only to be used during the transition
14-
// to the official API. Use InitLabels(strings.Fields(options)) instead.
15-
func GenLabels(string) (string, string, error) {
16-
return "", "", nil
17-
}
18-
1913
func SetFileLabel(string, string) error {
2014
return nil
2115
}

0 commit comments

Comments
 (0)