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

Commit65a513c

Browse files
committed
Support GSSAPI builds where the header is <gssapi.h> and not <gssapi/gssapi.h>,
such as OpenBSD (possibly all Heimdal).Stefan Kaltenbrunner
1 parent6771994 commit65a513c

File tree

7 files changed

+229
-47
lines changed

7 files changed

+229
-47
lines changed

‎configure

Lines changed: 198 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6824,7 +6824,7 @@ fi
68246824
rm -f conftest.err conftest.$ac_objext \
68256825
conftest$ac_exeext conftest.$ac_ext
68266826
if test "$ac_cv_search_gss_init_sec_context" = no; then
6827-
for ac_lib in gssapi_krb5; do
6827+
for ac_lib in gssapi_krb5 'gssapi -lkrb5 -lcrypto'; do
68286828
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
68296829
cat >conftest.$ac_ext <<_ACEOF
68306830
/* confdefs.h. */
@@ -10198,26 +10198,30 @@ fi
1019810198
fi
1019910199

1020010200
if test "$with_gssapi" = yes ; then
10201-
if test "${ac_cv_header_gssapi_gssapi_h+set}" = set; then
10202-
echo "$as_me:$LINENO: checking for gssapi/gssapi.h" >&5
10203-
echo $ECHO_N "checking for gssapi/gssapi.h... $ECHO_C" >&6
10204-
if test "${ac_cv_header_gssapi_gssapi_h+set}" = set; then
10201+
10202+
for ac_header in gssapi/gssapi.h
10203+
do
10204+
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10205+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
10206+
echo "$as_me:$LINENO: checking for $ac_header" >&5
10207+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10208+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
1020510209
echo $ECHO_N "(cached) $ECHO_C" >&6
1020610210
fi
10207-
echo "$as_me:$LINENO: result:$ac_cv_header_gssapi_gssapi_h" >&5
10208-
echo "${ECHO_T}$ac_cv_header_gssapi_gssapi_h" >&6
10211+
echo "$as_me:$LINENO: result:`eval echo '${'$as_ac_Header'}'`" >&5
10212+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
1020910213
else
1021010214
# Is the header compilable?
10211-
echo "$as_me:$LINENO: checkinggssapi/gssapi.h usability" >&5
10212-
echo $ECHO_N "checkinggssapi/gssapi.h usability... $ECHO_C" >&6
10215+
echo "$as_me:$LINENO: checking$ac_header usability" >&5
10216+
echo $ECHO_N "checking$ac_header usability... $ECHO_C" >&6
1021310217
cat >conftest.$ac_ext <<_ACEOF
1021410218
/* confdefs.h. */
1021510219
_ACEOF
1021610220
cat confdefs.h >>conftest.$ac_ext
1021710221
cat >>conftest.$ac_ext <<_ACEOF
1021810222
/* end confdefs.h. */
1021910223
$ac_includes_default
10220-
#include <gssapi/gssapi.h>
10224+
#include <$ac_header>
1022110225
_ACEOF
1022210226
rm -f conftest.$ac_objext
1022310227
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10253,15 +10257,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
1025310257
echo "${ECHO_T}$ac_header_compiler" >&6
1025410258

