Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit562bee0

Browse files
Don't truncate database and user names in startup packets.
Unlike commands such as CREATE DATABASE, ProcessStartupPacket()does not perform multibyte-aware truncation of overlength names.This means that connection attempts might fail even if the userprovides the same overlength names that were used in CREATEDATABASE, CREATE ROLE, etc. Ideally, we'd do the same multibyte-aware truncation in both code paths, but it doesn't seem worth theadded complexity of trying to discover the encoding of the names.Instead, let's simply skip truncating the names in the startuppacket and let the user/database lookup fail later on. With thischange, users must provide the exact names stored in the catalogs,even if the names were truncated.This reverts commitd18c1d1.Author: Bertrand DrouvotReviewed-by: Kyotaro Horiguchi, Tom LaneDiscussion:https://postgr.es/m/07436793-1426-29b2-f924-db7422a05fb7%40gmail.com
1 parent29cf61a commit562bee0

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,15 +2290,6 @@ ProcessStartupPacket(Port *port, bool ssl_done, bool gss_done)
22902290
}
22912291
}
22922292

2293-
/*
2294-
* Truncate given database and user names to length of a Postgres name.
2295-
* This avoids lookup failures when overlength names are given.
2296-
*/
2297-
if (strlen(port->database_name) >=NAMEDATALEN)
2298-
port->database_name[NAMEDATALEN-1]='\0';
2299-
if (strlen(port->user_name) >=NAMEDATALEN)
2300-
port->user_name[NAMEDATALEN-1]='\0';
2301-
23022293
if (am_walsender)
23032294
MyBackendType=B_WAL_SENDER;
23042295
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp