Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2013 22:24:39 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245014 - head/usr.sbin/gssd
Message-ID:  <201301032224.r03MOdTP096649@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Thu Jan  3 22:24:39 2013
New Revision: 245014
URL: http://svnweb.freebsd.org/changeset/base/245014

Log:
  Fix r244604 so that it builds when MK_KERBEROS_SUPPORT == "no".
  
  Reported by:	bf
  Tested by:	bf
  Reviewed by:	gcooper
  MFC after:	3 days

Modified:
  head/usr.sbin/gssd/Makefile
  head/usr.sbin/gssd/gssd.c

Modified: head/usr.sbin/gssd/Makefile
==============================================================================
--- head/usr.sbin/gssd/Makefile	Thu Jan  3 22:05:20 2013	(r245013)
+++ head/usr.sbin/gssd/Makefile	Thu Jan  3 22:24:39 2013	(r245014)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 PROG=	gssd
 MAN=	gssd.8
 SRCS=	gssd.c gssd.h gssd_svc.c gssd_xdr.c gssd_prot.c
@@ -7,8 +9,14 @@ SRCS=	gssd.c gssd.h gssd_svc.c gssd_xdr.
 CFLAGS+= -I.
 WARNS?= 1
 
-DPADD=	${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
-LDADD=	-lgssapi -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
+DPADD=	${LIBGSSAPI}
+LDADD=	-lgssapi
+.if ${MK_KERBEROS_SUPPORT} != "no"
+DPADD+=	${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO}
+LDADD+=	-lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto
+.else
+CFLAGS+= -DWITHOUT_KERBEROS
+.endif
 
 CLEANFILES= gssd_svc.c gssd.h
 

Modified: head/usr.sbin/gssd/gssd.c
==============================================================================
--- head/usr.sbin/gssd/gssd.c	Thu Jan  3 22:05:20 2013	(r245013)
+++ head/usr.sbin/gssd/gssd.c	Thu Jan  3 22:24:39 2013	(r245014)
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
 #include <ctype.h>
 #include <dirent.h>
 #include <err.h>
+#ifndef WITHOUT_KERBEROS
 #include <krb5.h>
+#endif
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -102,12 +104,17 @@ main(int argc, char **argv)
 			debug_level++;
 			break;
 		case 's':
+#ifndef WITHOUT_KERBEROS
 			/*
 			 * Set the directory search list. This enables use of
 			 * find_ccache_file() to search the directories for a
 			 * suitable credentials cache file.
 			 */
 			strlcpy(ccfile_dirlist, optarg, sizeof(ccfile_dirlist));
+#else
+			errx(1, "This option not available when built"
+			    " without MK_KERBEROS\n");
+#endif
 			break;
 		case 'c':
 			/*
@@ -814,6 +821,7 @@ static int
 is_a_valid_tgt_cache(const char *filepath, uid_t uid, int *retrating,
     time_t *retexptime)
 {
+#ifndef WITHOUT_KERBEROS
 	krb5_context context;
 	krb5_principal princ;
 	krb5_ccache ccache;
@@ -913,5 +921,8 @@ is_a_valid_tgt_cache(const char *filepat
 		*retexptime = exptime;
 	}
 	return (ret);
+#else /* WITHOUT_KERBEROS */
+	return (0);
+#endif /* !WITHOUT_KERBEROS */
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301032224.r03MOdTP096649>