[1800] in Moira Commits

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

/svn/moira r3944 - trunk/moira/clients/moira

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed Dec 30 14:52:49 2009

Date: Wed, 30 Dec 2009 14:52:15 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <200912301952.nBUJqFx9001657@drugstore.mit.edu>
To: moira-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2009-12-30 14:52:15 -0500 (Wed, 30 Dec 2009)
New Revision: 3944

Modified:
   trunk/moira/clients/moira/cluster.c
   trunk/moira/clients/moira/menu.c
   trunk/moira/clients/moira/utils.c
Log:
Fix creating subnets on 64bit clients.

Modified: trunk/moira/clients/moira/cluster.c
===================================================================
--- trunk/moira/clients/moira/cluster.c	2009-12-29 17:29:34 UTC (rev 3943)
+++ trunk/moira/clients/moira/cluster.c	2009-12-30 19:52:15 UTC (rev 3944)
@@ -198,13 +198,13 @@
   info[SN_STATUS] = strdup("1");
   info[SN_CONTACT] = strdup(DEFAULT_NONE);
   info[SN_ACCT_NUMBER] = strdup("");
-  sprintf(buf, "%ld", ntohl(inet_addr("18.255.0.0")));
+  sprintf(buf, "%d", ntohl(inet_addr("18.255.0.0")));
   info[SN_ADDRESS] = strdup(buf);
-  sprintf(buf, "%ld", ntohl(inet_addr("255.255.0.0")));
+  sprintf(buf, "%d", ntohl(inet_addr("255.255.0.0")));
   info[SN_MASK] = strdup(buf);
-  sprintf(buf, "%ld", ntohl(inet_addr(S_DEFAULT_LOW)));
+  sprintf(buf, "%d", ntohl(inet_addr(S_DEFAULT_LOW)));
   info[SN_LOW] = strdup(buf);
-  sprintf(buf, "%ld", ntohl(inet_addr(S_DEFAULT_HIGH)));
+  sprintf(buf, "%d", ntohl(inet_addr(S_DEFAULT_HIGH)));
   info[SN_HIGH] = strdup(buf);
   info[SN_PREFIX] = strdup("");
   info[SN_ACE_TYPE] = strdup("LIST");
@@ -756,14 +756,14 @@
       if (atoi(info[SN_LOW]) == (int)ntohl(inet_addr(S_DEFAULT_LOW)))
 	{
 	  struct in_addr low;
-	  unsigned long mask, addr;
+	  unsigned int mask, addr;
 
 	  addr = atoi(info[SN_ADDRESS]);
 	  mask = atoi(info[SN_MASK]);
 	  low.s_addr = atoi(info[SN_LOW]);
 	  low.s_addr = (low.s_addr & ~mask) | (addr & mask);
 	  free(info[SN_LOW]);
-	  sprintf(temp_buf, "%ld", low.s_addr);
+	  sprintf(temp_buf, "%d", low.s_addr);
 	  info[SN_LOW] = strdup(temp_buf);
 	}
       if (GetAddressFromUser("Lowest assignable address", &info[SN_LOW]) ==
@@ -772,14 +772,14 @@
       if (atoi(info[SN_HIGH]) == (int)ntohl(inet_addr(S_DEFAULT_HIGH)))
 	{
 	  struct in_addr high;
-	  unsigned long mask, addr;
+	  unsigned int mask, addr;
 
 	  addr = atoi(info[SN_ADDRESS]);
 	  mask = atoi(info[SN_MASK]);
 	  high.s_addr = atoi(info[SN_HIGH]);
 	  high.s_addr = (high.s_addr & ~mask) | (addr & mask);
 	  free(info[SN_HIGH]);
-	  sprintf(temp_buf, "%ld", high.s_addr);
+	  sprintf(temp_buf, "%d", high.s_addr);
 	  info[SN_HIGH] = strdup(temp_buf);
 	}
       if (GetAddressFromUser("Highest assignable address", &info[SN_HIGH]) ==

Modified: trunk/moira/clients/moira/menu.c
===================================================================
--- trunk/moira/clients/moira/menu.c	2009-12-29 17:29:34 UTC (rev 3943)
+++ trunk/moira/clients/moira/menu.c	2009-12-30 19:52:15 UTC (rev 3944)
@@ -805,7 +805,7 @@
 
   if (!log_file)
     {
-      sprintf(buf, "%s/%s-log.%ld", get_tmp_dir(), whoami, (long)getpid());
+      sprintf(buf, "%s/%s-log.%d", get_tmp_dir(), whoami, getpid());
 
       /* open the file */
       log_file = fopen(buf, "a");

Modified: trunk/moira/clients/moira/utils.c
===================================================================
--- trunk/moira/clients/moira/utils.c	2009-12-29 17:29:34 UTC (rev 3943)
+++ trunk/moira/clients/moira/utils.c	2009-12-30 19:52:15 UTC (rev 3944)
@@ -867,7 +867,7 @@
     return SUB_ERROR;
   addr.s_addr = inet_addr(value);
   free(*pointer);
-  sprintf(buf, "%ld", ntohl(addr.s_addr));
+  sprintf(buf, "%d", ntohl(addr.s_addr));
   *pointer = strdup(buf);
   return SUB_NORMAL;
 }


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