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
3912b757
Commit
3912b757
authored
Jun 08, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed exec path problem.
parent
b206958d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
17 deletions
+27
-17
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+13
-3
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+3
-3
src/backend/utils/init/findbe.c
src/backend/utils/init/findbe.c
+9
-9
src/include/miscadmin.h
src/include/miscadmin.h
+2
-2
No files found.
src/backend/postmaster/postmaster.c
View file @
3912b757
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.8
3 1998/06/08 19:36:40
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.8
4 1998/06/08 22:28:26
momjian Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -315,9 +315,19 @@ PostmasterMain(int argc, char *argv[])
...
@@ -315,9 +315,19 @@ PostmasterMain(int argc, char *argv[])
for
(;
i
<
4
;
i
++
)
for
(;
i
<
4
;
i
++
)
new_argv
[
i
]
=
""
;
new_argv
[
i
]
=
""
;
new_argv
[
4
]
=
NULL
;
new_argv
[
4
]
=
NULL
;
if
(
!
Execfile
[
0
]
&&
FindExec
(
Execfile
,
argv
[
0
])
<
0
)
{
fprintf
(
stderr
,
"%s: could not find postmaster to execute...
\n
"
,
argv
[
0
]);
exit
(
1
);
}
new_argv
[
0
]
=
Execfile
;
execv
(
new_argv
[
0
],
new_argv
);
execv
(
new_argv
[
0
],
new_argv
);
perror
(
new_argv
[
0
]);
/* How did we get here, error! */
/* How did we get here, error! */
perror
(
new_argv
[
0
]);
fprintf
(
stderr
,
"PostmasterMain execv failed on %s
\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
"PostmasterMain execv failed on %s
\n
"
,
argv
[
0
]);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -461,7 +471,7 @@ PostmasterMain(int argc, char *argv[])
...
@@ -461,7 +471,7 @@ PostmasterMain(int argc, char *argv[])
exit
(
2
);
exit
(
2
);
}
}
if
(
!
Execfile
[
0
]
&&
Find
Backend
(
Execfile
,
argv
[
0
])
<
0
)
if
(
!
Execfile
[
0
]
&&
Find
Exec
(
Execfile
,
argv
[
0
])
<
0
)
{
{
fprintf
(
stderr
,
"%s: could not find backend to execute...
\n
"
,
fprintf
(
stderr
,
"%s: could not find backend to execute...
\n
"
,
argv
[
0
]);
argv
[
0
]);
...
...
src/backend/tcop/postgres.c
View file @
3912b757
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
3 1998/06/04 17:26:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.7
4 1998/06/08 22:28:27
momjian Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -1167,7 +1167,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
...
@@ -1167,7 +1167,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
SetCharSet
();
SetCharSet
();
#endif
#endif
if
(
Find
Backend
(
pg_pathname
,
argv
[
0
])
<
0
)
if
(
Find
Exec
(
pg_pathname
,
argv
[
0
])
<
0
)
elog
(
FATAL
,
"%s: could not locate executable, bailing out..."
,
elog
(
FATAL
,
"%s: could not locate executable, bailing out..."
,
argv
[
0
]);
argv
[
0
]);
...
@@ -1314,7 +1314,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
...
@@ -1314,7 +1314,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if
(
!
IsUnderPostmaster
)
if
(
!
IsUnderPostmaster
)
{
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.7
3 $ $Date: 1998/06/04 17:26:45
$"
);
puts
(
"$Revision: 1.7
4 $ $Date: 1998/06/08 22:28:27
$"
);
}
}
/* ----------------
/* ----------------
...
...
src/backend/utils/init/findbe.c
View file @
3912b757
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.
7 1997/09/08 02:31:53
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.
8 1998/06/08 22:28:28
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -144,14 +144,14 @@ ValidateBackend(char *path)
...
@@ -144,14 +144,14 @@ ValidateBackend(char *path)
}
}
/*
/*
* Find
Backend
-- find an absolute path to a valid backend executable
* Find
Exec
-- find an absolute path to a valid backend executable
*
*
* The reason we have to work so hard to find an absolute path is that
* The reason we have to work so hard to find an absolute path is that
* we need to feed the backend server the location of its actual
* we need to feed the backend server the location of its actual
* executable file -- otherwise, we can't do dynamic loading.
* executable file -- otherwise, we can't do dynamic loading.
*/
*/
int
int
Find
Backend
(
char
*
backend
,
char
*
argv0
)
Find
Exec
(
char
*
backend
,
char
*
argv0
)
{
{
char
buf
[
MAXPGPATH
+
2
];
char
buf
[
MAXPGPATH
+
2
];
char
*
p
;
char
*
p
;
...
@@ -188,11 +188,11 @@ FindBackend(char *backend, char *argv0)
...
@@ -188,11 +188,11 @@ FindBackend(char *backend, char *argv0)
{
{
strncpy
(
backend
,
buf
,
MAXPGPATH
);
strncpy
(
backend
,
buf
,
MAXPGPATH
);
if
(
DebugLvl
)
if
(
DebugLvl
)
fprintf
(
stderr
,
"Find
Backend
: found
\"
%s
\"
using argv[0]
\n
"
,
fprintf
(
stderr
,
"Find
Exec
: found
\"
%s
\"
using argv[0]
\n
"
,
backend
);
backend
);
return
(
0
);
return
(
0
);
}
}
fprintf
(
stderr
,
"Find
Backend
: invalid backend
\"
%s
\"\n
"
,
fprintf
(
stderr
,
"Find
Exec
: invalid backend
\"
%s
\"\n
"
,
buf
);
buf
);
return
(
-
1
);
return
(
-
1
);
}
}
...
@@ -204,7 +204,7 @@ FindBackend(char *backend, char *argv0)
...
@@ -204,7 +204,7 @@ FindBackend(char *backend, char *argv0)
if
((
p
=
getenv
(
"PATH"
))
&&
*
p
)
if
((
p
=
getenv
(
"PATH"
))
&&
*
p
)
{
{
if
(
DebugLvl
)
if
(
DebugLvl
)
fprintf
(
stderr
,
"Find
Backend
: searching PATH ...
\n
"
);
fprintf
(
stderr
,
"Find
Exec
: searching PATH ...
\n
"
);
pathlen
=
strlen
(
p
);
pathlen
=
strlen
(
p
);
path
=
malloc
(
pathlen
+
1
);
path
=
malloc
(
pathlen
+
1
);
strcpy
(
path
,
p
);
strcpy
(
path
,
p
);
...
@@ -225,14 +225,14 @@ FindBackend(char *backend, char *argv0)
...
@@ -225,14 +225,14 @@ FindBackend(char *backend, char *argv0)
case
0
:
/* found ok */
case
0
:
/* found ok */
strncpy
(
backend
,
buf
,
MAXPGPATH
);
strncpy
(
backend
,
buf
,
MAXPGPATH
);
if
(
DebugLvl
)
if
(
DebugLvl
)
fprintf
(
stderr
,
"Find
Backend
: found
\"
%s
\"
using PATH
\n
"
,
fprintf
(
stderr
,
"Find
Exec
: found
\"
%s
\"
using PATH
\n
"
,
backend
);
backend
);
free
(
path
);
free
(
path
);
return
(
0
);
return
(
0
);
case
-
1
:
/* wasn't even a candidate, keep looking */
case
-
1
:
/* wasn't even a candidate, keep looking */
break
;
break
;
case
-
2
:
/* found but disqualified */
case
-
2
:
/* found but disqualified */
fprintf
(
stderr
,
"Find
Backend
: could not read backend
\"
%s
\"\n
"
,
fprintf
(
stderr
,
"Find
Exec
: could not read backend
\"
%s
\"\n
"
,
buf
);
buf
);
free
(
path
);
free
(
path
);
return
(
-
1
);
return
(
-
1
);
...
@@ -243,6 +243,6 @@ FindBackend(char *backend, char *argv0)
...
@@ -243,6 +243,6 @@ FindBackend(char *backend, char *argv0)
free
(
path
);
free
(
path
);
}
}
fprintf
(
stderr
,
"Find
Backend
: could not find a backend to execute...
\n
"
);
fprintf
(
stderr
,
"Find
Exec
: could not find a backend to execute...
\n
"
);
return
(
-
1
);
return
(
-
1
);
}
}
src/include/miscadmin.h
View file @
3912b757
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: miscadmin.h,v 1.2
4 1998/05/29 17:00:22
momjian Exp $
* $Id: miscadmin.h,v 1.2
5 1998/06/08 22:28:30
momjian Exp $
*
*
* NOTES
* NOTES
* some of the information in this file will be moved to
* some of the information in this file will be moved to
...
@@ -126,7 +126,7 @@ extern void SetPgUserName(void);
...
@@ -126,7 +126,7 @@ extern void SetPgUserName(void);
extern
Oid
GetUserId
(
void
);
extern
Oid
GetUserId
(
void
);
extern
void
SetUserId
(
void
);
extern
void
SetUserId
(
void
);
extern
int
ValidateBackend
(
char
*
path
);
extern
int
ValidateBackend
(
char
*
path
);
extern
int
Find
Backend
(
char
*
backend
,
char
*
argv0
);
extern
int
Find
Exec
(
char
*
backend
,
char
*
argv0
);
extern
int
CheckPathAccess
(
char
*
path
,
char
*
name
,
int
open_mode
);
extern
int
CheckPathAccess
(
char
*
path
,
char
*
name
,
int
open_mode
);
/* lower case version for case-insensitive SQL referenced in pg_proc.h */
/* lower case version for case-insensitive SQL referenced in pg_proc.h */
...
...
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