* query. This is 512 - overhead (~78) [derived empirically]
* (it used to be 446 with older versions of bind)
*/
-#define MAXHESSIZE 434
+#define MAXHESSIZE 256
char hesiod_dir[MAXPATHLEN];
for (sawdot = 1; *name; name++)
{
+ if (*name == '$')
+ return 0;
if (*name == '.')
{
if (sawdot)
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 nn[USERS_NICKNAME_SIZE];
- int uid, id, pid, iid, mid, status;
+ char nn[USERS_NICKNAME_SIZE], potype[USERS_POTYPE_SIZE];
+ int uid, id, pid, iid, eid, mid, status;
EXEC SQL END DECLARE SECTION;
sprintf(poutf, "%s/passwd.db", hesiod_dir);
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, 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;
while (1)
{
EXEC SQL FETCH u_cursor INTO :login, :uid, :shell, :fullname, :nn,
- :oa, :op, :hp, :id, :pid, :iid, :status;
+ :oa, :op, :hp, :id, :potype, :pid, :iid, :eid, :status;
if (sqlca.sqlcode)
break;
strtrim(login);
dequote(op);
dequote(hp);
dequote(shell);
+ dequote(potype);
u = malloc(sizeof(struct user));
strcpy(u->name, login);
u->lists = NULL;
fprintf(uout, "%d.uid\t%s CNAME %s.passwd\n", uid, HCLASS, login);
}
+ if (eid != 0)
+ {
+ /* Check for IMAP. Can't use iid because it should be zero. */
+ EXEC SQL SELECT mach_id INTO :mid FROM filesys
+ WHERE label = :login || '.po' AND type = 'IMAP';
+ if (sqlca.sqlcode == 0)
+ pid = mid;
+ else
+ {
+ /* EXCHANGE user with no IMAP filesystem. Give them
+ * IMAP.EXCHANGE.MIT.EDU instead of 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
pid = mid;
}
- if (pid != 0 && (mach = hash_lookup(machines, pid)))
+ if ((strcmp(potype, "NONE") != 0) && pid != 0 &&
+ (mach = hash_lookup(machines, pid)))
{
fprintf(bout, "%s.pobox\t%s %s \"POP %s %s\"\n",
login, HCLASS, HTYPE, mach, login);