1025510259
# Is the header present?
10256-
echo "$as_me:$LINENO: checkinggssapi/gssapi.h presence" >&5
10257-
echo $ECHO_N "checkinggssapi/gssapi.h presence... $ECHO_C" >&6
10260+
echo "$as_me:$LINENO: checking$ac_header presence" >&5
10261+
echo $ECHO_N "checking$ac_header presence... $ECHO_C" >&6
1025810262
cat >conftest.$ac_ext <<_ACEOF
1025910263
/* confdefs.h. */
1026010264
_ACEOF
1026110265
cat confdefs.h >>conftest.$ac_ext
1026210266
cat >>conftest.$ac_ext <<_ACEOF
1026310267
/* end confdefs.h. */
10264-
#include <gssapi/gssapi.h>
10268+
#include <$ac_header>
1026510269
_ACEOF
1026610270
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
1026710271
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -10295,25 +10299,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
1029510299
# So? What about this header?
1029610300
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
1029710301
yes:no: )
10298-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&5
10299-
echo "$as_me: WARNING:gssapi/gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
10300-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: proceeding with the compiler's result" >&5
10301-
echo "$as_me: WARNING:gssapi/gssapi.h: proceeding with the compiler's result" >&2;}
10302+
{ echo "$as_me:$LINENO: WARNING:$ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
10303+
echo "$as_me: WARNING:$ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
10304+
{ echo "$as_me:$LINENO: WARNING:$ac_header: proceeding with the compiler's result" >&5
10305+
echo "$as_me: WARNING:$ac_header: proceeding with the compiler's result" >&2;}
1030210306
ac_header_preproc=yes
1030310307
;;
1030410308
no:yes:* )
10305-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: present but cannot be compiled" >&5
10306-
echo "$as_me: WARNING:gssapi/gssapi.h: present but cannot be compiled" >&2;}
10307-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: check for missing prerequisite headers?" >&5
10308-
echo "$as_me: WARNING:gssapi/gssapi.h: check for missing prerequisite headers?" >&2;}
10309-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: see the Autoconf documentation" >&5
10310-
echo "$as_me: WARNING:gssapi/gssapi.h: see the Autoconf documentation" >&2;}
10311-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: section \"Present But Cannot Be Compiled\"" >&5
10312-
echo "$as_me: WARNING:gssapi/gssapi.h: section \"Present But Cannot Be Compiled\"" >&2;}
10313-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: proceeding with the preprocessor's result" >&5
10314-
echo "$as_me: WARNING:gssapi/gssapi.h: proceeding with the preprocessor's result" >&2;}
10315-
{ echo "$as_me:$LINENO: WARNING:gssapi/gssapi.h: in the future, the compiler will take precedence" >&5
10316-
echo "$as_me: WARNING:gssapi/gssapi.h: in the future, the compiler will take precedence" >&2;}
10309+
{ echo "$as_me:$LINENO: WARNING:$ac_header: present but cannot be compiled" >&5
10310+
echo "$as_me: WARNING:$ac_header: present but cannot be compiled" >&2;}
10311+
{ echo "$as_me:$LINENO: WARNING:$ac_header: check for missing prerequisite headers?" >&5
10312+
echo "$as_me: WARNING:$ac_header: check for missing prerequisite headers?" >&2;}
10313+
{ echo "$as_me:$LINENO: WARNING:$ac_header: see the Autoconf documentation" >&5
10314+
echo "$as_me: WARNING:$ac_header: see the Autoconf documentation" >&2;}
10315+
{ echo "$as_me:$LINENO: WARNING:$ac_header: section \"Present But Cannot Be Compiled\"" >&5
10316+
echo "$as_me: WARNING:$ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
10317+
{ echo "$as_me:$LINENO: WARNING:$ac_header: proceeding with the preprocessor's result" >&5
10318+
echo "$as_me: WARNING:$ac_header: proceeding with the preprocessor's result" >&2;}
10319+
{ echo "$as_me:$LINENO: WARNING:$ac_header: in the future, the compiler will take precedence" >&5
10320+
echo "$as_me: WARNING:$ac_header: in the future, the compiler will take precedence" >&2;}
1031710321
(
1031810322
cat <<\_ASBOX
1031910323
## ---------------------------------------- ##
@@ -10324,25 +10328,180 @@ _ASBOX
1032410328
sed "s/^/$as_me: WARNING: /" >&2
1032510329
;;
1032610330
esac
10327-
echo "$as_me:$LINENO: checking forgssapi/gssapi.h" >&5
10328-
echo $ECHO_N "checking forgssapi/gssapi.h... $ECHO_C" >&6
10329-
if test"${ac_cv_header_gssapi_gssapi_h+set}" = set; then
10331+
echo "$as_me:$LINENO: checking for$ac_header" >&5
10332+
echo $ECHO_N "checking for$ac_header... $ECHO_C" >&6
10333+
ifeval "test\"\${$as_ac_Header+set}\" = set"; then
1033010334
echo $ECHO_N "(cached) $ECHO_C" >&6
1033110335
else
10332-
ac_cv_header_gssapi_gssapi_h=$ac_header_preproc
10336+
eval "$as_ac_Header=\$ac_header_preproc"
1033310337
fi
10334-
echo "$as_me:$LINENO: result:$ac_cv_header_gssapi_gssapi_h" >&5
10335-
echo "${ECHO_T}$ac_cv_header_gssapi_gssapi_h" >&6
10338+
echo "$as_me:$LINENO: result:`eval echo '${'$as_ac_Header'}'`" >&5
10339+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
1033610340

1033710341
fi
10338-
if test $ac_cv_header_gssapi_gssapi_h = yes; then
10339-
:
10342+
if test `eval echo '${'$as_ac_Header'}'` = yes; then
10343+
cat >>confdefs.h <<_ACEOF
10344+
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10345+
_ACEOF
10346+
10347+
else
10348+
10349+
for ac_header in gssapi.h
10350+
do
10351+
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10352+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
10353+
echo "$as_me:$LINENO: checking for $ac_header" >&5
10354+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10355+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
10356+
echo $ECHO_N "(cached) $ECHO_C" >&6
10357+
fi
10358+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
10359+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10360+
else
10361+
# Is the header compilable?
10362+
echo "$as_me:$LINENO: checking $ac_header usability" >&5
10363+
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
10364+
cat >conftest.$ac_ext <<_ACEOF
10365+
/* confdefs.h. */
10366+
_ACEOF
10367+
cat confdefs.h >>conftest.$ac_ext
10368+
cat >>conftest.$ac_ext <<_ACEOF
10369+
/* end confdefs.h. */
10370+
$ac_includes_default
10371+
#include <$ac_header>
10372+
_ACEOF
10373+
rm -f conftest.$ac_objext
10374+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10375+
(eval $ac_compile) 2>conftest.er1
10376+
ac_status=$?
10377+
grep -v '^ *+' conftest.er1 >conftest.err
10378+
rm -f conftest.er1
10379+
cat conftest.err >&5
10380+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10381+
(exit $ac_status); } &&
10382+
{ ac_try='test -z "$ac_c_werror_flag"
10383+
|| test ! -s conftest.err'
10384+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10385+
(eval $ac_try) 2>&5
10386+
ac_status=$?
10387+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10388+
(exit $ac_status); }; } &&
10389+
{ ac_try='test -s conftest.$ac_objext'
10390+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10391+
(eval $ac_try) 2>&5
10392+
ac_status=$?
10393+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10394+
(exit $ac_status); }; }; then
10395+
ac_header_compiler=yes
10396+
else
10397+
echo "$as_me: failed program was:" >&5
10398+
sed 's/^/| /' conftest.$ac_ext >&5
10399+
10400+
ac_header_compiler=no
10401+
fi
10402+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10403+
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10404+
echo "${ECHO_T}$ac_header_compiler" >&6
10405+
10406+
# Is the header present?
10407+
echo "$as_me:$LINENO: checking $ac_header presence" >&5
10408+
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
10409+
cat >conftest.$ac_ext <<_ACEOF
10410+
/* confdefs.h. */
10411+
_ACEOF
10412+
cat confdefs.h >>conftest.$ac_ext
10413+
cat >>conftest.$ac_ext <<_ACEOF
10414+
/* end confdefs.h. */
10415+
#include <$ac_header>
10416+
_ACEOF
10417+
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10418+
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10419+
ac_status=$?
10420+
grep -v '^ *+' conftest.er1 >conftest.err
10421+
rm -f conftest.er1
10422+
cat conftest.err >&5
10423+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10424+
(exit $ac_status); } >/dev/null; then
10425+
if test -s conftest.err; then
10426+
ac_cpp_err=$ac_c_preproc_warn_flag
10427+
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10428+
else
10429+
ac_cpp_err=
10430+
fi
10431+
else
10432+
ac_cpp_err=yes
10433+
fi
10434+
if test -z "$ac_cpp_err"; then
10435+
ac_header_preproc=yes
1034010436
else
10341-
{ { echo "$as_me:$LINENO: error: header file <gssapi/gssapi.h> is required for GSSAPI" >&5
10342-
echo "$as_me: error: header file <gssapi/gssapi.h> is required for GSSAPI" >&2;}
10437+
echo "$as_me: failed program was:" >&5
10438+
sed 's/^/| /' conftest.$ac_ext >&5
10439+
10440+
ac_header_preproc=no
10441+
fi
10442+
rm -f conftest.err conftest.$ac_ext
10443+
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10444+
echo "${ECHO_T}$ac_header_preproc" >&6
10445+
10446+
# So? What about this header?
10447+
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
10448+
yes:no: )
10449+
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
10450+
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
10451+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
10452+
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
10453+
ac_header_preproc=yes
10454+
;;
10455+
no:yes:* )
10456+
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
10457+
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
10458+
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
10459+
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
10460+
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
10461+
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
10462+
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
10463+
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
10464+
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
10465+
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
10466+
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
10467+
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
10468+
(
10469+
cat <<\_ASBOX
10470+
## ---------------------------------------- ##
10471+
## Report this to pgsql-bugs@postgresql.org ##
10472+
## ---------------------------------------- ##
10473+
_ASBOX
10474+
) |
10475+
sed "s/^/$as_me: WARNING: /" >&2
10476+
;;
10477+
esac
10478+
echo "$as_me:$LINENO: checking for $ac_header" >&5
10479+
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10480+
if eval "test \"\${$as_ac_Header+set}\" = set"; then
10481+
echo $ECHO_N "(cached) $ECHO_C" >&6
10482+
else
10483+
eval "$as_ac_Header=\$ac_header_preproc"
10484+
fi
10485+
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
10486+
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10487+
10488+
fi
10489+
if test `eval echo '${'$as_ac_Header'}'` = yes; then
10490+
cat >>confdefs.h <<_ACEOF
10491+
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10492+
_ACEOF
10493+
10494+
else
10495+
{ { echo "$as_me:$LINENO: error: gssapi.h header file is required for GSSAPI" >&5
10496+
echo "$as_me: error: gssapi.h header file is required for GSSAPI" >&2;}
1034310497
{ (exit 1); exit 1; }; }
1034410498
fi
1034510499

