7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* 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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -190,28 +190,6 @@ pg_krb5_destroy(struct krb5_info * info)
190
190
}
191
191
192
192
193
-
194
- /*
195
- * pg_krb5_authname -- returns a copy of whatever name the user
196
- * has authenticated to the system, or NULL
197
- */
198
- static char *
199
- pg_krb5_authname (PQExpBuffer errorMessage )
200
- {
201
- char * tmp_name ;
202
- struct krb5_info info ;
203
-
204
- info .pg_krb5_initialised = 0 ;
205
-
206
- if (pg_krb5_init (errorMessage , & info ) != STATUS_OK )
207
- return NULL ;
208
- tmp_name = strdup (info .pg_krb5_name );
209
- pg_krb5_destroy (& info );
210
-
211
- return tmp_name ;
212
- }
213
-
214
-
215
193
/*
216
194
* pg_krb5_sendauth -- client routine to send authentication information to
217
195
* the server
@@ -972,9 +950,6 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
972
950
char *
973
951
pg_fe_getauthname (PQExpBuffer errorMessage )
974
952
{
975
- #ifdef KRB5
976
- char * krb5_name = NULL ;
977
- #endif
978
953
const char * name = NULL ;
979
954
char * authn ;
980
955
@@ -988,8 +963,7 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
988
963
#endif
989
964
990
965
/*
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
993
967
* --enable-thread-safety-force, so we might as well do the locking within
994
968
* our library to protect pqGetpwuid(). In fact, application developers
995
969
* can use getpwuid() in their application if they use the locking call we
@@ -998,17 +972,6 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
998
972
*/
999
973
pglock_thread ();
1000
974
1001
- #ifdef KRB5
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
-
1012
975
if (!name )
1013
976
{
1014
977
#ifdef WIN32
@@ -1022,12 +985,6 @@ pg_fe_getauthname(PQExpBuffer errorMessage)
1022
985
1023
986
authn = name ? strdup (name ) : NULL ;
1024
987
1025
- #ifdef KRB5
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
-
1031
988
pgunlock_thread ();
1032
989
1033
990
return authn ;
0 commit comments