Skip to content

Build fails on OpenBSD: pkg/privileges/privileges.go:6:17: undefined: isPrivileged #976

@maybebyte

Description

@maybebyte

Naabu version:

v2.2.1

Current Behavior:

On OpenBSD 7.4, the build fails in the same way as it did for FreeBSD in #782.

github.com/projectdiscovery/naabu/v2/pkg/privileges
# github.com/projectdiscovery/naabu/v2/pkg/privileges
go/pkg/mod/github.com/projectdiscovery/naabu/v2@v2.2.1/pkg/privileges/privileges.go:6:17: undefined: isPrivileged

Expected Behavior:

A successful build without that error.

Steps To Reproduce:

On OpenBSD 7.4, install Go and then run go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@v2.2.1.

Anything else:

$ go version
go version go1.21.1 openbsd/amd64

Also, the code required to patch this probably looks similar to #856. I threw this together and it works on OpenBSD, so os.Geteuid is supported:

package main

import (
    "fmt"
    "os"
)

func main()  {
    fmt.Println(os.Geteuid())
}

Maybe it makes sense to generalize the fix for this somehow so that other systems (NetBSD, Dragonfly BSD) have a chance of working as well? Not sure how to do this offhand, I've only written really minor things in Go.

Metadata

Metadata

Assignees

Labels

Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions