[1794] in Moira

home help back first fref pref prev next nref lref last post

Re: namespace coredump

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Sat May 19 08:33:43 2001

Message-Id: <200105191233.IAA03695@riff-raff.mit.edu>
To: Jonathon Weiss <jweiss@MIT.EDU>
cc: bug-moira@MIT.EDU
In-Reply-To: Your message of "Sat, 19 May 2001 03:39:58 EDT."
             <200105190739.DAA27313@bearing-an-hourglass.mit.edu> 
Date: Sat, 19 May 2001 08:33:37 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	We do care; the problem was that namespace was never updated to
send a query version, so it was getting version 2 of everything, which
won't work with the current version of ShowUserByLogin().  This patch
guts a bunch of code and makes it use mrcl_connect() rather than calling
a bunch of libmoira functions by hand.  As a benefit, the query version
can't get out of sync between moira and namespace now.

Garry

Index: namespace.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/namespace.c,v
retrieving revision 1.12
diff -u -r1.12 namespace.c
--- namespace.c	1998/10/21 19:25:09	1.12
+++ namespace.c	2001/05/19 12:27:55
@@ -14,6 +14,7 @@
 
 #include <mit-copyright.h>
 #include <moira.h>
+#include <mrclient.h>
 #include "defs.h"
 #include "f_defs.h"
 #include "globals.h"
@@ -223,30 +224,9 @@
 	}
     }
 
-  if ((status = mr_connect(moira_server)))
-    ErrorExit("\nConnection to Moira server failed", status);
-
-  /* do this now since calling mr_connect initialized the krb error table
-   * for us.
-   */
-  if ((status = tf_init(TKT_FILE, R_TKT_FIL)) ||
-      (status = tf_get_pname(pname)))
-    {
-      com_err(whoami, status, "cannot find your ticket file");
-      exit(1);
-    }
-  tf_close();
-  user = strdup(pname);
-
-  if ((status = mr_motd(&motd)))
-    ErrorExit("\nUnable to check server status", status);
-  if (motd)
-    {
-      fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
-	      motd);
-      mr_disconnect();
-      exit(1);
-    }
+  if (mrcl_connect(moira_server, program_name, QUERY_VERSION, 0)
+      != MRCL_SUCCESS)
+    exit(1);
 
   if ((status = mr_auth(program_name)))
     {



home help back first fref pref prev next nref lref last post