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 bin_PROGRAMS = ftp
if KRB4
krb4_sources = $(EXTRA_ftp_SOURCES)
else
krb4_sources =
endif
ftp_SOURCES = \ ftp_SOURCES = \
cmds.c \ cmds.c \
cmdtab.c \ cmdtab.c \
@@ -17,10 +23,11 @@ ftp_SOURCES = \
domacro.c \ domacro.c \
globals.c \ globals.c \
security.c \ security.c \
krb4.c \ $(krb4_sources) \
kauth.c \
gssapi.c gssapi.c
EXTRA_ftp_SOURCES = krb4.c kauth.c
LDADD = \ LDADD = \
../common/libcommon.a \ ../common/libcommon.a \
$(top_builddir)/lib/gssapi/libgssapi.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 verbosehelp[] = "toggle verbose mode";
char prothelp[] = "set protection level"; char prothelp[] = "set protection level";
#ifdef KRB4
char kauthhelp[] = "get remote tokens"; char kauthhelp[] = "get remote tokens";
char klisthelp[] = "show remote tickets"; char klisthelp[] = "show remote tickets";
char kdestroyhelp[] = "destroy remote tickets"; char kdestroyhelp[] = "destroy remote tickets";
char krbtkfilehelp[] = "set filename of remote tickets"; char krbtkfilehelp[] = "set filename of remote tickets";
char afsloghelp[] = "obtain remote AFS tokens"; char afsloghelp[] = "obtain remote AFS tokens";
#endif
struct cmd cmdtab[] = { struct cmd cmdtab[] = {
{ "!", shellhelp, 0, 0, 0, shell }, { "!", shellhelp, 0, 0, 0, shell },
@@ -186,11 +188,13 @@ struct cmd cmdtab[] = {
{ "?", helphelp, 0, 0, 1, help }, { "?", helphelp, 0, 0, 1, help },
{ "prot", prothelp, 0, 1, 0, sec_prot }, { "prot", prothelp, 0, 1, 0, sec_prot },
#ifdef KRB4
{ "kauth", kauthhelp, 0, 1, 0, kauth }, { "kauth", kauthhelp, 0, 1, 0, kauth },
{ "klist", klisthelp, 0, 1, 0, klist }, { "klist", klisthelp, 0, 1, 0, klist },
{ "kdestroy", kdestroyhelp, 0, 1, 0, kdestroy }, { "kdestroy", kdestroyhelp, 0, 1, 0, kdestroy },
{ "krbtkfile", krbtkfilehelp, 0, 1, 0, krbtkfile }, { "krbtkfile", krbtkfilehelp, 0, 1, 0, krbtkfile },
{ "afslog", afsloghelp, 0, 1, 0, afslog }, { "afslog", afsloghelp, 0, 1, 0, afslog },
#endif
{ 0 }, { 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). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -93,8 +93,12 @@ name_to_level(const char *name)
#ifdef FTP_SERVER #ifdef FTP_SERVER
static struct sec_server_mech *mechs[] = { static struct sec_server_mech *mechs[] = {
#ifdef KRB5
&gss_server_mech, &gss_server_mech,
#endif
#ifdef KRB4
&krb4_server_mech, &krb4_server_mech,
#endif
NULL NULL
}; };
@@ -103,8 +107,12 @@ static struct sec_server_mech *mech;
#else #else
static struct sec_client_mech *mechs[] = { static struct sec_client_mech *mechs[] = {
#ifdef KRB5
&gss_client_mech, &gss_client_mech,
#endif
#ifdef KRB4
&krb4_client_mech, &krb4_client_mech,
#endif
NULL NULL
}; };

View File

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

View File

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

View File

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