]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Build libafscp when we lack kerberos
authorAndrew Deason <adeason@sinenomine.net>
Tue, 26 Apr 2011 19:44:46 +0000 (14:44 -0500)
committerDerrick Brashear <shadow@dementix.org>
Sat, 10 Sep 2011 23:36:16 +0000 (16:36 -0700)
Currently, venus fails to build without kerberos, since the
dependencies for afsio always include afscp.h, which does not exist
when we do not build libafscp. To fix this the easy way, and since
libafscp is still very useful without kerberos, allow libafscp to
build without kerberos support (which limits it to anonymous
connections only).

Reviewed-on: http://gerrit.openafs.org/4577
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 64c92b24447aa1a86a4557d6bab3a72b38640fce)

Change-Id: I32ad1e26ab4f45647a69c0641e3027006e28bc2e
Reviewed-on: http://gerrit.openafs.org/5385
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Makefile.in
src/libafscp/afscp_server.c
src/libafscp/afscp_util.c
src/venus/Makefile.in

index e9f9a828c8885281f7d73f4b93ffbb1b43a52ba9..8ceb29ae2a477f22e69b169e946c1b652749e4a4 100644 (file)
@@ -153,11 +153,7 @@ util: procmgmt des lwp_depinstall rx_depinstall
        +${COMPILE_PART1} util ${COMPILE_PART2}
 
 libafscp: util afs volser vlserver rx auth fsint
-       +if test "@BUILD_KRB5@" = "yes"; then \
-               ${COMPILE_PART1} libafscp ${COMPILE_PART2} ; \
-       else \
-               echo Skipping libafscp for ${SYS_NAME} ; \
-       fi
+       +${COMPILE_PART1} libafscp ${COMPILE_PART2}
 
 audit: util rx rxkad fsint
        +${COMPILE_PART1} audit ${COMPILE_PART2} #TODO
index bb56f8d6d4c1ea6884761fb5c847fba5ec8967b9..0dc52503c9140d71680f3bad52d919990ebe1430 100644 (file)
@@ -36,7 +36,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define AFSCONF_CLIENTNAME AFSDIR_CLIENT_ETC_DIRPATH
 #endif
 #include <rx/rx.h>
-#include <krb5.h>
+#ifdef HAVE_KERBEROS
+# include <krb5.h>
+#endif
 #include "afscp.h"
 #include "afscp_internal.h"
 
@@ -163,9 +165,11 @@ afscp_DefaultCell(void)
 int
 afscp_SetDefaultRealm(const char *realmname)
 {
+    char *newdefrealm;
+
+#ifdef HAVE_KERBEROS
     /* krb5_error_code k5ec; */
     krb5_context k5con;
-    char *newdefrealm;
     int code;
 
     if (realmname == NULL) {
@@ -186,6 +190,8 @@ afscp_SetDefaultRealm(const char *realmname)
      * return -1;
      * } */
     /* krb5_set_default_realm() is returning 0 on success, not KRB5KDC_ERR_NONE */
+#endif /* HAVE_KERBEROS */
+
     newdefrealm = strdup(realmname);
     if (newdefrealm == NULL) {
        return -1;
index d5ca2cb4e1140949f79be11a5c460a63b472d43b..480d80dd775a4eb576b6c5721ce87ceb27b5447a 100644 (file)
@@ -36,7 +36,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <ubik.h>
 #include <rx/rx_null.h>
 #include <rx/rxkad.h>
-#include <krb5.h>
+#ifdef HAVE_KERBEROS
+# include <krb5.h>
+#endif
 #include "afscp.h"
 #include "afscp_internal.h"
 
@@ -95,7 +97,8 @@ _GetNullSecurityObject(struct afscp_cell *cell)
 int
 _GetSecurityObject(struct afscp_cell *cell)
 {
-    int code;
+    int code = ENOENT;
+#ifdef HAVE_KERBEROS
     krb5_context context;
     krb5_creds match;
     krb5_creds *cred;
@@ -198,6 +201,7 @@ _GetSecurityObject(struct afscp_cell *cell)
     return 0;
 
     try_anon:
+#endif /* HAVE_KERBEROS */
     if (try_anonymous)
        return _GetNullSecurityObject(cell);
     else
index 1c69672d7f8bbfb34ac55a479ba45d1bf366f362..76748b8fab6810e1840ac12673c39d4bdab4cc17 100644 (file)
@@ -96,12 +96,8 @@ afscbint.ss.o: ${srcdir}/../fsint/afscbint.ss.c
        ${PTH_CCRULE} ${srcdir}/../fsint/afscbint.ss.c
 
 afsio: afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS}
-       +if test "@BUILD_KRB5@" = "yes"; then \
-               $(MT_CC) @KRB5_CPPFLAGS@ $(PTH_LDFLAGS) $(PTH_CFLAGS) -o afsio afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS} \
-               ${MT_LIBS} ${XLIBS} ${KRB5LIBS} ; \
-       else \
-               echo "Skipping afsio (KRB5 build disabled)" ; \
-       fi
+       $(MT_CC) @KRB5_CPPFLAGS@ $(PTH_LDFLAGS) $(PTH_CFLAGS) -o afsio afsio.o vldbint.cs.o afscbint.ss.o vldbint.xdr.o ${AFSIO_LIBS} \
+               ${MT_LIBS} ${XLIBS} ${KRB5LIBS}
 
 livesys.o: livesys.c ${INCLS} AFS_component_version_number.c
 
@@ -309,9 +305,7 @@ install: kdump-build fs livesys up fstrace cmdebug afsio
        ${INSTALL_PROGRAM} up ${DESTDIR}${bindir}/up
        ${INSTALL_PROGRAM} fstrace ${DESTDIR}${sbindir}/fstrace
        ${INSTALL_PROGRAM} cmdebug ${DESTDIR}${bindir}/cmdebug
-       if test "@BUILD_KRB5@" = "yes"; then \
-               ${INSTALL_PROGRAM} afsio ${DESTDIR}${bindir}/afsio ; \
-       fi
+       ${INSTALL_PROGRAM} afsio ${DESTDIR}${bindir}/afsio ;
        -set -x; \
        case ${SYS_NAME} in \
        sgi_6? ) \
@@ -352,9 +346,7 @@ dest: kdump-build fs livesys up fstrace cmdebug afsio
        ${INSTALL_PROGRAM} up ${DEST}/bin/up
        ${INSTALL_PROGRAM} fstrace ${DEST}/etc/fstrace
        ${INSTALL_PROGRAM} cmdebug ${DEST}/bin/cmdebug
-       if test "@BUILD_KRB5@" = "yes"; then \
-               ${INSTALL_PROGRAM} afsio ${DEST}/bin/afsio ; \
-       fi
+       ${INSTALL_PROGRAM} afsio ${DEST}/bin/afsio
        -set -x; \
        case ${SYS_NAME} in \
        sgi_6? ) \