diff options
Diffstat (limited to 'internal/wayland/wayland.go')
| -rw-r--r-- | internal/wayland/wayland.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/wayland/wayland.go b/internal/wayland/wayland.go index f5113006..cc4f4e04 100644 --- a/internal/wayland/wayland.go +++ b/internal/wayland/wayland.go @@ -12,8 +12,8 @@ package wayland */ import "C" import ( + "errors" "strings" - "syscall" ) const ( @@ -134,8 +134,11 @@ func securityContextBind( appID, instanceID string, closeFd int, ) error { - if hasNull(appID) || hasNull(instanceID) { - return syscall.EINVAL + if hasNull(socketPath) || hasNull(appID) || hasNull(instanceID) { + return &Error{Cause: RBind, Path: socketPath, Errno: errors.New("argument contains NUL character")} + } + if !C.hakurei_is_valid_size_sun_path(C.size_t(len(socketPath))) { + return &Error{Cause: RBind, Path: socketPath, Errno: errors.New("socket pathname too long")} } var e Error |
