[24426] in Source-Commits

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

/svn/athena r24017 - in trunk/third/moira: clients/lib clients/stella dcm debian gen incremental/ldap update

daemon@ATHENA.MIT.EDU (Evan Broder)
Tue Sep 22 00:16:26 2009

X-Barracuda-Envelope-From: broder@mit.edu
Date: Tue, 22 Sep 2009 00:16:14 -0400
From: Evan Broder <broder@MIT.EDU>
Message-Id: <200909220416.n8M4GEhd011473@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: broder
Date: 2009-09-22 00:16:13 -0400 (Tue, 22 Sep 2009)
New Revision: 24017

Modified:
   trunk/third/moira/clients/lib/member.c
   trunk/third/moira/clients/stella/stella.c
   trunk/third/moira/dcm/dcm.pc
   trunk/third/moira/debian/changelog
   trunk/third/moira/gen/dhcp.sh
   trunk/third/moira/incremental/ldap/winad.c
   trunk/third/moira/update/ticket.c
Log:
In moira:
  * New CVS snapshot.


Modified: trunk/third/moira/clients/lib/member.c
===================================================================
--- trunk/third/moira/clients/lib/member.c	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/clients/lib/member.c	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,4 +1,4 @@
-/* $Id: member.c,v 1.6 2009-05-04 20:49:09 zacheiss Exp $
+/* $Id: member.c,v 1.7 2009-08-11 18:29:47 zacheiss Exp $
  *
  * Shared routines for playing with list membership.
  *
@@ -19,7 +19,7 @@
 
 #include <krb5.h>
 
-RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/lib/member.c,v 1.6 2009-05-04 20:49:09 zacheiss Exp $");
+RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/lib/member.c,v 1.7 2009-08-11 18:29:47 zacheiss Exp $");
 
 int mrcl_validate_string_member(char *str)
 {
@@ -99,11 +99,11 @@
 	}
 
       code = krb5_init_context(&context);
-      if (!code)
+      if (code)
         goto out;
 
       code = krb5_get_default_realm(context, &default_realm);
-      if (!code)
+      if (code)
         goto out;
 
       *ret = malloc(strlen(str) + strlen(default_realm) + 2);

Modified: trunk/third/moira/clients/stella/stella.c
===================================================================
--- trunk/third/moira/clients/stella/stella.c	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/clients/stella/stella.c	2009-09-22 04:16:13 UTC (rev 24017)
@@ -31,7 +31,7 @@
 #include <arpa/inet.h>
 #endif
 
-RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/stella/stella.c,v 1.20 2003-12-20 02:55:49 zacheiss Exp $");
+RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/stella/stella.c,v 1.21 2009-09-21 16:08:19 zacheiss Exp $");
 
 struct owner_type {
   int type;
@@ -686,10 +686,21 @@
     args[0] = canonicalize_hostname(strdup(hostname));
     args[1] = args[2] = args[3] = "*";
     status = wrap_mr_query("get_host", 4, args, store_host_info, argv);
+
+    /* We might be looking for an alias of a deleted host. */
+    if (status && status == MR_NO_MATCH) {
+      status = wrap_mr_query("get_hostalias", 2, args, store_host_info, argv);
+      if (!status) {
+	args[0] = strdup(argv[1]);
+	status = wrap_mr_query("get_host", 4, args, store_host_info, argv);
+      }
+    }
+
     if (status) {
       com_err(whoami, status, "while getting host information");
       exit(1);
     }
+
     if (unformatted_flag)
       show_host_info_unformatted(argv);
     else

