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
0847fea6
Commit
0847fea6
authored
Apr 12, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow prompting of create/drop user to handle spaces.
parent
5804a7ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
src/bin/scripts/createuser
src/bin/scripts/createuser
+12
-2
src/bin/scripts/dropuser
src/bin/scripts/dropuser
+8
-2
No files found.
src/bin/scripts/createuser
View file @
0847fea6
...
...
@@ -9,7 +9,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.2
4 2002/04/12 09:37:10
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.2
5 2002/04/12 09:42:31
momjian Exp $
#
# Note - this should NOT be setuid.
#
...
...
@@ -27,6 +27,10 @@ Password=
PSQLOPT
=
Encrypted
=
# blank uses default
# These handle spaces/tabs in identifiers
_IFS
=
"
$IFS
"
NL
=
"
"
# Check for echo -n vs echo \c
if
echo
'\c'
|
grep
-s
c
>
/dev/null 2>&1
...
...
@@ -178,19 +182,25 @@ trap 'stty echo >/dev/null 2>&1' 1 2 3 15
if
[
-z
"
$NewUser
"
]
;
then
$ECHO_N
"Enter name of user to add: "
$ECHO_C
read
NewUser
IFS
=
"
$NL
"
read
NewUser
IFS
=
"
$_IFS
"
[
"
$?
"
-ne
0
]
&&
exit
1
fi
if
[
"
$PwPrompt
"
]
;
then
$ECHO_N
"Enter password for user
\"
$NewUser
\"
: "
$ECHO_C
stty
-echo
>
/dev/null 2>&1
IFS
=
"
$NL
"
read
FirstPw
IFS
=
"
$_IFS
"
stty echo
>
/dev/null 2>&1
echo
$ECHO_N
"Enter it again: "
$ECHO_C
stty
-echo
>
/dev/null 2>&1
IFS
=
"
$NL
"
read
SecondPw
IFS
=
"
$_IFS
"
stty echo
>
/dev/null 2>&1
echo
if
[
"
$FirstPw
"
!=
"
$SecondPw
"
]
;
then
...
...
src/bin/scripts/dropuser
View file @
0847fea6
...
...
@@ -9,7 +9,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.1
6 2002/04/12 09:37:11
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.1
7 2002/04/12 09:42:32
momjian Exp $
#
# Note - this should NOT be setuid.
#
...
...
@@ -22,6 +22,10 @@ PSQLOPT=
forcedel
=
t
DelUser
=
# These handle spaces/tabs in identifiers
_IFS
=
"
$IFS
"
NL
=
"
"
# Check for echo -n vs echo \c
if
echo
'\c'
|
grep
-s
c
>
/dev/null 2>&1
...
...
@@ -125,7 +129,9 @@ fi
if
[
-z
"
$DelUser
"
]
;
then
$ECHO_N
"Enter name of user to delete: "
$ECHO_C
read
DelUser
IFS
=
"
$NL
"
read
DelUser
IFS
=
"
$_IFS
"
[
"
$?
"
-ne
0
]
&&
exit
1
fi
...
...
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