kerberos related warning

Started by Joe Conwayover 19 years ago4 messages
#1Joe Conway
mail@joeconway.com
1 attachment(s)

I just noticed this warning:

gcc -O -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
-pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic
-DFRONTEND -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/et
-I../../../src/port -c -o fe-auth.o fe-auth.c -MMD
fe-auth.c: In function 'pg_fe_getauthname':
fe-auth.c:573: warning: passing argument 1 of 'free' discards qualifiers
from pointer target type

I think the attached is the appropriate fix. Any objections?

Joe

Attachments:

current.pgsql.difftext/x-patch; name=current.pgsql.diffDownload
Index: src/interfaces/libpq/fe-auth.c
===================================================================
RCS file: /opt/src/cvs/pgsql/src/interfaces/libpq/fe-auth.c,v
retrieving revision 1.115
diff -c -r1.115 fe-auth.c
*** src/interfaces/libpq/fe-auth.c	20 Jun 2006 19:56:52 -0000	1.115
--- src/interfaces/libpq/fe-auth.c	4 Jul 2006 17:27:15 -0000
***************
*** 188,197 ****
  
  
  /*
!  * pg_krb5_authname -- returns a pointer to static space containing whatever
!  *					   name the user has authenticated to the system
!   */
! static const char *
  pg_krb5_authname(char *PQerrormsg)
  {
  	char *tmp_name;
--- 188,197 ----
  
  
  /*
!  * pg_krb5_authname -- returns a copy of whatever name the user
!  *					   has authenticated to the system, or NULL
!  */
! static char *
  pg_krb5_authname(char *PQerrormsg)
  {
  	char *tmp_name;
***************
*** 520,526 ****
  pg_fe_getauthname(char *PQerrormsg)
  {
  #ifdef KRB5
! 	const char *krb5_name = NULL;
  #endif
  	const char *name = NULL;
  	char	   *authn;
--- 520,526 ----
  pg_fe_getauthname(char *PQerrormsg)
  {
  #ifdef KRB5
! 	char       *krb5_name = NULL;
  #endif
  	const char *name = NULL;
  	char	   *authn;
#2Joe Conway
mail@joeconway.com
In reply to: Joe Conway (#1)
1 attachment(s)
Re: [HACKERS] kerberos related warning

Joe Conway wrote:

I just noticed this warning:

gcc -O -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
-pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic
-DFRONTEND -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/et
-I../../../src/port -c -o fe-auth.o fe-auth.c -MMD
fe-auth.c: In function 'pg_fe_getauthname':
fe-auth.c:573: warning: passing argument 1 of 'free' discards qualifiers
from pointer target type

I think the attached is the appropriate fix. Any objections?

(moved to patches)

Applied.

Joe

Attachments:

current.pgsql.difftext/x-patch; name=current.pgsql.diffDownload
Index: src/interfaces/libpq/fe-auth.c
===================================================================
RCS file: /opt/src/cvs/pgsql/src/interfaces/libpq/fe-auth.c,v
retrieving revision 1.115
diff -c -r1.115 fe-auth.c
*** src/interfaces/libpq/fe-auth.c	20 Jun 2006 19:56:52 -0000	1.115
--- src/interfaces/libpq/fe-auth.c	4 Jul 2006 17:27:15 -0000
***************
*** 188,197 ****
  
  
  /*
!  * pg_krb5_authname -- returns a pointer to static space containing whatever
!  *					   name the user has authenticated to the system
!   */
! static const char *
  pg_krb5_authname(char *PQerrormsg)
  {
  	char *tmp_name;
--- 188,197 ----
  
  
  /*
!  * pg_krb5_authname -- returns a copy of whatever name the user
!  *					   has authenticated to the system, or NULL
!  */
! static char *
  pg_krb5_authname(char *PQerrormsg)
  {
  	char *tmp_name;
***************
*** 520,526 ****
  pg_fe_getauthname(char *PQerrormsg)
  {
  #ifdef KRB5
! 	const char *krb5_name = NULL;
  #endif
  	const char *name = NULL;
  	char	   *authn;
--- 520,526 ----
  pg_fe_getauthname(char *PQerrormsg)
  {
  #ifdef KRB5
! 	char       *krb5_name = NULL;
  #endif
  	const char *name = NULL;
  	char	   *authn;
#3Peter Eisentraut
peter_e@gmx.net
In reply to: Joe Conway (#2)
Re: [PATCHES] kerberos related warning

Am Mittwoch, 12. Juli 2006 04:38 schrieb Joe Conway:

gcc -O -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
-pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic
-DFRONTEND -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/et
-I../../../src/port -c -o fe-auth.o fe-auth.c -MMD
fe-auth.c: In function 'pg_fe_getauthname':
fe-auth.c:573: warning: passing argument 1 of 'free' discards qualifiers
from pointer target type

I don't see that. Which Kerberos version do you have?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#4Joe Conway
mail@joeconway.com
In reply to: Peter Eisentraut (#3)
Re: [PATCHES] kerberos related warning

Peter Eisentraut wrote:

Am Mittwoch, 12. Juli 2006 04:38 schrieb Joe Conway:

gcc -O -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
-pthread -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic
-DFRONTEND -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/et
-I../../../src/port -c -o fe-auth.o fe-auth.c -MMD
fe-auth.c: In function 'pg_fe_getauthname':
fe-auth.c:573: warning: passing argument 1 of 'free' discards qualifiers
from pointer target type

I don't see that. Which Kerberos version do you have?

I don't think it's related to Kerberos except that the entire problem is
#ifdef'd out unless "configure --with-krb5" is used. Maybe more
related to gcc version? In any case, I'm running stock fedora core 5:

krb5-libs-1.4.3-4.1
gcc-4.1.1-1.fc5

Joe