AllowUncPaths

This property allows or disallows ODP.NET access to configuration files with Universal Naming Convention location and network paths.

Declaration

// C#
public static bool AllowUncPaths { get; set; }

Property Type

System.Boolean

Exceptions

OracleException: ORA-50099 if set after the first connection is opened.

OracleException: ORA-50121: “UNC file paths cannot be used for <option>” to be thrown during certain actions if relative paths are used while this property is set to false.

Remarks

For ODP.NET to access configuration files, such as sqlnet.ora, on local network machines and network drives, users can specify Universal Naming Convention (UNC) paths.

The AllowUncPaths property enables or disables ODP.NET's ability to use these UNC paths.

The property default is true. When true, ODP.NET is allowed to access files specified with UNC path locations.

When false, ODP.NET throws an ORA-50121 error when it tries to access any file that uses an UNC path, whether the path is an explicit UNC path, or if the path indirectly uses a UNC path via a network drive.

This property affects any ODP.NET setting stored in a file, such as the wallet, token, trace file, TNS_ADMIN, and ORACLE_HOME location. It also affects trace file locations. The path is checked when ODP.NET attempts to access a file.

Server Message Block coercion attacks use UNC paths to have a target machine authenticate an attacker's computer. If successful, then the attacker copies that authentication to gain access to another system. Disabling UNC paths prevents this attack from being used.

An UNC path consists of a double backslash, followed by a server name, host name, or IP address. Next is another backslash, followed by the share name. After that is a directory separator character with the directory name. This continues for additional subdirectories. An optional file name can be included at the end. Here's an example: \\MyHostName\MyShare\MyDirectory\MyFile.txt