net/netns, misc tests: remove TestOnlySkipPrivilegedOps, argv checks

The netns UID check is sufficient for now. We can do something else
later if/when needed.
This commit is contained in:
Brad Fitzpatrick
2020-05-31 14:35:30 -07:00
parent 7a410f9236
commit becce82246
6 changed files with 10 additions and 61 deletions

View File

@ -11,13 +11,7 @@
// operating system, and perhaps even by version of the OS.
package netns
import (
"net"
"tailscale.com/syncs"
)
var skipPrivileged syncs.AtomicBool
import "net"
// Listener returns a new net.Listener with its Control hook func
// initialized as necessary to run in logical network namespace that
@ -32,10 +26,3 @@ func Listener() *net.ListenConfig {
func Dialer() *net.Dialer {
return &net.Dialer{Control: control}
}
// TestOnlySkipPrivilegedOps disables any behavior in this package
// that requires root or other elevated privileges. It's used only in
// tests, and using it definitely breaks some Tailscale functionality.
func TestOnlySkipPrivilegedOps() {
skipPrivileged.Set(true)
}