mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Add Win32 path handling for / vs. \ and drive letters.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.190 2003/03/27 16:51:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.191 2003/04/04 20:42:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -476,7 +476,7 @@ DoCopy(const CopyStmt *stmt)
|
||||
* Prevent write to relative path ... too easy to shoot
|
||||
* oneself in the foot by overwriting a database file ...
|
||||
*/
|
||||
if (filename[0] != '/')
|
||||
if (!is_absolute_path(filename))
|
||||
elog(ERROR, "Relative path not allowed for server side"
|
||||
" COPY command");
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.111 2003/04/04 20:40:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.112 2003/04/04 20:42:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -698,9 +698,9 @@ resolve_alt_dbpath(const char *dbpath, Oid dboid)
|
||||
if (dbpath == NULL || dbpath[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
if (strchr(dbpath, '/'))
|
||||
if (first_path_separator(dbpath))
|
||||
{
|
||||
if (dbpath[0] != '/')
|
||||
if (!is_absolute_path(dbpath))
|
||||
elog(ERROR, "Relative paths are not allowed as database locations");
|
||||
#ifndef ALLOW_ABSOLUTE_DBPATHS
|
||||
elog(ERROR, "Absolute paths are not allowed as database locations");
|
||||
@@ -714,7 +714,7 @@ resolve_alt_dbpath(const char *dbpath, Oid dboid)
|
||||
|
||||
if (!var)
|
||||
elog(ERROR, "Postmaster environment variable '%s' not set", dbpath);
|
||||
if (var[0] != '/')
|
||||
if (!is_absolute_path(var))
|
||||
elog(ERROR, "Postmaster environment variable '%s' must be absolute path", dbpath);
|
||||
prefix = var;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user