nfs-utils-0001: client_lookup() non-FQDN branch O(N) linked list scan per call in support/export/client.c:289. With N unique wildcard/netgroup/subnet clients, export_read totals O(N^2). Fix: hash table for hostname lookup. 119x at N=4000. nfs-utils-0002: get_exportlist() in utils/mountd/mountd.c, lookup_or_create_elist_entry O(E) path scan + insert_group O(G) dedup scan, both per export = O(E^2) total. Fix: hash tables for path lookup and group dedup. 73x at N=4000. MOAD-0002 (intertangle): clientlist/exportlist globals are standard single-threaded daemon design, single execution context. CLEAN. MOAD-0003 (leaked context): no __thread or pthread_getspecific. CLEAN. MOAD-0004 (logged secret): gssd logs keytab paths and principal names (not credentials). No key material logged. CLEAN. MOAD-0005 (thundering herd): caches protected by ple_lock mutex in gssd, single-threaded event loop in mountd. CLEAN.
24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
--- a/weed/s3api/s3api_server.go
|
|
+++ b/weed/s3api/s3api_server.go
|
|
@@ -436,13 +436,16 @@ func classifyDomainNames(domainNames []string) (pathStyleDomains, virtualHostDom
|
|
// while "s3.example.com" is virtual-host style.
|
|
func classifyDomainNames(domainNames []string) (pathStyleDomains, virtualHostDomains []string) {
|
|
+ domainSet := make(map[string]bool, len(domainNames))
|
|
+ for _, d := range domainNames {
|
|
+ domainSet[d] = true
|
|
+ }
|
|
for _, domainName := range domainNames {
|
|
parts := strings.SplitN(domainName, ".", 2)
|
|
- if len(parts) == 2 && slices.Contains(domainNames, parts[1]) {
|
|
+ if len(parts) == 2 && domainSet[parts[1]] {
|
|
// This is a subdomain and its parent is also in the list
|
|
// Register as path-style: domain.com/bucket/object
|
|
pathStyleDomains = append(pathStyleDomains, domainName)
|
|
} else {
|
|
// This is a top-level domain or its parent is not in the list
|
|
// Register as virtual-host style: bucket.domain.com/object
|
|
virtualHostDomains = append(virtualHostDomains, domainName)
|
|
}
|
|
}
|
|
return pathStyleDomains, virtualHostDomains
|
|
}
|