Skip to content

Commit 44b3337

Browse files
authored
Merge pull request #216 from rhatdan/main
Show SELinux label on failure
2 parents bb1ec25 + 5bdefc7 commit 44b3337

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go-selinux/selinux_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func lSetFileLabel(fpath string, label string) error {
329329
break
330330
}
331331
if err != unix.EINTR {
332-
return &os.PathError{Op: "lsetxattr", Path: fpath, Err: err}
332+
return &os.PathError{Op: fmt.Sprintf("lsetxattr(label=%s)", label), Path: fpath, Err: err}
333333
}
334334
}
335335

@@ -348,7 +348,7 @@ func setFileLabel(fpath string, label string) error {
348348
break
349349
}
350350
if err != unix.EINTR {
351-
return &os.PathError{Op: "setxattr", Path: fpath, Err: err}
351+
return &os.PathError{Op: fmt.Sprintf("setxattr(label=%s)", label), Path: fpath, Err: err}
352352
}
353353
}
354354

0 commit comments

Comments
 (0)