Skip to content

Commit 74a263e

Browse files
committed
Fix to give super user and createdb user proper update catalog rights.
1 parent 30659d4 commit 74a263e

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

doc/FAQ_Solaris

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Frequently Asked Questions (FAQ) for PostgreSQL V6.5
33
Sun Solaris Specific
44
TO BE READ IN CONJUNCTION WITH THE NORMAL FAQ
55
=======================================================
6-
last updated: Thu Sep 2 11:40:00 CET 1999
6+
last updated: Thu Sep 21 9:30:00 CET 1999
77

88
current maintainer: Marc Liyanage (liyanage@access.ch)
99
original author: Marc Liyanage (liyanage@access.ch)
@@ -19,6 +19,10 @@ Contents:
1919
1.4) Why am I getting "Can't tell what username to use" errors
2020
when I try to run initdb?
2121

22+
A) Contributors
23+
24+
25+
2226
Notes:
2327

2428
- The commands given here are for the bash shell. If you use
@@ -125,7 +129,7 @@ maximum segment size kernel parameter is set too low. The solution
125129
is to put something like the following line into /etc/system and
126130
reboot the system.
127131

128-
set shmsys:shminfo_shmmax=0xffffffff
132+
set shmsys:shminfo_shmmax=0x7fffffff
129133

130134
Excellent info regarding shared memory under Solaris can be found here:
131135
http://www.sunworld.com/swol-09-1997/swol-09-insidesolaris.html
@@ -140,3 +144,22 @@ Put something like this into the .bash_profile startup script
140144
of the postgres user (see also step 17 in the INSTALL file):
141145

142146
export USER=postgres
147+
148+
149+
150+
151+
152+
153+
154+
155+
156+
----------------------------------------------------------------------
157+
Section A: Contributors
158+
----------------------------------------------------------------------
159+
160+
- Jose Luis Rodriguez Garcia
161+
Suggested to change the shmmax parameter in 1.3 from 0xffffffff to 0x7fffffff
162+
because the value is a signed integer in Solaris versions prior to 2.6.
163+
164+
165+

src/backend/commands/user.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: user.c,v 1.34 1999/09/18 19:06:41 tgl Exp $
8+
* $Id: user.c,v 1.35 1999/09/27 16:44:50 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -172,12 +172,14 @@ DefineUser(CreateUserStmt *stmt, CommandDest dest)
172172
snprintf(sql, SQL_LENGTH,
173173
"insert into %s (usename,usesysid,usecreatedb,usetrace,"
174174
"usesuper,usecatupd,passwd,valuntil) "
175-
"values('%s',%d,'%c','f','%c','f',%s%s%s,%s%s%s)",
175+
"values('%s',%d,'%c','f','%c','%c',%s%s%s,%s%s%s)",
176176
ShadowRelationName,
177177
stmt->user,
178178
max_id + 1,
179179
(stmt->createdb && *stmt->createdb) ? 't' : 'f',
180180
(stmt->createuser && *stmt->createuser) ? 't' : 'f',
181+
((stmt->createdb && *stmt->createdb) ||
182+
(stmt->createuser && *stmt->createuser)) ? 't' : 'f',
181183
havepassword ? "'" : "",
182184
havepassword ? stmt->password : "NULL",
183185
havepassword ? "'" : "",

src/bin/createuser/createuser.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.12 1999/07/30 18:09:49 momjian Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.13 1999/09/27 16:44:56 momjian Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -215,10 +215,15 @@ then
215215
fi
216216
fi
217217

218+
if [ "$CANCREATE" = "t" -o "$CANADDUSER" = "t" ]
219+
then CANCATUPD="t"
220+
else CANCATUPD="f"
221+
fi
222+
218223
QUERY="insert into pg_shadow \
219224
(usename, usesysid, usecreatedb, usetrace, usesuper, usecatupd) \
220225
values \
221-
('$NEWUSER', $SYSID, '$CANCREATE', 'f', '$CANADDUSER','f')"
226+
('$NEWUSER', $SYSID, '$CANCREATE', 'f', '$CANADDUSER','$CANCATUPD')"
222227

223228
RES=`$PSQL -c "$QUERY" template1`
224229

0 commit comments

Comments
 (0)