*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.207 2001/02/11 23:12:28 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.208 2001/02/20 01:34:40 tgl Exp $
*
* NOTES
*
if (port->database[0] == '\0')
StrNCpy(port->database, si->user, sizeof(port->database));
+ /* Truncate given database and user names to length of a Postgres name. */
+ /* This avoids lookup failures when overlength names are given. */
+
+ if ((int) sizeof(port->database) >= NAMEDATALEN)
+ port->database[NAMEDATALEN-1] = '\0';
+ if ((int) sizeof(port->user) >= NAMEDATALEN)
+ port->user[NAMEDATALEN-1] = '\0';
+
/* Check a user name was given. */
if (port->user[0] == '\0')