+static struct valobj uzcl_valobj[] = {
+ {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
+ {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
+ {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
+ {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
+ {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
+ {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
+ {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
+ {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
+ {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
+ {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+ {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+ {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
+};
+
+static struct validate uzcl_validate = {
+ uzcl_valobj,
+ 12,
+ "class",
+ "class = '%s'",
+ 1,
+ 0,
+ access_zephyr,
+ 0,
+ set_zephyr_modtime,
+};
+
+static struct validate dzcl_validate = {
+ 0,
+ 0,
+ "class",
+ "class = '%s'",
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *gsha_fields[] = {
+ "machine",
+ "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
+};
+
+static struct validate gsha_validate =
+{
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ followup_gsha,
+};
+
+static char *asha_fields[] = {
+ "machine", "ace_type", "ace_name",
+};
+
+static struct valobj asha_valobj[] = {
+ {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
+ {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
+};
+
+static struct validate asha_validate =
+{
+ asha_valobj,
+ 3,
+ "mach_id",
+ "mach_id = %d",
+ 1,
+ "mach_id",
+ 0,
+ 0,
+ set_modtime_by_id,
+};
+
+static char *gacl_fields[] = {
+ "machine", "target",
+ "machine", "target", "kind", "list",
+};
+
+static char *aacl_fields[] = {
+ "machine", "target", "kind", "list",
+};
+
+static char *dacl_fields[] = {
+ "machine", "target",
+};
+
+static struct valobj aacl_valobj[] = {
+ {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_CHAR, 1, ACL_TABLE, "target"},
+ {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE},
+ {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST},
+};
+
+static struct validate gacl_validate =
+{
+ aacl_valobj,
+ 1,
+ NULL,
+ NULL,
+ 0,
+ "mach_id",
+ /* access_acl */ 0,
+ 0,
+ 0,
+};
+
+static struct validate aacl_validate =
+{
+ aacl_valobj,
+ 4,
+ "mach_id",
+ "mach_id = %d AND target = '%s'",
+ 2,
+ "mach_id",
+ /* access_acl */ 0,
+ 0,
+ 0,
+};
+
+static char *gsvc_fields[] = {
+ "service", "protocol",
+ "service", "protocol", "port", "description", "modtime", "modby", "modwith",
+};
+
+static char *asvc_fields[] = {
+ "service", "protocol", "port", "description",
+};
+
+static char *dsvc_fields[] = {
+ "service", "protocol",
+};
+
+static struct valobj asvc_valobj[] = {
+ {V_CHAR, 0, SERVICES_TABLE, "name"},
+ {V_CHAR, 1, SERVICES_TABLE, "protocol"},
+ {V_NUM, 2},
+ {V_CHAR, 3, SERVICES_TABLE, "description"},
+};
+
+static struct validate asvc_validate = {
+ asvc_valobj,
+ 4,
+ "name",
+ "name = '%s' AND protocol = '%s'",
+ 2,
+ 0,
+ 0,
+ 0,
+ set_service_modtime,
+};
+
+static struct validate dsvc_validate = {
+ asvc_valobj,
+ 2,
+ "name",
+ "name = '%s' AND protocol = '%s'",
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *gprn_fields[] = {
+ "name",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbd_fields[] = {
+ "duplexname",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbe_fields[] = {
+ "hwaddr",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbh_fields[] = {
+ "hostname",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbr_fields[] = {
+ "rm",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbl_fields[] = {
+ "location",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *gpbc_fields[] = {
+ "contact",
+ "name", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact", "modtime", "modby", "modwith"
+};
+
+static char *aprn_fields[] = {
+ "printer", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact",
+};
+
+static struct valobj aprn_valobj[] = {
+ {V_CHAR, 0, PRINTERS_TABLE, "name"},
+ {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
+ {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
+ {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
+ {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_CHAR, 7, PRINTERS_TABLE, "rp"},
+ {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_NUM, 9},
+ {V_NUM, 10},
+ {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
+ {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
+ {V_NUM, 13},
+ {V_CHAR, 14, PRINTERS_TABLE, "location"},
+ {V_CHAR, 15, PRINTERS_TABLE, "contact"},
+};
+
+static struct validate aprn_validate = {
+ aprn_valobj,
+ 16,
+ "name",
+ "name = '%s'",
+ 1,
+ 0,
+ access_printer,
+ setup_aprn,
+ set_modtime,
+};
+
+static char *uprn_fields[] = {
+ "printer",
+ "printer", "type", "hwtype", "duplexname", "hostname",
+ "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+ "banner", "location", "contact",
+};
+
+static struct valobj uprn_valobj[] = {
+ {V_CHAR, 0, PRINTERS_TABLE, "name"},
+ {V_CHAR, 1, PRINTERS_TABLE, "name"},
+ {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
+ {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
+ {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
+ {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_CHAR, 8, PRINTERS_TABLE, "rp"},
+ {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_NUM, 10},
+ {V_NUM, 11},
+ {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
+ {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST},
+ {V_NUM, 14},
+ {V_CHAR, 15, PRINTERS_TABLE, "location"},
+ {V_CHAR, 16, PRINTERS_TABLE, "contact"},
+};
+
+static struct validate uprn_validate = {
+ uprn_valobj,
+ 16,
+ "name",
+ "name = '%s'",
+ 1,
+ 0,
+ access_printer,
+ setup_aprn,
+ set_modtime,
+};
+
+static struct validate dprn_validate = {
+ 0,
+ 0,
+ "name",
+ "name = '%s'",
+ 1,
+ 0,
+ access_printer,
+ 0,
+ 0,
+};
+
+static char *gpsv_fields[] = {
+ "host",
+ "host", "kind", "printer_types", "owner_type", "owner_name",
+ "lpc_acl", "modtime", "modby", "modwith"
+};
+
+static struct valobj gpsv_valobj[] = {
+ {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+};
+
+static struct validate gpsv_validate = {
+ gpsv_valobj,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ followup_gpsv,
+};
+
+static char *apsv_fields[] = {
+ "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl"
+};
+
+static struct valobj apsv_valobj[] = {
+ {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+ {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE},
+ {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING},
+ {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
+ {V_TYPEDATA, 4, 0, 0, 0, MR_ACE},
+ {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST},
+};
+
+static struct validate apsv_validate = {
+ apsv_valobj,
+ 6,
+ "mach_id",
+ "mach_id = %d",
+ 1,
+ "mach_id",
+ 0,
+ 0,
+ set_modtime_by_id,
+};
+
+static char *dpsv_fields[] = {
+ "host",
+};
+
+static struct validate dpsv_validate = {
+ gpsv_valobj,
+ 1,
+ "mach_id",
+ "mach_id = %d",
+ 1,
+ 0,
+ 0,
+ setup_dpsv,
+ 0,
+};
+
+static char *gali_fields[] = {
+ "name", "type", "trans",
+ "name", "type", "trans",
+};
+
+static char *aali_fields[] = {
+ "name", "type", "trans",
+};
+
+static struct valobj aali_valobj[] = {
+ {V_CHAR, 0, ALIAS_TABLE, "name"},
+ {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
+ {V_CHAR, 2, ALIAS_TABLE, "trans"},
+};
+
+static struct validate aali_validate = {
+ aali_valobj,
+ 3,
+ "trans",
+ "name = '%s' and type = '%s' and trans = '%s'",
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static struct validate dali_validate = /* DELETE_ALIAS */
+{
+ 0,
+ 0,
+ "trans",
+ "name = '%s' and type = '%s' and trans = '%s'",
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *gval_fields[] = {
+ "name", "value",
+};
+
+static struct valobj gval_valobj[] = {
+ {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
+};
+
+static struct validate gval_validate = {
+ gval_valobj,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *aval_fields[] = {
+ "name", "value",
+};
+
+static struct valobj aval_valobj[] = {
+ {V_CHAR, 0, NUMVALUES_TABLE, "name"},
+ {V_NUM, 1},
+};
+
+static struct validate aval_validate = /* for aval, uval, and dval */
+{
+ aval_valobj,
+ 2,
+ "name",
+ "name = '%s'",
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *dval_fields[] = {
+ "name",
+};
+
+static char *gats_fields[] = {
+ "table_name", "appends", "updates", "deletes",
+ "modtime", "modby", "modwith",
+};
+
+static char *_sdl_fields[] = {
+ "level",
+};
+
+static struct validate _sdl_validate =
+{
+ VOnum0,
+ 1,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ _sdl_followup,
+};
+
+static char *gusl_fields[] = {
+ "login", "domain_sid",
+ "login", "sid", "created",
+};
+
+static struct validate gusl_validate =
+{
+ VOuser0,
+ 1,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *glsn_fields[] = {
+ "name", "domain_sid",
+ "name", "sid", "created",
+};
+
+static struct validate glsn_validate =
+{
+ VOlist0,
+ 1,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *ausl_fields[] = {
+ "login", "sid",
+};
+
+static struct validate ausl_validate =
+{
+ VOuser0,
+ 1,
+ "sid",
+ "users_id = %d AND sid = '%s'",
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *alsn_fields[] = {
+ "name", "sid",
+};
+
+static struct validate alsn_validate =
+{
+ VOlist0,
+ 1,
+ "sid",
+ "list_id = %d AND sid = '%s'",
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static char *gdds_fields[] = {
+ "sid",
+};
+
+\f
+/* Generalized Query Definitions */
+
+/* Multiple versions of the same query MUST be listed in ascending
+ * order.
+ */
+
+/* Note: For any query which uses prefetch_value, the vcnt should be
+ * one less than the number of %-format specifiers in the tlist.
+ */
+
+struct query Queries[] = {
+ {
+ /* Q_GALO - GET_ALL_LOGINS, v2 */
+ "get_all_logins",
+ "galo",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
+ galo2_fields,
+ 6,
+ "u.users_id != 0",
+ 0,
+ "u.login",
+ 0,
+ },
+
+ {
+ /* Q_GALO - GET_ALL_LOGINS, v3 */
+ "get_all_logins",
+ "galo",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
+ galo_fields,
+ 7,
+ "u.users_id != 0",
+ 0,
+ "u.login",
+ 0,
+ },
+
+ {
+ /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v2 */
+ "get_all_active_logins",
+ "gaal",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
+ galo2_fields,
+ 6,
+ "u.status = 1",
+ 0,
+ "u.login",
+ 0,
+ },
+
+ {
+ /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v3 */
+ "get_all_active_logins",
+ "gaal",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
+ galo_fields,
+ 7,
+ "u.status = 1",
+ 0,
+ "u.login",
+ 0,
+ },
+
+ {
+ /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v2 */
+ "get_user_account_by_login",
+ "gual",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ gual2_fields,
+ 15,
+ "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &gubl_validate,
+ },
+
+ {
+ /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v3 */
+ "get_user_account_by_login",
+ "gual",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ gual_fields,
+ 16,
+ "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &gubl_validate,
+ },
+
+ {
+ /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v2 */
+ "get_user_account_by_uid",
+ "guau",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guau2_fields,
+ 15,
+ "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &gubu_validate,
+ },
+
+ {
+ /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
+ "get_user_account_by_uid",
+ "guau",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guau_fields,
+ 16,
+ "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &gubu_validate,
+ },
+
+ {
+ /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
+ "get_user_account_by_name",
+ "guan",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guan2_fields,
+ 15,
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
+ 2,
+ "u.login",
+ &guan_validate,
+ },
+
+ {
+ /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
+ "get_user_account_by_name",
+ "guan",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guan_fields,
+ 16,
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
+ 2,
+ "u.login",
+ &guan_validate,
+ },
+
+ {
+ /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v2 */
+ "get_user_account_by_class",
+ "guac",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guac2_fields,
+ 15,
+ "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v3 */
+ "get_user_account_by_class",
+ "guac",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guac_fields,
+ 16,
+ "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */
+ "get_user_account_by_id",
+ "guai",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guam2_fields,
+ 15,
+ "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v3 */
+ "get_user_account_by_id",
+ "guai",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+ guam_fields,
+ 16,
+ "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUBL - GET_USER_BY_LOGIN, v2 */
+ "get_user_by_login",
+ "gubl",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubl2_fields,
+ 12,
+ "u.login LIKE '%s' AND u.users_id != 0",
+ 1,
+ "u.login",
+ &gubl_validate,
+ },
+
+ {
+ /* Q_GUBL - GET_USER_BY_LOGIN, v3 */
+ "get_user_by_login",
+ "gubl",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubl_fields,
+ 13,
+ "u.login LIKE '%s' AND u.users_id != 0",
+ 1,
+ "u.login",
+ &gubl_validate,
+ },
+
+ {
+ /* Q_GUBU - GET_USER_BY_UID, v2 */
+ "get_user_by_uid",
+ "gubu",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubu2_fields,
+ 12,
+ "u.unix_uid = %s AND u.users_id != 0",
+ 1,
+ "u.login",
+ &gubu_validate,
+ },
+
+ {
+ /* Q_GUBU - GET_USER_BY_UID, v3 */
+ "get_user_by_uid",
+ "gubu",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubu_fields,
+ 13,
+ "u.unix_uid = %s AND u.users_id != 0",
+ 1,
+ "u.login",
+ &gubu_validate,
+ },
+
+ {
+ /* Q_GUBN - GET_USER_BY_NAME, v2 */
+ "get_user_by_name",
+ "gubn",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubn2_fields,
+ 12,
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
+ 2,
+ "u.login",
+ &gubn_validate,
+ },
+
+ {
+ /* Q_GUBN - GET_USER_BY_NAME, v3 */
+ "get_user_by_name",
+ "gubn",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubn_fields,
+ 13,
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
+ 2,
+ "u.login",
+ &gubn_validate,
+ },
+
+ {
+ /* Q_GUBC - GET_USER_BY_CLASS, v2 */
+ "get_user_by_class",
+ "gubc",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubc2_fields,
+ 12,
+ "u.type = UPPER('%s') AND u.users_id != 0",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUBC - GET_USER_BY_CLASS, v3 */
+ "get_user_by_class",
+ "gubc",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubc_fields,
+ 13,
+ "u.type = UPPER('%s') AND u.users_id != 0",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUBM - GET_USER_BY_MITID, v2 */
+ "get_user_by_mitid",
+ "gubm",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubm2_fields,
+ 12,
+ "u.clearid LIKE '%s' AND u.users_id != 0",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_GUBM - GET_USER_BY_MITID, v3 */
+ "get_user_by_mitid",
+ "gubm",
+ 3,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+ gubm_fields,
+ 13,
+ "u.clearid LIKE '%s' AND u.users_id != 0",
+ 1,
+ "u.login",
+ &VDfix_modby,
+ },
+
+ {
+ /* Q_AUAC - ADD_USER_ACCOUNT, v2 */ /* uses prefetch_value() for users_id */
+ "add_user_account",
+ "auac",
+ 2,
+ APPEND,
+ "u",
+ USERS_TABLE,
+ /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
+ * but using up one argv element.
+ */
+ "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
+ auac2_fields,
+ 12,
+ NULL,
+ 0,
+ NULL,
+ &auac2_validate,
+ },
+
+ {
+ /* Q_AUAC - ADD_USER_ACCOUNT, v3 */ /* uses prefetch_value() for users_id */
+ "add_user_account",
+ "auac",
+ 3,
+ APPEND,
+ "u",
+ USERS_TABLE,
+ /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
+ * but using up one argv element.
+ */
+ "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
+ auac_fields,
+ 13,
+ NULL,
+ 0,
+ NULL,
+ &auac_validate,
+ },
+
+ {
+ /* Q_AUSR - ADD_USER, v2 */ /* uses prefetch_value() for users_id */
+ "add_user",
+ "ausr",
+ 2,
+ APPEND,
+ "u",
+ USERS_TABLE,
+ "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
+ auac2_fields,
+ 9,
+ 0,
+ 0,
+ NULL,
+ &ausr2_validate,
+ },
+
+ {
+ /* Q_AUSR - ADD_USER, v3 */ /* uses prefetch_value() for users_id */
+ "add_user",
+ "ausr",
+ 3,
+ APPEND,
+ "u",
+ USERS_TABLE,
+ "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
+ auac_fields,
+ 10,
+ 0,
+ 0,
+ NULL,
+ &ausr_validate,
+ },
+
+ {
+ /* Q_RUSR - REGISTER_USER */
+ "register_user",
+ "rusr",
+ 2,
+ APPEND,
+ 0,
+ 0,
+ 0,
+ rusr_fields,
+ 3,
+ 0,
+ 0,
+ NULL,
+ &rusr_validate,
+ },
+
+ {
+ /* Q_UUAC - UPDATE_USER_ACCOUNT, v2 */
+ "update_user_account",
+ "uuac",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ /* See comment in auac about signature. */
+ "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s",
+ uuac2_fields,
+ 12,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uuac2_validate,
+ },
+
+ {
+ /* Q_UUAC - UPDATE_USER_ACCOUNT, v3 */
+ "update_user_account",
+ "uuac",
+ 3,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ /* See comment in auac about signature. */
+ "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s",
+ uuac_fields,
+ 13,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uuac_validate,
+ },
+
+ {
+ /* Q_UUSR - UPDATE_USER, v2 */
+ "update_user",
+ "uusr",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s'",
+ uuac2_fields,
+ 9,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uusr2_validate,
+ },
+
+ {
+ /* Q_UUSR - UPDATE_USER, v3 */
+ "update_user",
+ "uusr",
+ 3,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s'",
+ uuac_fields,
+ 10,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uusr_validate,
+ },
+
+ {
+ /* Q_UUSH - UPDATE_USER_SHELL */
+ "update_user_shell",
+ "uush",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET shell = '%s'",
+ uush_fields,
+ 1,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uush_validate,
+ },
+
+ {
+ /* Q_UUWS - UPDATE_USER_WINDOWS_SHELL */
+ "update_user_windows_shell",
+ "uuws",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET winconsoleshell = '%s'",
+ uuws_fields,
+ 1,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uuws_validate,
+ },
+
+ {
+ /* Q_UUST - UPDATE_USER_STATUS */
+ "update_user_status",
+ "uust",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET status = %s",
+ uust_fields,
+ 1,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uust_validate,
+ },
+
+ {
+ /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
+ "update_user_security_status",
+ "uuss",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET secure = %s",
+ uuss_fields,
+ 1,
+ "users_id = %d",
+ 1,
+ NULL,
+ &uust_validate,
+ },
+
+ {
+ /* Q_DUSR - DELETE_USER */
+ "delete_user",
+ "dusr",
+ 2,
+ DELETE,
+ "u",
+ USERS_TABLE,
+ NULL,
+ dusr_fields,
+ 0,
+ "users_id = %d",
+ 1,
+ NULL,
+ &dusr_validate,
+ },
+
+ {
+ /* Q_AURV - ADD_USER_RESERVATION */
+ "add_user_reservation",
+ "aurv",
+ 2,
+ UPDATE,
+ 0,
+ USERS_TABLE,
+ 0,
+ aurv_fields,
+ 2,
+ 0,
+ 0,
+ NULL,
+ &aurv_validate,
+ },
+
+ {
+ /* Q_GURV - GET_USER_RESERVATIONS */
+ "get_user_reservations",
+ "gurv",
+ 2,
+ RETRIEVE,
+ 0,
+ USERS_TABLE,
+ 0,
+ gurv_fields,
+ 2,
+ 0,
+ 1,
+ NULL,
+ &gurv_validate,
+ },
+
+ {
+ /* Q_GUBR - GET_USER_BY_RESERVATION */
+ "get_user_by_reservation",
+ "gubr",
+ 2,
+ RETRIEVE,
+ 0,
+ USERS_TABLE,
+ 0,
+ gubr_fields,
+ 1,
+ 0,
+ 1,
+ NULL,
+ &gubr_validate,
+ },
+
+ {
+ /* Q_DURV - DELETE_USER_RESERVATION */
+ "delete_user_reservation",
+ "durv",
+ 2,
+ UPDATE,
+ 0,
+ USERS_TABLE,
+ 0,
+ aurv_fields,
+ 2,
+ 0,
+ 0,
+ NULL,
+ &aurv_validate,
+ },
+
+ {
+ /* Q_GKUM - GET_KERBEROS_USER_MAP */
+ "get_kerberos_user_map",
+ "gkum",
+ 2,
+ RETRIEVE,
+ "k",
+ KRBMAP_TABLE,
+ "u.login, str.string FROM krbmap km, users u, strings str",
+ gkum_fields,
+ 2,
+ "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
+ 2,
+ "u.login, str.string",
+ NULL,
+ },
+
+ {
+ /* Q_AKUM - ADD_KERBEROS_USER_MAP */
+ "add_kerberos_user_map",
+ "akum",
+ 2,
+ APPEND,
+ "k",
+ KRBMAP_TABLE,
+ "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
+ akum_fields,
+ 2,
+ 0,
+ 0,
+ NULL,
+ &akum_validate,
+ },
+
+ {
+ /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
+ "delete_kerberos_user_map",
+ "dkum",
+ 2,
+ DELETE,
+ "k",
+ KRBMAP_TABLE,
+ 0,
+ akum_fields,
+ 0,
+ "users_id = %d AND string_id = %d",
+ 2,
+ NULL,
+ &dkum_validate,
+ },
+
+ {
+ /* Q_GFBL - GET_FINGER_BY_LOGIN */
+ "get_finger_by_login",
+ "gfbl",
+ 2,
+ RETRIEVE,
+ "u",
+ USERS_TABLE,
+ "login, fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, TO_CHAR(fmodtime, 'DD-mon-YYYY HH24:MI:SS'), fmodby, fmodwith FROM users",
+ gfbl_fields,
+ 12,
+ "users_id = %d",
+ 1,
+ "login",
+ &gfbl_validate,
+ },
+
+ {
+ /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
+ "update_finger_by_login",
+ "ufbl",
+ 2,
+ UPDATE,
+ "u",
+ USERS_TABLE,
+ "users SET fullname= NVL('%s', CHR(0)), nickname= NVL('%s', CHR(0)), home_addr= NVL('%s', CHR(0)), home_phone= NVL('%s', CHR(0)), office_addr= NVL('%s', CHR(0)), office_phone= NVL('%s', CHR(0)), department= NVL('%s', CHR(0)), affiliation= NVL('%s', CHR(0))",
+ ufbl_fields,
+ 8,
+ "users_id = %d",
+ 1,
+ NULL,
+ &ufbl_validate,