diff options
author | Michael Paquier <michael@paquier.xyz> | 2018-08-21 15:17:13 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2018-08-21 15:17:13 +0900 |
commit | 72be8c29a18812975fcc8765a122faf0e4d0c755 (patch) | |
tree | 52559dac01077e01cf8979aaef03e97e9043814d /src/backend/libpq/auth.c | |
parent | d8c83800c3ed2f0d677eb6620a9e9dc7b81a678b (diff) | |
download | postgresql-72be8c29a18812975fcc8765a122faf0e4d0c755.tar.gz postgresql-72be8c29a18812975fcc8765a122faf0e4d0c755.zip |
Fix set of NLS translation issues
While monitoring the code, a couple of issues related to string
translation has showed up:
- Some routines for auto-updatable views return an error string, which
sometimes missed the shot. A comment regarding string translation is
added for each routine to help with future features.
- GSSAPI authentication missed two translations.
- vacuumdb handles non-translated strings.
- GetConfigOptionByNum should translate strings. This part is not
back-patched as after a minor upgrade this could be surprising for
users.
Reported-by: Kyotaro Horiguchi
Author: Kyotaro Horiguchi
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/20180810.152131.31921918.horiguchi.kyotaro@lab.ntt.co.jp
Backpatch-through: 9.3
Diffstat (limited to 'src/backend/libpq/auth.c')
-rw-r--r-- | src/backend/libpq/auth.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index cecd104b4a5..68bb62d873c 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -1037,6 +1037,10 @@ static GSS_DLLIMP gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_desc; #endif +/* + * Generate an error for GSSAPI authentication. The caller should apply + * _() to errmsg to make it translatable. + */ static void pg_GSS_error(int severity, const char *errmsg, OM_uint32 maj_stat, OM_uint32 min_stat) { @@ -1227,7 +1231,7 @@ pg_GSS_recvauth(Port *port) { gss_delete_sec_context(&lmin_s, &port->gss->ctx, GSS_C_NO_BUFFER); pg_GSS_error(ERROR, - gettext_noop("accepting GSS security context failed"), + _("accepting GSS security context failed"), maj_stat, min_stat); } @@ -1253,7 +1257,7 @@ pg_GSS_recvauth(Port *port) maj_stat = gss_display_name(&min_stat, port->gss->name, &gbuf, NULL); if (maj_stat != GSS_S_COMPLETE) pg_GSS_error(ERROR, - gettext_noop("retrieving GSS user name failed"), + _("retrieving GSS user name failed"), maj_stat, min_stat); /* @@ -1317,6 +1321,11 @@ pg_GSS_recvauth(Port *port) *---------------------------------------------------------------- */ #ifdef ENABLE_SSPI + +/* + * Generate an error for SSPI authentication. The caller should apply + * _() to errmsg to make it translatable. + */ static void pg_SSPI_error(int severity, const char *errmsg, SECURITY_STATUS r) { |