Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
aea3283c
Commit
aea3283c
authored
23 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Don't use a temp file. It was created insecurely and was easy to do without.
parent
f1423cd9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/initdb/initdb.sh
+6
-15
6 additions, 15 deletions
src/bin/initdb/initdb.sh
with
6 additions
and
15 deletions
src/bin/initdb/initdb.sh
+
6
−
15
View file @
aea3283c
...
...
@@ -27,7 +27,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.12
8
2001/06/2
2 19:16:23 wieck
Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.12
9
2001/06/2
3 23:29:48 petere
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -45,8 +45,6 @@ exit_nicely(){
echo
"Removing
$PGDATA
."
1>&2
rm
-rf
"
$PGDATA
"
||
echo
"Failed."
1>&2
fi
echo
"Removing temp file
$TEMPFILE
."
1>&2
rm
-rf
"
$TEMPFILE
"
||
echo
"Failed."
1>&2
else
echo
"Data directory
$PGDATA
will not be removed at user's request."
1>&2
fi
...
...
@@ -65,12 +63,6 @@ datadir='@datadir@'
# as set by configure --enable-multibyte[=XXX].
MULTIBYTE
=
'@MULTIBYTE@'
if
[
"
$TMPDIR
"
]
;
then
TEMPFILE
=
"
$TMPDIR
/initdb.
$$
"
else
TEMPFILE
=
"/tmp/initdb.
$$
"
fi
# Check for echo -n vs echo \c
if
echo
'\c'
|
grep
-s
c
>
/dev/null 2>&1
...
...
@@ -353,7 +345,7 @@ if [ "$show_setting" = yes ] || [ "$debug" = yes ]
then
echo
echo
"Initdb variables:"
for
var
in
PGDATA datadir PGPATH
TEMPFILE
MULTIBYTE MULTIBYTEID
\
for
var
in
PGDATA datadir PGPATH MULTIBYTE MULTIBYTEID
\
POSTGRES_SUPERUSERNAME POSTGRES_SUPERUSERID POSTGRES_BKI
\
POSTGRES_DESCR POSTGRESQL_CONF_SAMPLE
\
PG_HBA_SAMPLE PG_IDENT_SAMPLE
;
do
...
...
@@ -807,12 +799,11 @@ echo "CREATE VIEW pg_stat_database AS \
|
"
$PGPATH
"
/postgres
$PGSQL_OPT
template1
>
/dev/null
||
exit_nicely
echo
"Loading pg_description."
echo
"COPY pg_description FROM STDIN"
>
$TEMPFILE
cat
"
$POSTGRES_DESCR
"
>>
$TEMPFILE
cat
$TEMPFILE
\
(
echo
"COPY pg_description FROM STDIN;"
;
cat
"
$POSTGRES_DESCR
"
)
\
|
"
$PGPATH
"
/postgres
$PGSQL_OPT
template1
>
/dev/null
||
exit_nicely
rm
-f
"
$TEMPFILE
"
||
exit_nicely
echo
"Setting lastsysoid."
echo
"UPDATE pg_database SET
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment