#include
#include
#include
+#include
#include
+static void CheckPgUserAclNotNull(void);
+
/*---------------------------------------------------------------------
* UpdatePgPwdFile
*
inblock;
int max_id = -1;
+ if (stmt->password)
+ CheckPgUserAclNotNull();
if (!(inblock = IsTransactionBlock()))
BeginTransactionBlock();
n,
inblock;
+ if (stmt->password)
+ CheckPgUserAclNotNull();
if (!(inblock = IsTransactionBlock()))
BeginTransactionBlock();
if (IsTransactionBlock() && !inblock)
EndTransactionBlock();
}
+
+/*
+ * CheckPgUserAclNotNull
+ *
+ * check to see if there is an ACL on pg_user
+ */
+static void CheckPgUserAclNotNull()
+{
+HeapTuple htp;
+
+ htp = SearchSysCacheTuple(RELNAME, PointerGetDatum(UserRelationName),
+ 0, 0, 0);
+ if (!HeapTupleIsValid(htp))
+ {
+ elog(ERROR, "IsPgUserAclNull: class \"%s\" not found",
+ UserRelationName);
+ }
+
+ if (heap_attisnull(htp, Anum_pg_class_relacl))
+ {
+ elog(NOTICE, "To use passwords, you have to revoke permissions on pg_user");
+ elog(NOTICE, "so normal users can not read the passwords.");
+ elog(ERROR, "Try 'REVOKE ALL ON pg_user FROM PUBLIC'");
+ }
+
+ return;
+}
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.31 1997/12/30 02:26:43 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.32 1998/02/19 17:19:45 momjian Exp $
#
#-------------------------------------------------------------------------
echo "vacuum" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
grep -v "^DEBUG:"
-echo "Altering pg_user acl"
-echo "REVOKE ALL ON pg_user FROM public" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
-
echo "COPY pg_user TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
grep -v "'DEBUG:"
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_user.h,v 1.8 1997/12/12 16:26:36 momjian Exp $
+ * $Id: pg_user.h,v 1.9 1998/02/19 17:19:51 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
#define Anum_pg_user_usetrace 4
#define Anum_pg_user_usesuper 5
#define Anum_pg_user_usecatupd 6
-#define Anum_pg_user_passwd 7
+#define Anum_pg_user_passwd 7
#define Anum_pg_user_valuntil 8
/* ----------------
@echo Nothing to be done.
install::
- install ecpglib.h $(DESTDIR)$(HEADERDIR)
- install ecpgtype.h $(DESTDIR)$(HEADERDIR)
- install sqlca.h $(DESTDIR)$(HEADERDIR)
+ install $(INSTLOPTS) ecpglib.h $(DESTDIR)$(HEADERDIR)
+ install $(INSTLOPTS) ecpgtype.h $(DESTDIR)$(HEADERDIR)
+ install $(INSTLOPTS) sqlca.h $(DESTDIR)$(HEADERDIR)
uninstall::
rm -f $(DESTDIR)$(HEADERDIR)/ecpglib.h