]> andersk Git - moira.git/blobdiff - gen/hesiod.pc
EXCHANGE changes.
[moira.git] / gen / hesiod.pc
index 2b490daf9e21f180ad0e1eb1f90f0e715d0f7771..c07fa43ff1341698880d95797390a4f691735669 100644 (file)
@@ -176,6 +176,8 @@ int valid(char *name)
 
   for (sawdot = 1; *name; name++)
     {
+      if (*name == '$')
+       return 0;
       if (*name == '.')
        {
          if (sawdot)
@@ -202,7 +204,7 @@ int do_passwd(void)
   char fullname[USERS_FULLNAME_SIZE], oa[USERS_OFFICE_ADDR_SIZE];
   char op[USERS_OFFICE_PHONE_SIZE], hp[USERS_HOME_PHONE_SIZE];
   char nn[USERS_NICKNAME_SIZE], potype[USERS_POTYPE_SIZE];
-  int uid, id, pid, iid, mid, status;
+  int uid, id, pid, iid, eid, mid, status;
   EXEC SQL END DECLARE SECTION;
 
   sprintf(poutf, "%s/passwd.db", hesiod_dir);
@@ -237,7 +239,8 @@ int do_passwd(void)
   users = create_hash(12001);
   EXEC SQL DECLARE u_cursor CURSOR FOR
     SELECT login, unix_uid, shell, fullname, nickname, office_addr,
-    office_phone, home_phone, users_id, potype, pop_id, imap_id, status
+    office_phone, home_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
     ORDER BY users_id;
@@ -245,7 +248,7 @@ int do_passwd(void)
   while (1)
     {
       EXEC SQL FETCH u_cursor INTO :login, :uid, :shell, :fullname, :nn,
-       :oa, :op, :hp, :id, :potype, :pid, :iid, :status;
+       :oa, :op, :hp, :id, :potype, :pid, :iid, :eid, :status;
       if (sqlca.sqlcode)
        break;
       strtrim(login);
@@ -268,6 +271,17 @@ int do_passwd(void)
          fprintf(uout, "%d.uid\t%s CNAME %s.passwd\n", uid, HCLASS, login);
        }
 
+      if (eid != 0)
+       {
+         /* eid will be for EXCHANGE.MIT.EDU, but we need to convert it to
+          * IMAP.EXCHANGE.MIT.EDU.
+          */
+         EXEC SQL SELECT mach_id INTO :eid FROM machine WHERE
+           name = 'IMAP.EXCHANGE.MIT.EDU';
+         if (sqlca.sqlcode == 0)
+             pid = eid;
+       }
+
       if (iid != 0)
        {
          EXEC SQL SELECT mach_id INTO :mid FROM filesys
This page took 0.031482 seconds and 4 git commands to generate.