Make compile w/o krb4.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4684 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-03-26 23:46:03 +00:00
parent 50222176ef
commit 6d51cd1dfc
6 changed files with 67 additions and 9 deletions

View File

@@ -8,6 +8,12 @@ INCLUDES = -I$(srcdir)/../common $(INCLUDE_readline) $(INCLUDE_krb4) $(INCLUDE_r
bin_PROGRAMS = ftp
if KRB4
krb4_sources = $(EXTRA_ftp_SOURCES)
else
krb4_sources =
endif
ftp_SOURCES = \
cmds.c \
cmdtab.c \
@@ -17,10 +23,11 @@ ftp_SOURCES = \
domacro.c \
globals.c \
security.c \
krb4.c \
kauth.c \
$(krb4_sources) \
gssapi.c
EXTRA_ftp_SOURCES = krb4.c kauth.c
LDADD = \
../common/libcommon.a \
$(top_builddir)/lib/gssapi/libgssapi.a \

View File

@@ -105,11 +105,13 @@ char userhelp[] = "send new user information";
char verbosehelp[] = "toggle verbose mode";
char prothelp[] = "set protection level";
#ifdef KRB4
char kauthhelp[] = "get remote tokens";
char klisthelp[] = "show remote tickets";
char kdestroyhelp[] = "destroy remote tickets";
char krbtkfilehelp[] = "set filename of remote tickets";
char afsloghelp[] = "obtain remote AFS tokens";
#endif
struct cmd cmdtab[] = {
{ "!", shellhelp, 0, 0, 0, shell },
@@ -186,11 +188,13 @@ struct cmd cmdtab[] = {
{ "?", helphelp, 0, 0, 1, help },
{ "prot", prothelp, 0, 1, 0, sec_prot },
#ifdef KRB4
{ "kauth", kauthhelp, 0, 1, 0, kauth },
{ "klist", klisthelp, 0, 1, 0, klist },
{ "kdestroy", kdestroyhelp, 0, 1, 0, kdestroy },
{ "krbtkfile", krbtkfilehelp, 0, 1, 0, krbtkfile },
{ "afslog", afsloghelp, 0, 1, 0, afslog },
#endif
{ 0 },
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -93,8 +93,12 @@ name_to_level(const char *name)
#ifdef FTP_SERVER
static struct sec_server_mech *mechs[] = {
#ifdef KRB5
&gss_server_mech,
#endif
#ifdef KRB4
&krb4_server_mech,
#endif
NULL
};
@@ -103,8 +107,12 @@ static struct sec_server_mech *mech;
#else
static struct sec_client_mech *mechs[] = {
#ifdef KRB5
&gss_client_mech,
#endif
#ifdef KRB4
&krb4_client_mech,
#endif
NULL
};

View File

@@ -8,32 +8,45 @@ INCLUDES = -I$(srcdir)/../common $(INCLUDE_krb4) -DFTP_SERVER
libexec_PROGRAMS = ftpd
if KRB4
krb4_sources = $(EXTRA_ftpd_SOURCES)
else
krb4_sources =
endif
ftpd_SOURCES = \
ftpd.c \
ftpcmd.y \
logwtmp.c \
popen.c \
security.c \
krb4.c \
kauth.c \
$(krb4_sources) \
gssapi.c
EXTRA_ftpd_SOURCES = krb4.c kauth.c
$(ftpd_OBJECTS): security.h
security.c:
@test -f security.c || $(LN_S) $(srcdir)/../ftp/security.c .
security.h:
@test -f security.c || $(LN_S) $(srcdir)/../ftp/security.h .
@test -f security.h || $(LN_S) $(srcdir)/../ftp/security.h .
krb4.c:
@test -f security.c || $(LN_S) $(srcdir)/../ftp/krb4.c .
@test -f krb4.c || $(LN_S) $(srcdir)/../ftp/krb4.c .
gssapi.c:
@test -f security.c || $(LN_S) $(srcdir)/../ftp/gssapi.c .
@test -f gssapi.c || $(LN_S) $(srcdir)/../ftp/gssapi.c .
CLEANFILES = security.c security.h krb4.c gssapi.c
if KRB4
afslib = $(top_builddir)/lib/kafs/libkafs.a
else
afslib =
endif
LDADD = ../common/libcommon.a \
$(top_builddir)/lib/gssapi/libgssapi.a \
$(top_builddir)/lib/kafs/libkafs.a \
$(afslib) \
$(top_builddir)/lib/krb5/libkrb5.a \
$(top_builddir)/lib/des/libdes.a \
$(LIB_krb4) \

View File

@@ -493,6 +493,7 @@ cmd
| SITE SP KAUTH check_login SP STRING CRLF
{
#ifdef KRB4
char *p;
if(guest)
@@ -509,35 +510,55 @@ cmd
}
if($6 != NULL)
free($6);
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP KLIST check_login CRLF
{
#ifdef KRB4
if($4)
klist();
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP KDESTROY check_login CRLF
{
#ifdef KRB4
if($4)
kdestroy();
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP KRBTKFILE check_login SP STRING CRLF
{
#ifdef KRB4
if(guest)
reply(500, "Can't be done as guest.");
else if($4 && $6)
krbtkfile($6);
if($6)
free($6);
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP AFSLOG check_login CRLF
{
#ifdef KRB4
if(guest)
reply(500, "Can't be done as guest.");
else if($4)
afslog(NULL);
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP AFSLOG check_login SP STRING CRLF
{
#ifdef KRB4
if(guest)
reply(500, "Can't be done as guest.");
else if($4){
@@ -545,6 +566,9 @@ cmd
}
if($6)
free($6);
#else
reply(500, "Command not implemented.");
#endif
}
| SITE SP FIND check_login SP STRING CRLF
{

View File

@@ -1673,7 +1673,9 @@ dologout(int status)
if (logged_in) {
seteuid((uid_t)0);
ftpd_logwtmp(ttyline, "", "");
#ifdef KRB4
cond_kdestroy();
#endif
}
/* beware of flushing buffers after a SIGPIPE */
#ifdef XXX