From: zacheiss Date: Tue, 6 Mar 2007 04:09:33 +0000 (+0000) Subject: Don't generate hesiod pobox entries for users with a potype of "NONE". X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/d353b64a87909615e9aa17b5546f25c004104575 Don't generate hesiod pobox entries for users with a potype of "NONE". --- diff --git a/gen/hesiod.pc b/gen/hesiod.pc index ec3cf1fb..b5aa5021 100644 --- a/gen/hesiod.pc +++ b/gen/hesiod.pc @@ -201,7 +201,7 @@ int do_passwd(void) 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]; + char nn[USERS_NICKNAME_SIZE], potype[USERS_POTYPE_SIZE]; int uid, id, pid, iid, mid, status; EXEC SQL END DECLARE SECTION; @@ -237,7 +237,7 @@ 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, pop_id, imap_id, status + office_phone, home_phone, users_id, potype, pop_id, imap_id, status FROM users WHERE status = 1 OR status = 2 OR status = 5 OR status = 6 ORDER BY users_id; @@ -245,7 +245,7 @@ int do_passwd(void) 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, :status; if (sqlca.sqlcode) break; strtrim(login); @@ -255,6 +255,7 @@ int do_passwd(void) dequote(op); dequote(hp); dequote(shell); + dequote(potype); u = malloc(sizeof(struct user)); strcpy(u->name, login); u->lists = NULL; @@ -275,7 +276,8 @@ int do_passwd(void) 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);