10500+
done
10501+
10502+
fi
10503+
10504+
done
1034610505

1034710506
fi
1034810507

‎configure.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.519 2007/07/12 14:10:39 mha Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.520 2007/07/12 14:36:52 mha Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -767,8 +767,8 @@ fi
767767

768768
if test "$with_gssapi" = yes ; then
769769
if test "$PORTNAME" != "win32"; then
770-
AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5], [],
771-
[AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
770+
AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 'gssapi -lkrb5 -lcrypto'], [],
771+
[AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
772772
else
773773
LIBS="$LIBS -lgssapi32"
774774
fi
@@ -870,7 +870,8 @@ Use --without-zlib to disable zlib support.])])
870870
fi
871871

872872
if test "$with_gssapi" = yes ; then
873-
AC_CHECK_HEADER(gssapi/gssapi.h, [], [AC_MSG_ERROR([header file <gssapi/gssapi.h> is required for GSSAPI])])
873+
AC_CHECK_HEADERS(gssapi/gssapi.h, [],
874+
[AC_CHECK_HEADERS(gssapi.h, [], [AC_MSG_ERROR([gssapi.h header file is required for GSSAPI])])])
874875
fi
875876

876877
if test "$with_krb5" = yes ; then

‎src/backend/libpq/auth.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.150 2007/07/11 08:27:33 mha Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.151 2007/07/12 14:36:52 mha Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -302,7 +302,11 @@ pg_krb5_recvauth(Port *port)
302302
*----------------------------------------------------------------
303303
*/
304304

305+
#if defined(HAVE_GSSAPI_H)
306+
#include<gssapi.h>
307+
#else
305308
#include<gssapi/gssapi.h>
309+
#endif
306310

307311
#ifdefWIN32
308312
/*

‎src/include/libpq/libpq-be.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.59 2007/07/10 13:14:21 mha Exp $
14+
* $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.60 2007/07/1214:36:52 mha Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -30,8 +30,12 @@
3030
#endif
3131

3232
#ifdefENABLE_GSS
33+
#if defined(HAVE_GSSAPI_H)
34+
#include<gssapi.h>
35+
#else
3336
#include<gssapi/gssapi.h>
3437
#endif
38+
#endif
3539

3640
#include"libpq/hba.h"
3741
#include"libpq/pqcomm.h"

‎src/include/pg_config.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@
172172
/* Define to 1 if you have the `getrusage' function. */
173173
#undef HAVE_GETRUSAGE
174174

175+
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
176+
#undef HAVE_GSSAPI_GSSAPI_H
177+
178+
/* Define to 1 if you have the <gssapi.h> header file. */
179+
#undef HAVE_GSSAPI_H
180+
175181
/* Define to 1 if you have the <history.h> header file. */
176182
#undef HAVE_HISTORY_H
177183

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp