Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for getSystemNSS (0.13 sec)

  1. src/net/conf_test.go

    			hostTests: []nssHostTest{
    				{"x.com", "myhostname", hostLookupDNSFiles},
    			},
    		},
    	}
    
    	origGetHostname := getHostname
    	defer func() { getHostname = origGetHostname }()
    	defer setSystemNSS(getSystemNSS(), 0)
    	conf, err := newResolvConfTest()
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer conf.teardown()
    
    	for _, tt := range tests {
    		if !conf.forceUpdateConf(tt.resolv, time.Now().Add(time.Hour)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:46:36 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  2. src/net/nss.go

    	ch          chan struct{} // guards lastChecked and modTime
    	lastChecked time.Time     // last time nsswitch.conf was checked
    
    	mu      sync.Mutex // protects nssConf
    	nssConf *nssConf
    }
    
    func getSystemNSS() *nssConf {
    	nssConfig.tryUpdate()
    	nssConfig.mu.Lock()
    	conf := nssConfig.nssConf
    	nssConfig.mu.Unlock()
    	return conf
    }
    
    // init initializes conf and is only called via conf.initOnce.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 15 20:15:51 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  3. src/net/conf.go

    		// We always return before this point.
    		// The code below is for non-OpenBSD.
    	}
    
    	// Canonicalize the hostname by removing any trailing dot.
    	hostname = stringslite.TrimSuffix(hostname, ".")
    
    	nss := getSystemNSS()
    	srcs := nss.sources["hosts"]
    	// If /etc/nsswitch.conf doesn't exist or doesn't specify any
    	// sources for "hosts", assume Go's DNS will work fine.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 03:13:26 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  4. src/net/dnsclient_unix_test.go

    		t.Fatal(err)
    	}
    }
    
    func TestLookupOrderFilesNoSuchHost(t *testing.T) {
    	defer func(orig string) { hostsFilePath = orig }(hostsFilePath)
    	if runtime.GOOS != "openbsd" {
    		defer setSystemNSS(getSystemNSS(), 0)
    		setSystemNSS(nssStr(t, "hosts: files"), time.Hour)
    	}
    
    	conf, err := newResolvConfTest()
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer conf.teardown()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 72.4K bytes
    - Viewed (0)
Back to top