forked from security/hakurei
internal/pipewire: high level SecurityContext helper
This sets up close pipe and socket internally, and exposes the resulting pathname socket and close_fd cleanup as an io.Closer. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -52,6 +52,7 @@ func New(displayPath, bindPath *check.Absolute, appID, instanceID string) (*Secu
|
||||
if f, err := os.Create(bindPath.String()); err != nil {
|
||||
return nil, &Error{RCreate, bindPath.String(), displayPath.String(), err}
|
||||
} else if err = f.Close(); err != nil {
|
||||
_ = os.Remove(bindPath.String())
|
||||
return nil, &Error{RCreate, bindPath.String(), displayPath.String(), err}
|
||||
} else if err = os.Remove(bindPath.String()); err != nil {
|
||||
return nil, &Error{RCreate, bindPath.String(), displayPath.String(), err}
|
||||
|
||||
Reference in New Issue
Block a user