Complete support for --disable-afs-support

This commit is contained in:
Nicolas Williams
2016-08-10 19:51:11 -05:00
parent 3e6fb5bb41
commit 76c596ceb8
12 changed files with 41 additions and 16 deletions

View File

@@ -8,8 +8,11 @@ endif
if DCE
dir_dce = dceutils
endif
if !NO_AFS
dir_afsutil = afsutil
endif
SUBDIRS = \
afsutil \
$(dir_afsutil) \
dbutils \
ftp \
login \

View File

@@ -536,8 +536,11 @@ cmd
#if defined(KRB5)
if(guest)
reply(500, "Can't be done as guest.");
else if($5)
else if($5) {
#ifndef NO_AFS
afslog(NULL, 0);
#endif
}
#else
reply(500, "Command not implemented.");
#endif
@@ -547,8 +550,11 @@ cmd
#if defined(KRB5)
if(guest)
reply(500, "Can't be done as guest.");
else if($7)
else if($7) {
#ifndef NO_AFS
afslog($5, 0);
#endif
}
if($5)
free($5);
#else

View File

@@ -711,7 +711,7 @@ int do_login(int code, char *passwd)
return -1;
}
initgroups(pw->pw_name, pw->pw_gid);
#if defined(KRB5)
#if defined(KRB5) && !defined(NO_AFS)
if(k_hasafs())
k_setpag();
#endif
@@ -864,9 +864,11 @@ krb5_verify(struct passwd *pwd, char *passwd)
1,
NULL);
krb5_free_principal(context, princ);
#ifndef NO_AFS
if (k_hasafs()) {
krb5_afslog_uid_home(context, id,NULL, NULL,pwd->pw_uid, pwd->pw_dir);
}
#endif
krb5_cc_destroy(context, id);
krb5_free_context (context);
if(ret)

View File

@@ -145,7 +145,7 @@
#include <krb5.h>
#endif /* KRB5 */
#if defined(KRB5)
#if defined(KRB5) && !defined(NO_AFS)
#include <kafs.h>
#endif

View File

@@ -67,7 +67,9 @@ gssapi_session(void *app_data, char *username)
1, 1, NULL, NULL);
if (GSS_ERROR(major))
ret = 1;
#ifndef NO_AFS
afslog(NULL, 1);
#endif
}
gss_release_cred(&minor, &data->delegated_cred_handle);

View File

@@ -82,7 +82,9 @@ cond_kdestroy(void)
#endif
do_destroy_tickets = 0;
}
#ifndef NO_AFS
afsunlog();
#endif
}
void
@@ -91,11 +93,13 @@ kdestroy(void)
#if KRB5
dest_cc();
#endif
#ifndef NO_AFS
afsunlog();
#endif
reply(200, "Tickets destroyed");
}
#ifndef NO_AFS
void
afslog(const char *cell, int quiet)
{
@@ -134,6 +138,7 @@ afsunlog(void)
if(k_hasafs())
k_unlog();
}
#endif
#else
int ftpd_afslog_placeholder;

View File

@@ -405,16 +405,11 @@ find_log10(int num)
* have to fetch them.
*/
#ifdef KRB5
static int do_the_afs_dance = 1;
#endif
static int
lstat_file (const char *file, struct stat *sb)
{
#ifdef KRB5
if (do_the_afs_dance &&
k_hasafs()
#if defined(KRB5) && !defined(NO_AFS)
if (k_hasafs()
&& strcmp(file, ".")
&& strcmp(file, "..")
&& strcmp(file, "/"))

View File

@@ -145,9 +145,6 @@ otp_verify(struct passwd *pwd, const char *password)
}
#endif /* OTP */
static int pag_set = 0;
#ifdef KRB5
static krb5_context context;
static krb5_ccache id, id2;
@@ -207,6 +204,8 @@ krb5_finish (void)
static void
krb5_get_afs_tokens (const struct passwd *pwd)
{
#ifndef NO_AFS
static int pag_set = 0;
char cell[64];
char *pw_dir;
krb5_error_code ret;
@@ -231,6 +230,7 @@ krb5_get_afs_tokens (const struct passwd *pwd)
pwd->pw_uid, pwd->pw_dir);
krb5_cc_close (context, id2);
}
#endif
}
#endif /* KRB5 */

View File

@@ -87,7 +87,9 @@
#ifdef KRB5
#include <krb5.h>
#endif
#ifndef NO_AFS
#include <kafs.h>
#endif
#ifdef OTP
#include <otp.h>

View File

@@ -57,7 +57,9 @@ RCSID("$Id$");
#ifdef KRB5
#include <krb5.h>
#endif
#ifndef NO_AFS
#include <kafs.h>
#endif
#include <err.h>
#include <roken.h>
#include <getarg.h>
@@ -252,11 +254,13 @@ krb5_start_session(void)
}
esetenv("KRB5CCNAME", cc_name, 1);
#ifndef NO_AFS
/* convert creds? */
if(k_hasafs()) {
if (k_setpag() == 0)
krb5_afslog(context, ccache2, NULL, NULL);
}
#endif
krb5_cc_close(context, ccache2);
krb5_cc_destroy(context, ccache);