AllowRelativePaths
This property determines whether relative directory paths can be used in any ODP.NET configuration.
Declaration
// C#
public static bool AllowRelativePaths { get; set; }
Property Type
System.Boolean
Exceptions
OracleException: ORA-50099 if set after the first connection is opened.
OracleException: ORA-50138: "Relative file paths cannot be used for <option>" to be thrown if ODP.NET tries to access a file based on a relative path while this property is set to false.
Remarks
Default is true. When false, this property disables ODP.NET from retrieving or writing to configuration files using relative directory paths. Fully qualified paths can then only be used.
When true, relative and fully qualified paths can be used.
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.
Relative paths can be used by bad actors in several types of attacks: path traversal, arbitrary file read/write, configuration spoofing, and so on. By disabling relative paths with this property, users can mitigate the effectiveness of these types of attacks.