summaryrefslogtreecommitdiffstats
path: root/usr.sbin/gssd
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2013-01-03 22:24:39 +0000
committerrmacklem <rmacklem@FreeBSD.org>2013-01-03 22:24:39 +0000
commitd35d00318611405595606c99dddda9d64626a380 (patch)
tree9b1863743ae2d11965b72c48577fcd8322c82ed0 /usr.sbin/gssd
parentdd949d49c50addcd8600bcc1445b9e74432e9221 (diff)
downloadFreeBSD-src-d35d00318611405595606c99dddda9d64626a380.zip
FreeBSD-src-d35d00318611405595606c99dddda9d64626a380.tar.gz
Fix r244604 so that it builds when MK_KERBEROS_SUPPORT == "no".
Reported by: bf Tested by: bf Reviewed by: gcooper MFC after: 3 days
Diffstat (limited to 'usr.sbin/gssd')
-rw-r--r--usr.sbin/gssd/Makefile12
-rw-r--r--usr.sbin/gssd/gssd.c11
2 files changed, 21 insertions, 2 deletions
diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile
index 28e8f7d..3663bf9 100644
--- a/usr.sbin/gssd/Makefile
+++ b/usr.sbin/gssd/Makefile
@@ -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.c gssd_prot.c
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
diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c
index 78ca859..9777943 100644
--- a/usr.sbin/gssd/gssd.c
+++ b/usr.sbin/gssd/gssd.c
@@ -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 *filepath, uid_t uid, int *retrating,
*retexptime = exptime;
}
return (ret);
+#else /* WITHOUT_KERBEROS */
+ return (0);
+#endif /* !WITHOUT_KERBEROS */
}
OpenPOWER on IntegriCloud