From 00fef14dc07c05615bc8cf271643d9a2e94f9681 Mon Sep 17 00:00:00 2001 From: zacheiss Date: Thu, 29 Nov 2007 21:09:01 +0000 Subject: [PATCH] Add expiration date column to users table and client support. --- clients/addusr/addusr.c | 24 +++++++++++--- clients/moira/user.c | 10 ++++-- clients/stanley/stanley.c | 40 ++++++++++++++-------- db/schema.sql | 3 +- include/moira_site.h | 13 ++++---- regtape/common.pc | 4 +-- server/queries2.c | 70 ++++++++++++++++++++------------------- 7 files changed, 100 insertions(+), 64 deletions(-) diff --git a/clients/addusr/addusr.c b/clients/addusr/addusr.c index a0a946bb..8ee440e7 100644 --- a/clients/addusr/addusr.c +++ b/clients/addusr/addusr.c @@ -44,6 +44,7 @@ struct owner_type { /* flags from command line */ char *class, *comment, *status_str, *shell, *winconsoleshell, *filename; +char *expiration; int reg_only, reg, verbose, nodupcheck, securereg, nocaps; struct owner_type *sponsor; @@ -75,6 +76,7 @@ int main(int argc, char **argv) winconsoleshell = DEFAULT_WINCONSOLESHELL; class = "TEMP"; comment = ""; + expiration = ""; status_str = "0"; whoami = argv[0]; @@ -144,6 +146,16 @@ int main(int argc, char **argv) else usage(argv); } + else if (argis("e", "expiration")) + { + if (arg - argv < argc - 1) + { + ++arg; + expiration = *arg; + } + else + usage(argv); + } else if (argis("6", "secure")) securereg++; else if (argis("r", "reg_only")) @@ -205,6 +217,7 @@ int main(int argc, char **argv) qargv[U_WINCONSOLESHELL] = winconsoleshell; qargv[U_WINHOMEDIR] = DEFAULT_WINHOMEDIR; qargv[U_WINPROFILEDIR] = DEFAULT_WINPROFILEDIR; + qargv[U_EXPIRATION] = expiration; qargv[U_STATE] = status_str; qargv[U_CLASS] = class; qargv[U_COMMENT] = comment; @@ -332,13 +345,13 @@ int main(int argc, char **argv) case M_ANY: case M_USER: qargv[U_SPONSOR_TYPE] = "USER"; - status = mr_query("add_user_account", 17, qargv, NULL, NULL); + status = mr_query("add_user_account", 18, qargv, NULL, NULL); if (sponsor->type != M_ANY || status != MR_USER) break; case M_LIST: qargv[U_SPONSOR_TYPE] = "LIST"; - status = mr_query("add_user_account", 17, qargv, NULL, NULL); + status = mr_query("add_user_account", 18, qargv, NULL, NULL); break; case M_KERBEROS: @@ -349,12 +362,12 @@ int main(int argc, char **argv) mrcl_com_err(whoami); if (status == MRCL_REJECT) exit(1); - status = mr_query("add_user_account", 17, qargv, NULL, NULL); + status = mr_query("add_user_account", 18, qargv, NULL, NULL); break; case M_NONE: qargv[U_SPONSOR_TYPE] = "NONE"; - status = mr_query("add_user_account", 17, qargv, NULL, NULL); + status = mr_query("add_user_account", 18, qargv, NULL, NULL); break; } } @@ -363,7 +376,7 @@ int main(int argc, char **argv) qargv[U_SPONSOR_TYPE] = "NONE"; qargv[U_SPONSOR_NAME] = "NONE"; - status = mr_query("add_user_account", 17, qargv, NULL, NULL); + status = mr_query("add_user_account", 18, qargv, NULL, NULL); } if (status) @@ -430,6 +443,7 @@ void usage(char **argv) fprintf(stderr, " -w | -winshell windows console shell (default %s)\n", DEFAULT_WINCONSOLESHELL); fprintf(stderr, " -sp | -sponsor sponsor (default NONE)\n"); + fprintf(stderr, " -e | -expiration \"expiration date\" (default \"\")\n"); fprintf(stderr, " -r | -reg_only\n"); fprintf(stderr, " -R | -register (and add to database)\n"); fprintf(stderr, " -v | -verbose\n"); diff --git a/clients/moira/user.c b/clients/moira/user.c index b1f1ee38..148e8061 100644 --- a/clients/moira/user.c +++ b/clients/moira/user.c @@ -107,7 +107,7 @@ static void PrintUserName(char **info) static void PrintUserInfo(char **info) { - char name[BUFSIZ], buf[BUFSIZ]; + char name[BUFSIZ], buf[BUFSIZ], sponsor[BUFSIZ]; int status; sprintf(name, "%s, %s %s", info[U_LAST], info[U_FIRST], info[U_MIDDLE]); @@ -119,8 +119,8 @@ static void PrintUserInfo(char **info) sprintf(buf, "Class: %-25s Windows Console Shell: %-10s", info[U_CLASS], info[U_WINCONSOLESHELL]); Put_message(buf); - sprintf(buf, "Sponsor: %s %s", info[U_SPONSOR_TYPE], - info[U_SPONSOR_NAME]); + sprintf(sponsor, "%s %s", info[U_SPONSOR_TYPE], info[U_SPONSOR_NAME]); + sprintf(buf, "Sponsor: %-23s Expiration date: %s", sponsor, info[U_EXPIRATION]); Put_message(buf); sprintf(buf, "Account is: %-20s MIT ID number: %s", UserState(atoi(info[U_STATE])), info[U_MITID]); @@ -169,6 +169,7 @@ static char **SetUserDefaults(char **info) info[U_WINPROFILEDIR] = strdup(DEFAULT_WINPROFILEDIR); info[U_SPONSOR_TYPE] = strdup("NONE"); info[U_SPONSOR_NAME] = strdup("NONE"); + info[U_EXPIRATION] = strdup(""); info[U_MODTIME] = info[U_MODBY] = info[U_MODWITH] = info[U_END] = NULL; info[U_CREATED] = info[U_CREATOR] = NULL; return info; @@ -330,6 +331,9 @@ char **AskUserInfo(char **info, Bool name) GetValueFromUser("Sponsor's Name", &info[U_SPONSOR_NAME]) == SUB_ERROR) return NULL; + if (GetValueFromUser("Expiration date", &info[U_EXPIRATION]) == SUB_ERROR) + return NULL; + state = atoi(info[U_STATE]); if (!name || state == 0 || state == 2) { diff --git a/clients/stanley/stanley.c b/clients/stanley/stanley.c index bd70d3aa..bec3006d 100644 --- a/clients/stanley/stanley.c +++ b/clients/stanley/stanley.c @@ -52,7 +52,7 @@ struct string_list *reservation_add_queue, *reservation_remove_queue; char *username, *whoami; char *newlogin, *uid, *shell, *winshell, *last, *first, *middle, *u_status; -char *clearid, *class, *comment, *secure, *winhomedir, *winprofiledir; +char *clearid, *class, *comment, *secure, *winhomedir, *winprofiledir, *expiration; struct owner_type *parse_member(char *s); @@ -102,7 +102,7 @@ int main(int argc, char **argv) list_res_flag = update_res_flag = unformatted_flag = verbose = noauth = 0; newlogin = uid = shell = winshell = last = first = middle = NULL; u_status = clearid = class = comment = secure = NULL; - winhomedir = winprofiledir = NULL; + winhomedir = winprofiledir = expiration = NULL; reservation_add_queue = reservation_remove_queue = NULL; sponsor = NULL; whoami = argv[0]; @@ -250,6 +250,14 @@ int main(int argc, char **argv) } else usage(argv); } + else if (argis("e", "expiration")) { + if (arg - argv < argc - 1) { + arg++; + update_flag++; + expiration = *arg; + } else + usage(argv); + } else if (argis("ar", "addreservation")) { if (arg - argv < argc - 1) { arg++; @@ -369,6 +377,8 @@ int main(int argc, char **argv) argv[U_WINPROFILEDIR] = winprofiledir; else argv[U_WINPROFILEDIR] = "[DFS]"; + if (expiration) + argv[U_EXPIRATION] = expiration; if (sponsor) { argv[U_SPONSOR_NAME] = sponsor->name; @@ -377,13 +387,13 @@ int main(int argc, char **argv) case M_ANY: case M_USER: argv[U_SPONSOR_TYPE] = "USER"; - status = wrap_mr_query("add_user_account", 17, argv, NULL, NULL); + status = wrap_mr_query("add_user_account", 18, argv, NULL, NULL); if (sponsor->type != M_ANY || status != MR_USER) break; case M_LIST: argv[U_SPONSOR_TYPE] = "LIST"; - status = wrap_mr_query("add_user_account", 17, argv, NULL, NULL); + status = wrap_mr_query("add_user_account", 18, argv, NULL, NULL); break; case M_KERBEROS: @@ -394,12 +404,12 @@ int main(int argc, char **argv) mrcl_com_err(whoami); if (status == MRCL_REJECT) exit(1); - status = wrap_mr_query("add_user_account", 17, argv, NULL, NULL); + status = wrap_mr_query("add_user_account", 18, argv, NULL, NULL); break; case M_NONE: argv[U_SPONSOR_TYPE] = "NONE"; - status = wrap_mr_query("add_user_account", 17, argv, NULL, NULL); + status = wrap_mr_query("add_user_account", 18, argv, NULL, NULL); break; } } @@ -408,7 +418,7 @@ int main(int argc, char **argv) argv[U_SPONSOR_TYPE] = "NONE"; argv[U_SPONSOR_NAME] = "NONE"; - status = wrap_mr_query("add_user_account", 17, argv, NULL, NULL); + status = wrap_mr_query("add_user_account", 18, argv, NULL, NULL); } if (status) @@ -450,6 +460,7 @@ int main(int argc, char **argv) argv[15] = old_argv[14]; argv[16] = old_argv[15]; argv[17] = old_argv[16]; + argv[18] = old_argv[17]; argv[0] = username; if (newlogin) @@ -480,6 +491,8 @@ int main(int argc, char **argv) argv[14] = winhomedir; if (winprofiledir) argv[15] = winprofiledir; + if (expiration) + argv[18] = expiration; if (sponsor) { argv[17] = sponsor->name; @@ -488,14 +501,14 @@ int main(int argc, char **argv) case M_ANY: case M_USER: argv[16] = "USER"; - status = wrap_mr_query("update_user_account", 18, argv, NULL, + status = wrap_mr_query("update_user_account", 19, argv, NULL, NULL); if (sponsor->type != M_ANY || status != MR_USER) break; case M_LIST: argv[16] = "LIST"; - status = wrap_mr_query("update_user_account", 18, argv, NULL, + status = wrap_mr_query("update_user_account", 19, argv, NULL, NULL); break; @@ -506,19 +519,19 @@ int main(int argc, char **argv) mrcl_com_err(whoami); if (status == MRCL_REJECT) exit(1); - status = wrap_mr_query("update_user_account", 18, argv, NULL, + status = wrap_mr_query("update_user_account", 19, argv, NULL, NULL); break; case M_NONE: argv[16] = "NONE"; - status = wrap_mr_query("update_user_account", 18, argv, NULL, + status = wrap_mr_query("update_user_account", 19, argv, NULL, NULL); break; } } else - status = wrap_mr_query("update_user_account", 18, argv, NULL, NULL); + status = wrap_mr_query("update_user_account", 19, argv, NULL, NULL); if (status) com_err(whoami, status, "while updating user."); @@ -760,7 +773,7 @@ void show_user_info(char **argv) argv[U_WINCONSOLESHELL]); sprintf(tbuf, "%s %s", argv[U_SPONSOR_TYPE], strcmp(argv[U_SPONSOR_TYPE], "NONE") ? argv[U_SPONSOR_NAME] : ""); - printf("Sponsor: %-25s\n", tbuf); + printf("Sponsor: %-23s Expiration date: %s\n", tbuf, argv[U_EXPIRATION]); printf("Account is: %-20s MIT ID number: %s\n", UserState(atoi(argv[U_STATE])), argv[U_MITID]); printf("Windows Home Directory: %s\n", argv[U_WINHOMEDIR]); @@ -790,6 +803,7 @@ void show_user_info_unformatted(char **argv) sprintf(tbuf, "%s %s", argv[U_SPONSOR_TYPE], strcmp(argv[U_SPONSOR_TYPE], "NONE") ? argv[U_SPONSOR_NAME] : ""); printf("Sponsor: %s\n", tbuf); + printf("Expiration date: %s\n", argv[U_EXPIRATION]); printf("Login shell: %s\n", argv[U_SHELL]); printf("Windows Console Shell: %s\n", argv[U_WINCONSOLESHELL]); printf("Account is: %s\n", UserState(atoi(argv[U_STATE]))); diff --git a/db/schema.sql b/db/schema.sql index 27c02557..6a0926e8 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -52,7 +52,8 @@ create table users winhomedir VARCHAR(260) DEFAULT '[DFS]' NOT NULL, winprofiledir VARCHAR(260) DEFAULT '[DFS]' NOT NULL, sponsor_type VARCHAR(8) DEFAULT 'NONE' NOT NULL, - sponsor_id INTEGER DEFAULT 0 NOT NULL + sponsor_id INTEGER DEFAULT 0 NOT NULL, + expiration VARCHAR(24) DEFAULT CHR(0) NOT NULL ); create table krbmap diff --git a/include/moira_site.h b/include/moira_site.h index e2fa764d..d95c70bb 100644 --- a/include/moira_site.h +++ b/include/moira_site.h @@ -376,12 +376,13 @@ #define U_WINPROFILEDIR 14 #define U_SPONSOR_TYPE 15 #define U_SPONSOR_NAME 16 -#define U_MODTIME 17 -#define U_MODBY 18 -#define U_MODWITH 19 -#define U_CREATED 20 -#define U_CREATOR 21 -#define U_END 22 +#define U_EXPIRATION 17 +#define U_MODTIME 18 +#define U_MODBY 19 +#define U_MODWITH 20 +#define U_CREATED 21 +#define U_CREATOR 22 +#define U_END 23 /* User states (the value of argv[U_STATE] from a user query) */ diff --git a/regtape/common.pc b/regtape/common.pc index 5aef0509..55ee0691 100644 --- a/regtape/common.pc +++ b/regtape/common.pc @@ -290,7 +290,7 @@ void newuser(struct entry *e, int secure) department, home_addr, home_phone, office_addr, office_phone, fmodtime, fmodby, fmodwith, potype, pmodtime, pmodby, pmodwith, xname, xdept, xtitle, xaddress, xphone1, xphone2, xmodtime, secure, - created, creator, winhomedir, winprofiledir, sponsor_type, sponsor_id) + created, creator, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration) VALUES (:login, :users_id, :uid, '/bin/athena/tcsh', 'cmd', NVL(:last, CHR(0)), NVL(:first, CHR(0)), NVL(:middle, CHR(0)), :st, NVL(:id, CHR(0)), NVL(:type, CHR(0)), SYSDATE, :who, :prog, @@ -301,7 +301,7 @@ void newuser(struct entry *e, int secure) NVL(SUBSTR(:name, 0, :xnlen), CHR(0)), NVL(:dept, CHR(0)), NVL(:xtitle, CHR(0)), NVL(:xaddress, CHR(0)), NVL(:xphone1, CHR(0)), NVL(:xphone2, CHR(0)), SYSDATE, :issecure, - SYSDATE, :who, '[DFS]', '[DFS]', 'NONE', 0); + SYSDATE, :who, '[DFS]', '[DFS]', 'NONE', 0, CHR(0)); if (sqlca.sqlcode) { dbmserr("adding user", sqlca.sqlcode); diff --git a/server/queries2.c b/server/queries2.c index 1a26a7bd..5670f867 100644 --- a/server/queries2.c +++ b/server/queries2.c @@ -105,8 +105,8 @@ static char *gual_fields[] = { "login", "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "modtime", - "modby", "modwith", "created", "creator", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", + "modtime", "modby", "modwith", "created", "creator", }; static char *gubl2_fields[] = { @@ -174,8 +174,8 @@ static char *guau_fields[] = { "unix_uid", "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "modtime", - "modby", "modwith", "created", "creator", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", + "modtime", "modby", "modwith", "created", "creator", }; static char *guan2_fields[] = { @@ -204,8 +204,8 @@ static char *guan_fields[] = { "first", "last", "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "modtime", - "modby", "modwith", "created", "creator", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", + "modtime", "modby", "modwith", "created", "creator", }; static struct validate guan2_validate = @@ -260,8 +260,8 @@ static char *guac_fields[] = { "class", "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "modtime", - "modby", "modwith", "created", "creator", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", + "modtime", "modby", "modwith", "created", "creator", }; static char *guam2_fields[] = { @@ -290,8 +290,8 @@ static char *guam_fields[] = { "clearid", "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "modtime", - "modby", "modwith", "created", "creator", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", + "modtime", "modby", "modwith", "created", "creator", }; static char *guas_fields[] = { @@ -439,7 +439,7 @@ static char *auac11_fields[] = { static char *auac_fields[] = { "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", + "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration", }; static struct valobj auac2_valobj[] = { @@ -505,6 +505,7 @@ static struct valobj auac_valobj[] = { {V_LEN, 14, USERS_TABLE, "winprofiledir"}, {V_TYPE, 15, 0, "ace_type", 0, MR_ACE}, {V_TYPEDATA, 16, 0, 0, "list_id", MR_ACE}, + {V_CHAR, 17, USERS_TABLE, "expiration"}, }; static struct validate auac2_validate = { @@ -545,7 +546,7 @@ static struct validate auac11_validate = { static struct validate auac_validate = { auac_valobj, - 16, + 17, "login", "login = '%s'", 1, @@ -593,7 +594,7 @@ static struct validate ausr11_validate = { static struct validate ausr_validate = { auac_valobj, - 14, + 15, "login", "login = '%s'", 1, @@ -647,7 +648,7 @@ static char *uuac_fields[] = { "login", "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", "status", "clearid", "class", "comments", "signature", "secure", - "winhomedir", "winprofiledir, sponsor_type, sponsor_name", + "winhomedir", "winprofiledir, sponsor_type, sponsor_name", "expiration", }; static struct valobj uuac2_valobj[] = { @@ -717,6 +718,7 @@ static struct valobj uuac_valobj[] = { {V_LEN, 15, USERS_TABLE, "winprofiledir"}, {V_TYPE, 16, 0, "ace_type", 0, MR_ACE}, {V_TYPEDATA, 17, 0, 0, "list_id", MR_ACE}, + {V_CHAR, 18, USERS_TABLE, "expiration"}, }; static struct validate uuac2_validate = { @@ -757,7 +759,7 @@ static struct validate uuac11_validate = { static struct validate uuac_validate = { uuac_valobj, - 17, + 18, 0, 0, 0, @@ -805,7 +807,7 @@ static struct validate uusr11_validate = { static struct validate uusr_validate = { uuac_valobj, - 15, + 16, 0, 0, 0, @@ -4078,9 +4080,9 @@ struct query Queries[] = { 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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", + "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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", gual_fields, - 22, + 23, "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", 1, "u.login", @@ -4146,9 +4148,9 @@ struct query Queries[] = { 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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", + "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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", guau_fields, - 22, + 23, "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id", 1, "u.login", @@ -4214,9 +4216,9 @@ struct query Queries[] = { 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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", + "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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", guan_fields, - 22, + 23, "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id", 2, "u.login", @@ -4282,9 +4284,9 @@ struct query Queries[] = { 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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", + "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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", guac_fields, - 22, + 23, "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id", 1, "u.login", @@ -4350,9 +4352,9 @@ struct query Queries[] = { 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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", + "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, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", guam_fields, - 22, + 23, "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", 1, "u.login", @@ -4617,9 +4619,9 @@ struct query Queries[] = { /* 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, winhomedir, winprofiledir, sponsor_type, sponsor_id, users_id, created, creator) 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, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, %s, SYSDATE, %s)", + "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) 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, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)", auac_fields, - 17, + 18, NULL, 0, NULL, @@ -4685,9 +4687,9 @@ struct query Queries[] = { APPEND, "u", USERS_TABLE, - "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, users_id, created, creator) 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, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, %s, SYSDATE, %s)", + "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) 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, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)", auac_fields, - 14, + 15, 0, 0, NULL, @@ -4774,9 +4776,9 @@ struct query Queries[] = { "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, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d", + "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, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0))", uuac_fields, - 17, + 18, "users_id = %d", 1, NULL, @@ -4842,9 +4844,9 @@ struct query Queries[] = { 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', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d ", + "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', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)) ", uuac_fields, - 14, + 15, "users_id = %d", 1, NULL, -- 2.45.1