Skip to content

Commit 588976f

Browse files
committed
go-selinux: move to internal/impl
This moves (git mv) the whole package to under internal, with the minimal changes: - package name; - remove the deprecated ReserveLabel; - remove the deprecated notice from ContainerLabels (it will stay as internal function). This commit breaks git-bisect; this is done deliberately to show this is merely the moving files around. The next commit fixes things. Technically, we can also remove the wrappers and instead make the actual implementation methods public, but there is no need. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 60872cb commit 588976f

8 files changed

Lines changed: 12 additions & 20 deletions

File tree

.codespellrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[codespell]
2-
skip = ./.git,./go.sum,./go-selinux/testdata
2+
skip = ./.git,./go.sum,,./internal/impl/testdata

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
# https://github.com/opencontainers/selinux/issues/225
148148
- name: "racy test"
149149
continue-on-error: true
150-
run: lima bash -c 'cd /tmp/selinux && go test -timeout 10m -count 100000 ./go-selinux'
150+
run: lima bash -c 'cd /tmp/selinux && go test -timeout 10m -count 100000 ./internal/impl'
151151

152152
- name: "Show AVC denials"
153153
run: lima sudo ausearch -m AVC,USER_AVC || true
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package selinux
1+
package impl
22

33
import (
44
"errors"
@@ -224,15 +224,8 @@ func ClearLabels() {
224224
}
225225

226226
// ReserveLabel reserves the MLS/MCS level component of the specified label.
227-
//
228-
// Deprecated: use [ReserveLabelV2] instead.
229-
func ReserveLabel(label string) {
230-
_ = reserveLabel(label)
231-
}
232-
233-
// ReserveLabelV2 reserves the MLS/MCS level component of the specified label.
234227
// Returns an error if the label can't be reserved.
235-
func ReserveLabelV2(label string) error {
228+
func ReserveLabel(label string) error {
236229
return reserveLabel(label)
237230
}
238231

@@ -308,9 +301,6 @@ func InitContainerLabel() (string, error) {
308301

309302
// ContainerLabels returns an allocated processLabel and fileLabel to be used for
310303
// container labeling by the calling process.
311-
//
312-
// Deprecated: this (apparently) has no users and will be removed from the
313-
// future version of this package. Open a bug report if you use it.
314304
func ContainerLabels() (processLabel string, fileLabel string) {
315305
return containerLabels()
316306
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package selinux
1+
package impl
22

33
import (
44
"bufio"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package selinux
1+
package impl
22

33
import (
44
"bufio"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !linux
22

3-
package selinux
3+
package impl
44

55
func readConThreadSelf(string) (string, error) {
66
return "", nil
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build !linux
22

3-
package selinux
3+
package impl
44

55
import (
66
"testing"
@@ -46,7 +46,9 @@ func TestSELinuxStubs(t *testing.T) {
4646

4747
ClearLabels()
4848

49-
ReserveLabel(testLabel)
49+
if err := ReserveLabel(testLabel); err != nil {
50+
t.Error(err)
51+
}
5052
ReleaseLabel(testLabel)
5153
if _, err := DupSecOpt(testLabel); err != nil {
5254
t.Error(err)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package selinux
1+
package impl
22

33
import (
44
"golang.org/x/sys/unix"

0 commit comments

Comments
 (0)