Skip to content

Commit 278ede3

Browse files
committed
fix(driver): avoid 'untrusted location' notice with per-server network driver
- When determining the server, fall back to drvPtr->defMapPtr whenever mapPtr is NULL (removed dependency on sockPtr->servPtr). - Treat missing route mapping identically for global and per-server driver installs. - Eliminates misleading Notice logs such as: * ... serving request to server 'xxxx' with untrusted location ... * ... consider loading driver nssock globally in section 'ns/modules' ... - Rationale: When no map entry exists, the default map (defMapPtr) must be used regardless of installation mode; the previous condition only applied the fallback for globally installed drivers, producing spurious warnings with per-server nssock. This change reduces noisy logging for per-server setups. There is no functional change for globally installed drivers.
1 parent 8262a54 commit 278ede3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nsd/driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5872,10 +5872,10 @@ SockSetServer(Sock *sockPtr)
58725872
reqPtr->request.line, (void*)sockPtr->servPtr);
58735873
}
58745874

5875-
if (mapPtr == NULL && sockPtr->servPtr == NULL) {
5875+
if (mapPtr == NULL) {
58765876
/*
5877-
* The driver is installed globally, fall back to the default server,
5878-
* which has to be defined in this case.
5877+
* If we have no mapPtr, fall back to the default server. This applies
5878+
* the same way for global and per-server drivers.
58795879
*/
58805880
mapPtr = drvPtr->defMapPtr;
58815881
Ns_Log(DriverDebug, "SockSetServer: get default map entry %p", (const void*)mapPtr);

0 commit comments

Comments
 (0)