[2029] in Moira Commits

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

/svn/moira r4171 - trunk/moira/gen

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed Jul 9 15:23:51 2014

Date: Wed, 9 Jul 2014 15:23:39 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201407091923.s69JNdbQ025890@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2014-07-09 15:23:39 -0400 (Wed, 09 Jul 2014)
New Revision: 4171

Modified:
   trunk/moira/gen/acl.pc
   trunk/moira/gen/directory.pc
   trunk/moira/gen/hesiod.pc
Log:
Omit home address/phone number fields from generated files.

Modified: trunk/moira/gen/acl.pc
===================================================================
--- trunk/moira/gen/acl.pc	2014-07-07 14:00:06 UTC (rev 4170)
+++ trunk/moira/gen/acl.pc	2014-07-09 19:23:39 UTC (rev 4171)
@@ -265,7 +265,7 @@
   EXEC SQL BEGIN DECLARE SECTION;
   char shell[USERS_SHELL_SIZE], fullname[USERS_FULLNAME_SIZE];
   char oa[USERS_OFFICE_ADDR_SIZE];
-  char op[USERS_OFFICE_PHONE_SIZE], hp[USERS_HOME_PHONE_SIZE];
+  char op[USERS_OFFICE_PHONE_SIZE];
   int uid, i = 0;
   char *name, *n, *lasts = NULL;
   EXEC SQL END DECLARE SECTION;
@@ -278,8 +278,8 @@
 	  name = m->name;
 
 	  EXEC SQL SELECT unix_uid, shell, fullname,
-	    office_addr, office_phone, home_phone
-	    INTO :uid, :shell, :fullname, :oa, :op, :hp
+	    office_addr, office_phone
+	    INTO :uid, :shell, :fullname, :oa, :op
 	    FROM users
 	    WHERE login = :name AND status != 3;
 	  if (sqlca.sqlcode)
@@ -289,10 +289,9 @@
 	  strtrim(fullname);
 	  strtrim(op);
 	  strtrim(oa);
-	  strtrim(hp);
 
-	  fprintf(out, "%s:*:%d:101:%s,%s,%s,%s:/mit/%s:%s\n",
-		  name, uid, fullname, oa, op, hp, name, shell);
+	  fprintf(out, "%s:*:%d:101:%s,%s,%s,:/mit/%s:%s\n",
+		  name, uid, fullname, oa, op, name, shell);
 	  break;
 
 	case 'K':
@@ -303,8 +302,8 @@
 	  if (i == 1)
 	    {
 	      EXEC SQL SELECT unix_uid, shell, fullname,
-		office_addr, office_phone, home_phone 
-		INTO :uid, :shell, :fullname, :oa, :op, :hp 
+		office_addr, office_phone
+		INTO :uid, :shell, :fullname, :oa, :op
 		FROM users 
 		WHERE login = :name AND status != 3;	      
 	      if (sqlca.sqlcode)
@@ -314,10 +313,9 @@
 	      strtrim(fullname);
 	      strtrim(op);
 	      strtrim(oa);
-	      strtrim(hp);
 	      
-	      fprintf(out, "%s:*:%d:101:%s,%s,%s,%s:/mit/%s:%s\n",
-		      name, uid, fullname, oa, op, hp, name, shell);
+	      fprintf(out, "%s:*:%d:101:%s,%s,%s,:/mit/%s:%s\n",
+		      name, uid, fullname, oa, op, name, shell);
 	    }
 	  break;
 	}

Modified: trunk/moira/gen/directory.pc
===================================================================
--- trunk/moira/gen/directory.pc	2014-07-07 14:00:06 UTC (rev 4170)
+++ trunk/moira/gen/directory.pc	2014-07-09 19:23:39 UTC (rev 4171)
@@ -34,7 +34,6 @@
   char first_name[USERS_FIRST_SIZE], middle_name[USERS_MIDDLE_SIZE];
   char office_address[USERS_OFFICE_ADDR_SIZE];
   char office_phone[USERS_OFFICE_PHONE_SIZE];