Modified: trunk/third/moira/dcm/dcm.pc
===================================================================
--- trunk/third/moira/dcm/dcm.pc	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/dcm/dcm.pc	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,4 +1,4 @@
-/* $Id: dcm.pc,v 1.17 2006-08-22 17:36:24 zacheiss Exp $
+/* $Id: dcm.pc,v 1.18 2009-09-08 22:00:20 zacheiss Exp $
  *
  * The Data Control Manager for Moira.
  *
@@ -27,7 +27,7 @@
 EXEC SQL INCLUDE sqlca;
 void sqlglm(char *, unsigned int *, unsigned int *);
 
-RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/dcm/dcm.pc,v 1.17 2006-08-22 17:36:24 zacheiss Exp $");
+RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/dcm/dcm.pc,v 1.18 2009-09-08 22:00:20 zacheiss Exp $");
 
 int generate_service(char *name, int force);
 void do_hosts(char *service);
@@ -525,8 +525,10 @@
       return MR_CANT_CONNECT;
     }
 
-  code = mr_send_auth(conn, host);
+  code = mr_send_krb5_auth(conn, host);
   if (code)
+    code = mr_send_auth(conn, host);
+  if (code)
     {
       com_err(whoami, code, "authenticating to %s", host);
       goto done;

Modified: trunk/third/moira/debian/changelog
===================================================================
--- trunk/third/moira/debian/changelog	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/debian/changelog	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,3 +1,9 @@
+debathena-moira (4.0.0+cvs20090922-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot.
+
+ -- Evan Broder <broder@mit.edu>  Tue, 22 Sep 2009 00:15:15 -0400
+
 debathena-moira (4.0.0+cvs20090728-0debathena3) unstable; urgency=low
 
   * Add a missing conflicts to make upgrades run more smoothly.

Modified: trunk/third/moira/gen/dhcp.sh
===================================================================
--- trunk/third/moira/gen/dhcp.sh	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/gen/dhcp.sh	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: dhcp.sh,v 1.3 2001-01-16 18:37:27 zacheiss Exp $
+# $Id: dhcp.sh,v 1.5 2009-08-12 22:38:37 jweiss Exp $
 
 if [ -d /var/athena ] && [ -w /var/athena ]; then
     exec >/var/athena/moira_update.log 2>&1
@@ -13,15 +13,12 @@
 MR_MKCRED=47836474
 MR_TARERR=47836476
 
-PATH=/usr/bin
+PATH=/usr/bin:/bin
 TARFILE=/var/tmp/dhcp.out
 BOOTGEN=/var/boot/dhcpd.conf.print
 BOOTHEAD=/var/boot/dhcpd.conf.head
 BOOTFOOT=/var/boot/dhcpd.conf.foot
 BOOTFILE=/var/boot/dhcpd.conf
-LEASEFILE=/var/boot/dhcpd.leases
-PIDFILE=/var/boot/dhcpd.pid
-BINFILE=/var/boot/dhcpd
 PSWDFILE=/var/boot/hp.add
 
 # Alert if the tar file or other needed files do not exist
@@ -43,8 +40,8 @@
 cat $BOOTHEAD $BOOTGEN $BOOTFOOT > $BOOTFILE
 
 # kill and rerun dhcpd
-test -f $PIDFILE && kill `cat $PIDFILE`
-test -x $BINFILE && $BINFILE -cf $BOOTFILE -lf $LEASEFILE -pf $PIDFILE 
+/etc/init.d/dhcpd stop
+/etc/init.d/dhcpd start
 
 # cleanup
 test -f $TARFILE && rm -f $TARFILE

Modified: trunk/third/moira/incremental/ldap/winad.c
===================================================================
--- trunk/third/moira/incremental/ldap/winad.c	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/incremental/ldap/winad.c	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,4 +1,4 @@
-/* $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/incremental/ldap/winad.c,v 1.24 2009-06-01 21:05:00 zacheiss Exp $
+/* $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/incremental/ldap/winad.c,v 1.25 2009-09-02 19:17:35 zacheiss Exp $
 /* ldap.incr arguments example
  *
  * arguments when moira creates the account - ignored by ldap.incr since the 
@@ -4346,6 +4346,20 @@
 			  user_name, ldap_err2string(rc));
 	      }
 	    }
+	} else if(rc==MR_NO_MATCH) {
+	  
+	  n = 0;
+	  ADD_ATTR("mailRoutingAddress", mail_routing_v, LDAP_MOD_REPLACE);
+	  mods[n] = NULL;
+	  rc = ldap_modify_s(ldap_handle, distinguished_name, mods);
+	  
+	  if (rc == LDAP_ALREADY_EXISTS || rc == LDAP_TYPE_OR_VALUE_EXISTS)
+	    rc = LDAP_SUCCESS;
+
+	  if(rc)
+	    com_err(whoami, 0, 
+		    "Unable to set the mailRoutingAddress for %s : %s",
+		    user_name, ldap_err2string(rc));
 	}
       moira_disconnect();
     }

Modified: trunk/third/moira/update/ticket.c
===================================================================
--- trunk/third/moira/update/ticket.c	2009-09-21 00:57:14 UTC (rev 24016)
+++ trunk/third/moira/update/ticket.c	2009-09-22 04:16:13 UTC (rev 24017)
@@ -1,4 +1,4 @@
-/* $Id: ticket.c,v 1.25 2009-07-28 16:18:53 zacheiss Exp $
+/* $Id: ticket.c,v 1.26 2009-09-08 21:59:26 zacheiss Exp $
  *
  * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
  * For copying and distribution information, please see the file
@@ -21,7 +21,7 @@
 #include <krb5.h>
 #include <update.h>
 
-RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/update/ticket.c,v 1.25 2009-07-28 16:18:53 zacheiss Exp $");
+RCSID("$Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/update/ticket.c,v 1.26 2009-09-08 21:59:26 zacheiss Exp $");
 
 #ifdef HAVE_KRB4
 static char realm[REALM_SZ];
@@ -31,6 +31,7 @@
 #endif
 krb5_context context = NULL;
 
+static int get_mr_krb5_tgt(krb5_context context, krb5_ccache ccache);
 #ifdef HAVE_KRB4
 static int get_mr_tgt(void);
 #endif
@@ -40,6 +41,7 @@
   krb5_auth_context auth_con = NULL;
   krb5_ccache ccache = NULL;
   krb5_error_code code;
+  int pass = 1;
 
   code = krb5_init_context(&context);
   if (code)
@@ -53,8 +55,23 @@
   if (code)
     goto out;
 
+ try_it:
   code = krb5_mk_req(context, &auth_con, 0, "host", host, NULL, ccache,
 		     auth);
+  if (code)
+    {
+      if (pass == 1)
+	{
+	  if ((code = get_mr_krb5_tgt(context, ccache)))
+	    {
+	      com_err(whoami, code, "can't get Kerberos v5 TGT");
+	      return code;
+	    }
+	  pass++;
+	  goto try_it;
+	}
+      com_err(whoami, code, "in krb5_mk_req");
+    }
 
  out:
   if (ccache)
@@ -64,6 +81,38 @@
   return code;
 }
 
+int get_mr_krb5_tgt(krb5_context context, krb5_ccache ccache)
+{
+  krb5_creds my_creds;
+  krb5_principal me = NULL;
+  krb5_error_code code;
+
+  memset(&my_creds, 0, sizeof(my_creds));
+
+  code = krb5_parse_name(context, master, &me);
+  if (code)
+    goto out;
+  
+  code = krb5_get_init_creds_keytab(context, &my_creds, me, NULL, NULL, NULL, NULL);
+  if (code)
+    goto out;
+  
+  code = krb5_cc_initialize(context, ccache, me);
+  if (code)
+    goto out;
+
+  code = krb5_cc_store_cred(context, ccache, &my_creds);
+  if (code)
+    goto out;
+
+ out:
+  if (me)
+    krb5_free_principal(context, me);
+  krb5_free_cred_contents(context, &my_creds);
+
+  return code;
+}
+
 int get_mr_update_ticket(char *host, KTEXT ticket)
 {
 #ifdef HAVE_KRB4


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