File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 9
9
#
10
10
#
11
11
# IDENTIFICATION
12
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.24 2002/04/12 09:37:10 momjian Exp $
12
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.25 2002/04/12 09:42:31 momjian Exp $
13
13
#
14
14
# Note - this should NOT be setuid.
15
15
#
@@ -27,6 +27,10 @@ Password=
27
27
PSQLOPT=
28
28
Encrypted= # blank uses default
29
29
30
+ # These handle spaces/tabs in identifiers
31
+ _IFS=" $IFS "
32
+ NL="
33
+ "
30
34
# Check for echo -n vs echo \c
31
35
32
36
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
178
182
179
183
if [ -z " $NewUser " ]; then
180
184
$ECHO_N " Enter name of user to add: " $ECHO_C
181
- read NewUser
185
+ IFS=" $NL "
186
+ read NewUser
187
+ IFS=" $_IFS "
182
188
[ " $? " -ne 0 ] && exit 1
183
189
fi
184
190
185
191
if [ " $PwPrompt " ]; then
186
192
$ECHO_N " Enter password for user \" $NewUser \" : " $ECHO_C
187
193
stty -echo > /dev/null 2>&1
194
+ IFS=" $NL "
188
195
read FirstPw
196
+ IFS=" $_IFS "
189
197
stty echo > /dev/null 2>&1
190
198
echo
191
199
$ECHO_N " Enter it again: " $ECHO_C
192
200
stty -echo > /dev/null 2>&1
201
+ IFS=" $NL "
193
202
read SecondPw
203
+ IFS=" $_IFS "
194
204
stty echo > /dev/null 2>&1
195
205
echo
196
206
if [ " $FirstPw " != " $SecondPw " ]; then
Original file line number Diff line number Diff line change 9
9
#
10
10
#
11
11
# IDENTIFICATION
12
- # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.16 2002/04/12 09:37:11 momjian Exp $
12
+ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.17 2002/04/12 09:42:32 momjian Exp $
13
13
#
14
14
# Note - this should NOT be setuid.
15
15
#
@@ -22,6 +22,10 @@ PSQLOPT=
22
22
forcedel=t
23
23
DelUser=
24
24
25
+ # These handle spaces/tabs in identifiers
26
+ _IFS=" $IFS "
27
+ NL="
28
+ "
25
29
# Check for echo -n vs echo \c
26
30
27
31
if echo ' \c' | grep -s c > /dev/null 2>&1
125
129
126
130
if [ -z " $DelUser " ]; then
127
131
$ECHO_N " Enter name of user to delete: " $ECHO_C
128
- read DelUser
132
+ IFS=" $NL "
133
+ read DelUser
134
+ IFS=" $_IFS "
129
135
[ " $? " -ne 0 ] && exit 1
130
136
fi
131
137
You can’t perform that action at this time.
0 commit comments