-  char home_address[USERS_HOME_ADDR_SIZE], home_phone[USERS_HOME_PHONE_SIZE];
   char id[USERS_CLEARID_SIZE], type[USERS_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
 
@@ -61,8 +60,7 @@
   EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
 
   EXEC SQL DECLARE x CURSOR FOR SELECT 
-    login, last, first, middle, office_addr, office_phone, 
-    home_addr, home_phone, clearid, type 
+    login, last, first, middle, office_addr, office_phone, clearid, type 
     FROM users WHERE (status = 1 OR status = 10 OR status = 11) AND type != 'SYSTEM' AND type != 'STAFF'
     AND type != 'TEST' AND type != 'REGTEST' AND type != 'SHARED'
     AND type != 'MGMT' AND type != 'DOOMED' AND type NOT LIKE 'GUES%';
@@ -70,8 +68,7 @@
   while (1)
     {
       EXEC SQL FETCH x INTO :login, :last_name, :first_name, :middle_name,
-	:office_address, :office_phone, :home_address, :home_phone,
-	:id, :type;
+	:office_address, :office_phone, :id, :type;
       if (sqlca.sqlcode)
 	break;
       strtrim(login);
@@ -80,8 +77,6 @@
       strtrim(middle_name);
       strtrim(office_address);
       strtrim(office_phone);
-      strtrim(home_address);
-      strtrim(home_phone);
       strtrim(id);
       strtrim(type);
 #ifdef notdef
@@ -91,7 +86,7 @@
 		"Unlisted Account\n", id, last_name, login, last_name,
 		first_name, middle_name, last_name, first_name,
 		middle_name, login, login, office_phone, office_address,
-		home_phone, home_address);
+		"", "");
 #else
       if(isdigit(*id))
 	fprintf(out, "%s^4:p\t24:%s %s\t7:%s, %s %s\t3:%s, %s "

Modified: trunk/moira/gen/hesiod.pc
===================================================================
--- trunk/moira/gen/hesiod.pc	2014-07-07 14:00:06 UTC (rev 4170)
+++ trunk/moira/gen/hesiod.pc	2014-07-09 19:23:39 UTC (rev 4171)
@@ -202,8 +202,7 @@
   EXEC SQL BEGIN DECLARE SECTION;
   char login[USERS_LOGIN_SIZE], shell[USERS_SHELL_SIZE];
   char fullname[USERS_FULLNAME_SIZE], oa[USERS_OFFICE_ADDR_SIZE];
-  char op[USERS_OFFICE_PHONE_SIZE], hp[USERS_HOME_PHONE_SIZE];
-  char potype[USERS_POTYPE_SIZE];
+  char op[USERS_OFFICE_PHONE_SIZE], potype[USERS_POTYPE_SIZE];
   int uid, id, pid, iid, eid, mid, status;
   EXEC SQL END DECLARE SECTION;
 
@@ -239,7 +238,7 @@
   users = create_hash(12001);
   EXEC SQL DECLARE u_cursor CURSOR FOR
     SELECT login, unix_uid, shell, fullname, office_addr,
-    office_phone, home_phone, users_id, potype, pop_id, imap_id, exchange_id,
+    office_phone, users_id, potype, pop_id, imap_id, exchange_id,
     status
     FROM users
     WHERE status = 1 OR status = 2 OR status = 5 OR status = 6 OR status = 10 OR status = 11
@@ -248,14 +247,13 @@
   while (1)
     {
       EXEC SQL FETCH u_cursor INTO :login, :uid, :shell, :fullname,
-	:oa, :op, :hp, :id, :potype, :pid, :iid, :eid, :status;
+	:oa, :op, :id, :potype, :pid, :iid, :eid, :status;
       if (sqlca.sqlcode)
 	break;
       strtrim(login);
       dequote(fullname);
       dequote(oa);
       dequote(op);
-      dequote(hp);
       dequote(shell);
       dequote(potype);
       u = malloc(sizeof(struct user));
@@ -264,9 +262,9 @@
       hash_store(users, id, u);
       if (status == 1 || status == 2 || status == 10 || status == 11)
 	{
-	  fprintf(pout, "%s.passwd\t%s %s \"%s:*:%d:101:%s,%s,%s,%s:/mit/%s:%s\"\n",
+	  fprintf(pout, "%s.passwd\t%s %s \"%s:*:%d:101:%s,%s,%s,:/mit/%s:%s\"\n",
 		  login, HCLASS, HTYPE, login, uid, fullname, oa,
-		  op, hp, login, shell);
+		  op, login, shell);
 	  fprintf(uout, "%d.uid\t%s CNAME %s.passwd\n", uid, HCLASS, login);
 	}
 


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