ak5log

Erland Fristedt (QRA) Erland.Fristedt at era.ericsson.se
Tue Apr 22 07:09:10 EDT 2003


Hi,

I'am using "KERBEROS and AFS INTEROPERABILITY ROUTINES" written by
Douglas E. Engert.

To be able to use his ak5log I had to modify the file 
"src/appl/bsd/login.c" as below.

Is this a good idea or should it be done in an other way?

BR / Erland


void
afs_login ()
{
#if defined(KRB4_GET_TICKETS) && defined(SETPAG)
    if (login_krb4_get_tickets && pwd->pw_uid) {
	/* Only reset the pag for non-root users. */
	/* This allows root to become anything. */
	pagflag = try_setpag ();
    }
#endif
#ifdef KRB_RUN_AKLOG
    if (got_v4_tickets && login_krb_run_aklog) {
	/* KPROGDIR is $(prefix)/bin */
	char aklog_path[MAXPATHLEN];
	struct stat st;
	/* construct the name */
	/* get this from profile later */
	aklog_path[sizeof(aklog_path) - 1] = '\0';
	strncpy (aklog_path, KPROGDIR, sizeof(aklog_path) - 1);
	strncat (aklog_path, "/aklog", sizeof(aklog_path) - 1 - strlen(aklog_path));
	/* only run it if we can find it */
	if (stat (aklog_path, &st) == 0) {
	    system(aklog_path);
	}
    }
#endif /* KRB_RUN_AKLOG */
/* Inserted by Erland */
#if defined(KRB_RUN_AK5LOG) && defined(KRB5_GET_TICKETS)
   if (got_v5_tickets || forwarded_v5_tickets)
   {
	char aklog_path[MAXPATHLEN];
	struct stat st;
	/* construct the name */
	/* get this from profile later */
	aklog_path[sizeof(aklog_path) - 1] = '\0';
	strncpy (aklog_path, KPROGDIR, sizeof(aklog_path) - 1);
	strncat (aklog_path, "/ak5log", sizeof(aklog_path) - 1 - strlen(aklog_path));
	/* only run it if we can find it */
	if (stat (aklog_path, &st) == 0) {
	    system(aklog_path);
	}
   } 
#endif /* KRB_RUN_AK5LOG */
}


More information about the krbdev mailing list