Skip to content

Commit

Permalink
only wait if control socket is enable
Browse files Browse the repository at this point in the history
otherwise n.admin is nil and field access goes kaboom....
  • Loading branch information
klemensn committed Nov 3, 2024
1 parent c45aa75 commit e465bd6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/yggdrasil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,12 @@ func main() {
// Change user if requested
if *chuserto != "" {
// Wait for other goroutines to finish potentially privileged tasks before dropping privileges.
for {
// control socket: UNIX requires filesystem permissions, TCP may use a low privileged port.
if n.admin.Created {
break
if n.admin != nil {
for {
// control socket: UNIX requires filesystem permissions, TCP may use a low privileged port.
if n.admin.Created {
break
}
}
}

Expand Down

0 comments on commit e465bd6

Please sign in to comment.