Skip to content

Commit

Permalink
only wait if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
klemensn committed Nov 3, 2024
1 parent 6ebc7fa commit c45aa75
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/yggdrasil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,16 @@ func main() {
<-done
})

// 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
}
}

// 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
}
}

err = chuser(*chuserto)
if err != nil {
panic(err)
Expand Down

0 comments on commit c45aa75

Please sign in to comment.