random problems, mostly relating to dependencies on kth-krb?

Assar Westerlund assar at stacken.kth.se
Thu Jul 29 10:18:54 CEST 1999


Ken Raeburn <raeburn at raeburn.org> writes:
> I had to delete the definition of krb_principal from acl_files.c,
> because it was already defined via header files.

Ok, I should have figured that.

> In fact, the NetBSD-current libkafs sources haven't changed from the
> old libkafs that didn't define the syscall number on this OS.

I think the kafs library in NetBSD is way old and I dunno why they
haven't bothered to update to anything recent.  Feel free to hit them
on the head over that :-)

> So I've installed krbafs-0.9.8 from CMU.  It wasn't immediately
> obvious to me that the --with-krbafs option wants the directory
> containing the library itself, not the --prefix option passed when
> configuring krbafs.

Yeah, I think it would make more sense to point to the prefix option
instead.  We should probably change it, modulo that some people will
get burned.  What do you think of the appended patch to configure.in?
(It should DTRT except when directories are called something
strange...)

> Still missing, in the build for klog:
> 	krb_get_pw_in_tkt2

That's not needed for klog and I think it's there because that's what
kauth used.  Fixed.

> 	krb_get_default_principal

I took the easy way out and just did getpwuid(getuid()) instead.
Patches to klog.c are at the end and commited to CVS.

/assar


Index: configure.in
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/configure.in,v
retrieving revision 1.294
diff -u -w -u -w -r1.294 configure.in
--- configure.in	1999/07/24 13:10:43	1.294
+++ configure.in	1999/07/29 08:09:56
@@ -520,8 +520,14 @@
   export RXKAD_LIBS
   MILKO_RXKAD_LIBS=`echo $RXKAD_LIBS | sed s,\.\./,\.\./\.\./,`
   if test "$with_krbafs" != "no"; then
+    if test -f "${with_krbafs}/lib/libkrbafs.a"; then
+      KAFS_LIBS="-L${with_krbafs}/lib -lkrbafs"
+    elif test -f "${with_krbafs}/libkrbafs.a"; then
     KAFS_LIBS="-L${with_krbafs} -lkrbafs"
   else
+      AC_MSG_ERROR(didn't find any libkrbafs.a in ${with_krbafs})
+    fi
+  else
     KAFS_LIBS="-L${KRB_LIB_DIR} -lkafs"
   fi
   RXKAD_MAKEFILE="rxkad/Makefile"



Index: appl/klog.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/appl/klog.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -w -r1.4 -r1.5
--- klog.c	1999/07/14 22:14:56	1.4
+++ klog.c	1999/07/29 08:17:28	1.5
@@ -52,7 +52,7 @@
 #include <config.h>
 #endif
 
-RCSID("$Id: klog.c,v 1.4 1999/07/14 22:14:56 assar Exp $");
+RCSID("$Id: klog.c,v 1.5 1999/07/29 08:17:28 assar Exp $");
 
 #include "appl_locl.h"
 #include "klog.h"
@@ -245,7 +245,6 @@
 int get_k4_ticket(void)
 {
 	int rc;
-	des_cblock key;
 
 	int krb_lifetime;
 
@@ -260,9 +259,9 @@
 	if( (krb_lifetime > 255) || (krb_lifetime == 0) )
 	    krb_lifetime = 255;
 
-	rc = krb_get_pw_in_tkt2(principal, "", realm, 
-	   KRB_TICKET_GRANTING_TICKET, realm, krb_lifetime, password, &key);
-	memset (key, 0, sizeof(key));
+	rc = krb_get_pw_in_tkt(principal, "", realm, 
+			       KRB_TICKET_GRANTING_TICKET, realm,
+			       krb_lifetime, password);
 
 	if(rc)
 	    fprintf(stderr, "Unable to authenticate to Kerberos: %s\n", 
@@ -641,13 +640,13 @@
     /* Figure out the Kerberos principal we are going to use */
     if (principal == NULL) {
 	if(princ.name[0] == '\0') {
-	    if(krb_get_default_principal (princ.name, princ.instance,
-					  princ.realm) < 0) {
+	    struct passwd *pwd = getpwuid (getuid ());
+
+	    if (pwd == NULL) {
 		fprintf(stderr, "Could not get default principal\n");
 		die(1);
-	    } else {
-		principal = princ.name;
 	    }
+	    principal = pwd->pw_name;
 	} else {
 	    principal = princ.name;
 	}





More information about the Arla-drinkers mailing list