Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
79f9ee9d
Commit
79f9ee9d
authored
Aug 13, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix core dumps, inability to count, etc associated with canonicalize_path
patches.
parent
d785841f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/dfmgr.c
+3
-2
src/bin/psql/command.c
src/bin/psql/command.c
+3
-2
src/bin/psql/copy.c
src/bin/psql/copy.c
+3
-2
src/port/path.c
src/port/path.c
+4
-4
No files found.
src/backend/utils/fmgr/dfmgr.c
View file @
79f9ee9d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.7
5 2004/07/12 02:22:49 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.7
6 2004/08/13 14:47:23 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -405,10 +405,11 @@ find_in_dynamic_libpath(const char *basename)
...
@@ -405,10 +405,11 @@ find_in_dynamic_libpath(const char *basename)
strncpy
(
piece
,
p
,
len
);
strncpy
(
piece
,
p
,
len
);
piece
[
len
]
=
'\0'
;
piece
[
len
]
=
'\0'
;
canonicalize_path
(
piece
);
mangled
=
substitute_libpath_macro
(
piece
);
mangled
=
substitute_libpath_macro
(
piece
);
pfree
(
piece
);
pfree
(
piece
);
canonicalize_path
(
mangled
);
/* only absolute paths */
/* only absolute paths */
if
(
!
is_absolute_path
(
mangled
))
if
(
!
is_absolute_path
(
mangled
))
ereport
(
ERROR
,
ereport
(
ERROR
,
...
...
src/bin/psql/command.c
View file @
79f9ee9d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.12
2 2004/07/15 03:56:06 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.12
3 2004/08/13 14:47:23 tgl
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "command.h"
#include "command.h"
...
@@ -375,6 +375,7 @@ exec_command(const char *cmd,
...
@@ -375,6 +375,7 @@ exec_command(const char *cmd,
fname
=
psql_scan_slash_option
(
scan_state
,
fname
=
psql_scan_slash_option
(
scan_state
,
OT_NORMAL
,
NULL
,
true
);
OT_NORMAL
,
NULL
,
true
);
expand_tilde
(
&
fname
);
expand_tilde
(
&
fname
);
if
(
fname
)
canonicalize_path
(
fname
);
canonicalize_path
(
fname
);
status
=
do_edit
(
fname
,
query_buf
)
?
CMD_NEWEDIT
:
CMD_ERROR
;
status
=
do_edit
(
fname
,
query_buf
)
?
CMD_NEWEDIT
:
CMD_ERROR
;
free
(
fname
);
free
(
fname
);
...
...
src/bin/psql/copy.c
View file @
79f9ee9d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.5
0 2004/07/11 21:34:03 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.5
1 2004/08/13 14:47:23 tgl
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "copy.h"
#include "copy.h"
...
@@ -513,6 +513,7 @@ do_copy(const char *args)
...
@@ -513,6 +513,7 @@ do_copy(const char *args)
appendPQExpBuffer
(
&
query
,
" FORCE NOT NULL %s"
,
options
->
force_notnull_list
);
appendPQExpBuffer
(
&
query
,
" FORCE NOT NULL %s"
,
options
->
force_notnull_list
);
}
}
if
(
options
->
file
)
canonicalize_path
(
options
->
file
);
canonicalize_path
(
options
->
file
);
if
(
options
->
from
)
if
(
options
->
from
)
...
...
src/port/path.c
View file @
79f9ee9d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.
29 2004/08/12 19:03:44 momjian
Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.
30 2004/08/13 14:47:23 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -335,7 +335,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
...
@@ -335,7 +335,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
{
{
char
path
[
MAXPGPATH
];
char
path
[
MAXPGPATH
];
char
my_exec_path
[
MAXPGPATH
];
char
my_exec_path
[
MAXPGPATH
];
char
env_path
[
MAXPGPATH
+
sizeof
(
"PG
LOCALEDIR="
)];
/* longer than PGSYSCONF
DIR */
char
env_path
[
MAXPGPATH
+
sizeof
(
"PG
SYSCONFDIR="
)];
/* longer than PGLOCALE
DIR */
/* don't set LC_ALL in the backend */
/* don't set LC_ALL in the backend */
if
(
strcmp
(
app
,
"postgres"
)
!=
0
)
if
(
strcmp
(
app
,
"postgres"
)
!=
0
)
...
@@ -353,7 +353,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
...
@@ -353,7 +353,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
{
{
/* set for libpq to use */
/* set for libpq to use */
snprintf
(
env_path
,
sizeof
(
env_path
),
"PGLOCALEDIR=%s"
,
path
);
snprintf
(
env_path
,
sizeof
(
env_path
),
"PGLOCALEDIR=%s"
,
path
);
canonicalize_path
(
env_path
);
canonicalize_path
(
env_path
+
12
);
putenv
(
strdup
(
env_path
));
putenv
(
strdup
(
env_path
));
}
}
#endif
#endif
...
@@ -364,7 +364,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
...
@@ -364,7 +364,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
/* set for libpq to use */
/* set for libpq to use */
snprintf
(
env_path
,
sizeof
(
env_path
),
"PGSYSCONFDIR=%s"
,
path
);
snprintf
(
env_path
,
sizeof
(
env_path
),
"PGSYSCONFDIR=%s"
,
path
);
canonicalize_path
(
env_path
);
canonicalize_path
(
env_path
+
13
);
putenv
(
strdup
(
env_path
));
putenv
(
strdup
(
env_path
));
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment