]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: avoid awkward wording from CL 236857
authorRuss Cox <rsc@golang.org>
Mon, 8 Jun 2020 16:39:56 +0000 (12:39 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 8 Jun 2020 21:36:04 +0000 (21:36 +0000)
CL 236857 removed all uses of whitelist/blacklist, which is great.
But it substituted awkward phrasing using allowlist/blocklist,
especially as verbs or participles. This CL uses more standard English,
like "allow the function" or "blocked functions" instead of
"allowlist the function" or "blocklisted functions".

Change-Id: I9106a2fdbd62751c4cbda3a77181358a8a6d0f13
Reviewed-on: https://go-review.googlesource.com/c/go/+/236917
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go1.10.html
src/cmd/compile/fmt_test.go
src/cmd/go/internal/work/gc.go
src/cmd/link/internal/loader/loader.go
src/cmd/oldlink/internal/objfile/objfile.go
src/html/template/html.go
src/net/http/request.go
src/net/http/server.go
src/runtime/cgo_sigaction.go
src/runtime/debugcall.go

index 95871e0e5c3ac9d5521628635ff6f993181af738..853f874ded4445056fa13052b5237ee49dc63568 100644 (file)
@@ -267,7 +267,7 @@ and the <a href="/cmd/test2json/">test2json documentation</a>.
 
 <p>
 Options specified by cgo using <code>#cgo CFLAGS</code> and the like
-are now checked against an allowlist of permitted options.
+are now checked against a list of permitted options.
 This closes a security hole in which a downloaded package uses
 compiler options like
 <span style="white-space: nowrap"><code>-fplugin</code></span>
index 768ca7fc893613a5640bf290c20c08c4834bee44..e372259c788e184cf0d9f6fa5b97c2ee5065f161 100644 (file)
@@ -96,7 +96,7 @@ func TestFormats(t *testing.T) {
                        }
 
                        importPath := filepath.Join("cmd/compile", path)
-                       if blocklistedPackages[filepath.ToSlash(importPath)] {
+                       if ignoredPackages[filepath.ToSlash(importPath)] {
                                return filepath.SkipDir
                        }
 
@@ -344,8 +344,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
        for index, file := range files {
                ast.Inspect(file, func(n ast.Node) bool {
                        if call, ok := n.(*ast.CallExpr); ok {
-                               // ignore blocklisted functions
-                               if blocklistedFunctions[nodeString(call.Fun)] {
+                               if ignoredFunctions[nodeString(call.Fun)] {
                                        return true
                                }
                                // look for an arguments that might be a format string
@@ -354,7 +353,7 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) {
                                                // make sure we have enough arguments
                                                n := numFormatArgs(s)
                                                if i+1+n > len(call.Args) {
-                                                       t.Errorf("%s: not enough format args (blocklist %s?)", posString(call), nodeString(call.Fun))
+                                                       t.Errorf("%s: not enough format args (ignore %s?)", posString(call), nodeString(call.Fun))
                                                        break // ignore this call
                                                }
                                                // assume last n arguments are to be formatted;
@@ -549,14 +548,14 @@ func formatReplace(in string, f func(i int, s string) string) string {
        return string(append(buf, in[i0:]...))
 }
 
-// blocklistedPackages is the set of packages which can
+// ignoredPackages is the set of packages which can
 // be ignored.
-var blocklistedPackages = map[string]bool{}
+var ignoredPackages = map[string]bool{}
 
-// blocklistedFunctions is the set of functions which may have
+// ignoredFunctions is the set of functions which may have
 // format-like arguments but which don't do any formatting and
 // thus may be ignored.
-var blocklistedFunctions = map[string]bool{}
+var ignoredFunctions = map[string]bool{}
 
 func init() {
        // verify that knownFormats entries are correctly formatted
index 9a4fdcda5f8355e8a1b5aa0ee163e7742a53d142..f1d08e02686c7ed08b9d40999a4e95f908620bba 100644 (file)
@@ -168,7 +168,7 @@ func gcBackendConcurrency(gcflags []string) int {
 CheckFlags:
        for _, flag := range gcflags {
                // Concurrent compilation is presumed incompatible with any gcflags,
-               // except for a small allowlist of commonly used flags.
+               // except for known commonly used flags.
                // If the user knows better, they can manually add their own -c to the gcflags.
                switch flag {
                case "-N", "-l", "-S", "-B", "-C", "-I":
index b871f664ea7d7485c3085f22c81c989b1b7fa131..32c342e5456b5b17ea13cfd2f0a481c02c3580e0 100644 (file)
@@ -634,15 +634,15 @@ func (l *Loader) checkdup(name string, r *oReader, li int, dup Sym) {
        }
        fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.unit.Lib, name, rdup.unit.Lib, reason)
 
-       // For the moment, allowlist DWARF subprogram DIEs for
+       // For the moment, allow DWARF subprogram DIEs for
        // auto-generated wrapper functions. What seems to happen
        // here is that we get different line numbers on formal
        // params; I am guessing that the pos is being inherited
        // from the spot where the wrapper is needed.
-       allowlist := strings.HasPrefix(name, "go.info.go.interface") ||
+       allowed := strings.HasPrefix(name, "go.info.go.interface") ||
                strings.HasPrefix(name, "go.info.go.builtin") ||
                strings.HasPrefix(name, "go.debuglines")
-       if !allowlist {
+       if !allowed {
                l.strictDupMsgs++
        }
 }
index ae28e9673a54ae1a4cbb0ee62893ed43b1136d5d..fbd7eb740b3f53711929d293d30afd92bc3c1ad5 100644 (file)
@@ -411,16 +411,16 @@ overwrite:
                        }
                        fmt.Fprintf(os.Stderr, "cmd/link: while reading object for '%v': duplicate symbol '%s', previous def at '%v', with mismatched payload: %s\n", r.lib, dup, dup.Unit.Lib, reason)
 
-                       // For the moment, allowlist DWARF subprogram DIEs for
+                       // For the moment, allow DWARF subprogram DIEs for
                        // auto-generated wrapper functions. What seems to happen
                        // here is that we get different line numbers on formal
                        // params; I am guessing that the pos is being inherited
                        // from the spot where the wrapper is needed.
-                       allowlist := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
+                       allowed := (strings.HasPrefix(dup.Name, "go.info.go.interface") ||
                                strings.HasPrefix(dup.Name, "go.info.go.builtin") ||
                                strings.HasPrefix(dup.Name, "go.isstmt.go.builtin") ||
                                strings.HasPrefix(dup.Name, "go.debuglines"))
-                       if !allowlist {
+                       if !allowed {
                                r.strictDupMsgs++
                        }
                }
index d3359cac0a4ae822663a45171013a68fe5c5c38a..356b8298ae36df752fa9f70f67ab97d0c220f6e0 100644 (file)
@@ -240,8 +240,7 @@ func htmlNameFilter(args ...interface{}) string {
        }
        s = strings.ToLower(s)
        if t := attrType(s); t != contentTypePlain {
-               // TODO: Split attr and element name part filters so we can allowlist
-               // attributes.
+               // TODO: Split attr and element name part filters so we can recognize known attributes.
                return filterFailsafe
        }
        for _, r := range s {
index e4a00dd5690666493ce4639af74a49858c85fae1..fe6b60982cd5668230fb9c40ee8e7e87adc4e7d5 100644 (file)
@@ -503,7 +503,7 @@ func valueOrDefault(value, def string) string {
 
 // NOTE: This is not intended to reflect the actual Go version being used.
 // It was changed at the time of Go 1.1 release because the former User-Agent
-// had ended up on a blocklist for some intrusion detection systems.
+// had ended up blocked by some intrusion detection systems.
 // See https://codereview.appspot.com/7532043.
 const defaultUserAgent = "Go-http-client/1.1"
 
index a75dd1461f5e2d9d4e8f821977426528dc3a920f..a995a50658568f923ebea3ff5395d242eee05fb3 100644 (file)
@@ -1698,9 +1698,9 @@ func (c *conn) closeWriteAndWait() {
        time.Sleep(rstAvoidanceDelay)
 }
 
-// validNextProto reports whether the proto is not a blocklisted ALPN
-// protocol name. Empty and built-in protocol types are blocklisted
-// and can't be overridden with alternate implementations.
+// validNextProto reports whether the proto is a valid ALPN protocol name.
+// Everything is valid except the empty string and built-in protocol types,
+// so that those can't be overridden with alternate implementations.
 func validNextProto(proto string) bool {
        switch proto {
        case "", "http/1.1", "http/1.0":
index 967b8b9a0d59b4212b431bea56f7f7eb5e54a312..de634dc9573e5bd96e7fd51e790df6a9cd1f9ee8 100644 (file)
@@ -18,12 +18,12 @@ var _cgo_sigaction unsafe.Pointer
 //go:nosplit
 //go:nowritebarrierrec
 func sigaction(sig uint32, new, old *sigactiont) {
-       // The runtime package is explicitly blocklisted from sanitizer
-       // instrumentation in racewalk.go, but we might be calling into instrumented C
-       // functions here — so we need the pointer parameters to be properly marked.
+       // racewalk.go avoids adding sanitizing instrumentation to package runtime,
+       // but we might be calling into instrumented C functions here,
+       // so we need the pointer parameters to be properly marked.
        //
-       // Mark the input as having been written before the call and the output as
-       // read after.
+       // Mark the input as having been written before the call
+       // and the output as read after.
        if msanenabled && new != nil {
                msanwrite(unsafe.Pointer(new), unsafe.Sizeof(*new))
        }
index 496e6ce8cca37bfbb903c66c8a80247c0b9a0379..6c285ec829a30545d35a75bad359e375abb76013 100644 (file)
@@ -61,7 +61,7 @@ func debugCallCheck(pc uintptr) string {
                        "debugCall16384",
                        "debugCall32768",
                        "debugCall65536":
-                       // These functions are allowlisted so that the debugger can initiate multiple function calls.
+                       // These functions are allowed so that the debugger can initiate multiple function calls.
                        // See: https://golang.org/cl/161137/
                        return
                }