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

Commit6458022

Browse files
committed
Remove special-handling of usernames with Kerberos authentication. We will
now always use the system username as the default, and not try to pick it upfrom the kerberos ticket.This fixes the spurious error messages that show up on kerberos-enabled buildswhen not actually using kerberos, and puts it in line with how other authenticationmethods work.
1 parentafe8ac2 commit6458022

File tree

1 file changed

+2
-45
lines changed

1 file changed

+2
-45
lines changed

‎src/interfaces/libpq/fe-auth.c

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.139 2009/01/01 17:24:03 momjian Exp $
10+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.140 2009/01/13 10:43:21 mha Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -190,28 +190,6 @@ pg_krb5_destroy(struct krb5_info * info)
190190
}
191191

192192

193-
194-
/*
195-
* pg_krb5_authname -- returns a copy of whatever name the user
196-
* has authenticated to the system, or NULL
197-
*/
198-
staticchar*
199-
pg_krb5_authname(PQExpBuffererrorMessage)
200-
{
201-
char*tmp_name;
202-
structkrb5_infoinfo;
203-
204-
info.pg_krb5_initialised=0;
205-
206-
if (pg_krb5_init(errorMessage,&info)!=STATUS_OK)
207-
returnNULL;
208-
tmp_name=strdup(info.pg_krb5_name);
209-
pg_krb5_destroy(&info);
210-
211-
returntmp_name;
212-
}
213-
214-
215193
/*
216194
* pg_krb5_sendauth -- client routine to send authentication information to
217195
* the server
@@ -972,9 +950,6 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
972950
char*
973951
pg_fe_getauthname(PQExpBuffererrorMessage)
974952
{
975-
#ifdefKRB5
976-
char*krb5_name=NULL;
977-
#endif
978953
constchar*name=NULL;
979954
char*authn;
980955

@@ -988,8 +963,7 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
988963
#endif
989964

990965
/*
991-
* pglock_thread() really only needs to be called around
992-
* pg_krb5_authname(), but some users are using configure
966+
* Some users are using configure
993967
* --enable-thread-safety-force, so we might as well do the locking within
994968
* our library to protect pqGetpwuid(). In fact, application developers
995969
* can use getpwuid() in their application if they use the locking call we
@@ -998,17 +972,6 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
998972
*/
999973
pglock_thread();
1000974

1001-
#ifdefKRB5
1002-
1003-
/*
1004-
* pg_krb5_authname gives us a strdup'd value that we need to free later,
1005-
* however, we don't want to free 'name' directly in case it's *not* a
1006-
* Kerberos login and we fall through to name = pw->pw_name;
1007-
*/
1008-
krb5_name=pg_krb5_authname(errorMessage);
1009-
name=krb5_name;
1010-
#endif
1011-
1012975
if (!name)
1013976
{
1014977
#ifdefWIN32
@@ -1022,12 +985,6 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
1022985

1023986
authn=name ?strdup(name) :NULL;
1024987

1025-
#ifdefKRB5
1026-
/* Free the strdup'd string from pg_krb5_authname, if we got one */
1027-
if (krb5_name)
1028-
free(krb5_name);
1029-
#endif
1030-
1031988
pgunlock_thread();
1032989

1033990
returnauthn;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp