]> andersk Git - moira.git/commitdiff
First cut at support for winhomedir and winprofiledir support.
authorzacheiss <zacheiss>
Wed, 14 May 2003 13:07:34 +0000 (13:07 +0000)
committerzacheiss <zacheiss>
Wed, 14 May 2003 13:07:34 +0000 (13:07 +0000)
clients/moira/defs.h
clients/moira/user.c
clients/stanley/stanley.c
db/schema.sql
include/moira_site.h
regtape/common.pc
server/increment.pc
server/qsetup.pc
server/queries2.c

index 1bbd38a659ef4e971d639b6b9e02a0785980e17d..cb77700242e8457882eccb01c07e2e9ff507f5bc 100644 (file)
@@ -50,7 +50,7 @@ typedef int Bool;
 
 /* What version of the queries are we asking for? */
 
-#define QUERY_VERSION 10
+#define QUERY_VERSION 11
 
 /* This is unimplemented in the menu stuff, but would be nice. */
 
index 02a7b9b51b6324b27685250384f20d957c99e095..a18948e4f21013a04fda5278b909d390688eedfa 100644 (file)
@@ -47,6 +47,8 @@ struct mqelem *GetUserInfo(int type, char *name1, char *name2);
 #define DEFAULT_CLASS "?"
 
 #define DEFAULT_WINCONSOLESHELL "cmd"
+#define DEFAULT_WINHOMEDIR "[AFS]"
+#define DEFAULT_WINPROFILEDIR "[AFS]"
 
 /*     Function Name: UserState
  *     Description: Convert a numeric state into a descriptive string.
@@ -118,6 +120,10 @@ static void PrintUserInfo(char **info)
   sprintf(buf, "Account is: %-20s MIT ID number: %s",
          UserState(atoi(info[U_STATE])), info[U_MITID]);
   Put_message(buf);
+  sprintf(buf, "Windows Home Directory: %s", info[U_WINHOMEDIR]);
+  Put_message(buf);
+  sprintf(buf, "Windows Profile Directory: %s", info[U_WINPROFILEDIR]);
+  Put_message(buf);
   status = atoi(info[U_STATE]);
   if (status == 0 || status == 2)
     {
@@ -154,6 +160,8 @@ static char **SetUserDefaults(char **info)
   info[U_COMMENT] = strdup("");
   info[U_SIGNATURE] = strdup("");
   info[U_SECURE] = strdup("0");
+  info[U_WINHOMEDIR] = strdup(DEFAULT_WINHOMEDIR);
+  info[U_WINPROFILEDIR] = strdup(DEFAULT_WINPROFILEDIR);
   info[U_MODTIME] = info[U_MODBY] = info[U_MODWITH] = info[U_END] = NULL;
   info[U_CREATED] = info[U_CREATOR] = NULL;
   return info;
@@ -300,6 +308,14 @@ char **AskUserInfo(char **info, Bool name)
   if (GetValueFromUser("Comments", &info[U_COMMENT]) == SUB_ERROR)
     return NULL;
 
+  if (GetValueFromUser("Windows Home Directory", &info[U_WINHOMEDIR]) ==
+      SUB_ERROR)
+    return NULL;
+
+  if (GetValueFromUser("Windows Profile Directory", &info[U_WINPROFILEDIR]) ==
+      SUB_ERROR)
+    return NULL;
+
   state = atoi(info[U_STATE]);
   if (!name || state == 0 || state == 2)
     {
index 7cb568117aa031a301d002b89088c8e7fa86a8ea..869a5e27490a4c7be26b9d504a997b26182a3a2d 100644 (file)
@@ -40,7 +40,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;
+char *clearid, *class, *comment, *secure, *winhomedir, *winprofiledir;
 
 static char *states[] = {
   "Registerable (0)",
@@ -88,6 +88,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;
   reservation_add_queue = reservation_remove_queue = NULL;
   whoami = argv[0];
 
@@ -210,6 +211,22 @@ int main(int argc, char **argv)
            } else
              usage(argv);
          }
+         else if (argis("wh", "winhomedir")) {
+           if (arg - argv < argc - 1) {
+             arg++;
+             update_flag++;
+             winhomedir = *arg;
+           } else
+             usage(argv);
+         }
+         else if (argis("wp", "winprofiledir")) {
+           if (arg - argv < argc - 1) {
+             arg++;
+             update_flag++;
+             winprofiledir = *arg;
+           } else
+             usage(argv);
+         }
          else if (argis("ar", "addreservation")) {
            if (arg - argv < argc - 1) {
              arg++;
@@ -264,7 +281,7 @@ int main(int argc, char **argv)
   }
 
   /* fire up Moira */
-  status = mrcl_connect(server, "stanley", 8, !noauth);
+  status = mrcl_connect(server, "stanley", 11, !noauth);
   if (status == MRCL_AUTH_ERROR)
     {
       com_err(whoami, 0, "Try the -noauth flag if you don't "
@@ -321,8 +338,16 @@ int main(int argc, char **argv)
        argv[U_SECURE] = secure;
       else
        argv[U_SECURE] = "0";
+      if (winhomedir)
+       argv[U_WINHOMEDIR] = winhomedir;
+      else
+       argv[U_WINHOMEDIR] = "[AFS]";
+      if (winprofiledir)
+       argv[U_WINPROFILEDIR] = winprofiledir;
+      else
+       argv[U_WINPROFILEDIR] = "[AFS]";
 
-      status = wrap_mr_query("add_user_account", 13, argv, NULL, NULL);
+      status = wrap_mr_query("add_user_account", 15, argv, NULL, NULL);
       if (status)
        {
          com_err(whoami, status, "while adding user account.");
@@ -358,6 +383,8 @@ int main(int argc, char **argv)
       argv[11] = old_argv[10];
       argv[12] = old_argv[11];
       argv[13] = old_argv[12];
+      argv[14] = old_argv[13];
+      argv[15] = old_argv[14];
       
       argv[0] = username;
       if (newlogin)
@@ -384,8 +411,12 @@ int main(int argc, char **argv)
        argv[11] = comment;
       if (secure)
        argv[13] = secure;
+      if (winhomedir)
+       argv[14] = winhomedir;
+      if (winprofiledir)
+       argv[15] = winprofiledir;
 
-      status = wrap_mr_query("update_user_account", 14, argv, NULL, NULL);
+      status = wrap_mr_query("update_user_account", 16, argv, NULL, NULL);
 
       if (status)
        com_err(whoami, status, "while updating user.");
@@ -627,6 +658,8 @@ void show_user_info(char **argv)
         argv[U_WINCONSOLESHELL]);
   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]);
+  printf("Windows Profile Directory: %s\n", argv[U_WINPROFILEDIR]);
   status = atoi(argv[U_STATE]);
   if (status == 0 || status == 2)
     {
@@ -643,25 +676,27 @@ void show_user_info_unformatted(char **argv)
 {
   int status;
 
-  printf("Login name:            %s\n", argv[U_NAME]);
-  printf("Full name:             %s, %s %s\n", argv[U_LAST], argv[U_FIRST], 
+  printf("Login name:                %s\n", argv[U_NAME]);
+  printf("Full name:                 %s, %s %s\n", argv[U_LAST], argv[U_FIRST],
         argv[U_MIDDLE]);
-  printf("User id:               %s\n", argv[U_UID]);
-  printf("Class:                 %s\n", argv[U_CLASS]);
-  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])));
-  printf("MIT ID number:         %s\n", argv[U_MITID]);
+  printf("User id:                   %s\n", argv[U_UID]);
+  printf("Class:                     %s\n", argv[U_CLASS]);
+  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])));
+  printf("MIT ID number:             %s\n", argv[U_MITID]);
+  printf("Windows Home Directory:    %s\n", argv[U_WINHOMEDIR]);
+  printf("Windows Profile Directory: %s\n", argv[U_WINPROFILEDIR]);
   status = atoi(argv[U_STATE]);
   if (status == 0 || status == 2)
-    printf("Secure:                %s secure Account Coupon to register\n",
+    printf("Secure:                  %s secure Account Coupon to register\n",
           atoi(argv[U_SECURE]) ? "Needs" : "Does not need");
-  printf("Comments:              %s\n", argv[U_COMMENT]);
-  printf("Created by:            %s\n", argv[U_CREATOR]);
-  printf("Created on:            %s\n", argv[U_CREATED]);
-  printf("Last mod by:           %s\n", argv[U_MODBY]);
-  printf("Last mod on:           %s\n", argv[U_MODTIME]);
-  printf("Last mod with:         %s\n", argv[U_MODWITH]);
+  printf("Comments:                  %s\n", argv[U_COMMENT]);
+  printf("Created by:                %s\n", argv[U_CREATOR]);
+  printf("Created on:                %s\n", argv[U_CREATED]);
+  printf("Last mod by:               %s\n", argv[U_MODBY]);
+  printf("Last mod on:               %s\n", argv[U_MODTIME]);
+  printf("Last mod with:             %s\n", argv[U_MODWITH]);
 }
 
 void usage(char **argv)
@@ -688,6 +723,8 @@ void usage(char **argv)
          "-lr  | -listreservation");
   fprintf(stderr, USAGE_OPTIONS_FORMAT, "-ar  | -addreservation reservation",
          "-dr  | -deletereservation reservation");
+  fprintf(stderr, USAGE_OPTIONS_FORMAT, "-wh  | -winhomedir winhomedir",
+         "-wp  | -winprofiledir winprofiledir");
   fprintf(stderr, USAGE_OPTIONS_FORMAT, "-u   | -unformatted",
          "-n   | -noauth");
   fprintf(stderr, USAGE_OPTIONS_FORMAT, "-v   | -verbose",
index afaf054d24267d23f317797b75697c9cef48070a..97d90aee9f84ec080fa2a2f4260b252ba332aac8 100644 (file)
@@ -48,7 +48,9 @@ create table users
        reservations    VARCHAR(10)     DEFAULT CHR(0)  NOT NULL,
        flag            INTEGER         DEFAULT 0       NOT NULL,
        created         DATE            DEFAULT SYSDATE NOT NULL,
-       creator         INTEGER         DEFAULT 0       NOT NULL
+       creator         INTEGER         DEFAULT 0       NOT NULL,
+       winhomedir      VARCHAR(64)     DEFAULT '[AFS]' NOT NULL,
+       winprofiledir   VARCHAR(64)     DEFAULT '[AFS]' NOT NULL,
 );
 
 create table krbmap
index 8ef63312c866583a34bbacee497b824d69ab0529..17232739f3193c311604b3651cdbe6c0a80be604 100644 (file)
 #define SNET_STATUS_PRIVATE_1000MBPS 7
 #define SNET_STATUS_RESNET_FSILG     8
 
-/* User Information queries, v3 */
+/* User Information queries, v11 */
 
 #define U_NAME    0
 #define U_UID     1
 #define U_COMMENT 10
 #define U_SIGNATURE 11
 #define U_SECURE  12
-#define U_MODTIME 13
-#define U_MODBY   14
-#define U_MODWITH 15
-#define U_CREATED 16
-#define U_CREATOR 17
-#define U_END     18
+#define U_WINHOMEDIR 13
+#define U_WINPROFILEDIR 14
+#define U_MODTIME 15
+#define U_MODBY   16
+#define U_MODWITH 17
+#define U_CREATED 18
+#define U_CREATOR 19
+#define U_END     20
 
 /* User states (the value of argv[U_STATE] from a user query) */
 
index 7b259faf87593b7de6f278918cf15f216a85844c..db64d72c29e5defb3025304a8674d8b3e8662423 100644 (file)
@@ -281,7 +281,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)
+     created, creator, winhomedir, winprofiledir)
     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,
@@ -292,7 +292,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);
+           SYSDATE, :who, '[AFS]', '[AFS]');
   if (sqlca.sqlcode)
     {
       dbmserr("adding user", sqlca.sqlcode);
index cf30ddda24ee210337c4e2dbea2fc21ba20d42af..225648ecc2fe4e8470ee0e59d35047ec596514f6 100644 (file)
@@ -96,9 +96,10 @@ void incremental_before(enum tables table, char *qual, char **argv)
     case USERS_TABLE:
       sprintf(stmt_buf, "SELECT u.login, u.unix_uid, u.shell, "
              "u.winconsoleshell, u.last, u.first, u.middle, u.status, "
-             "u.clearid, u.type, u.users_id FROM users u WHERE %s", qual);
+             "u.clearid, u.type, u.users_id, u.winhomedir, u.winprofiledir "
+             "FROM users u WHERE %s", qual);
       dosql(before);
-      beforec = 11;
+      beforec = 13;
       break;
     case MACHINE_TABLE:
       sprintf(stmt_buf, "SELECT m.name, m.vendor, m.mach_id FROM machine m "
@@ -279,9 +280,10 @@ void incremental_after(enum tables table, char *qual, char **argv)
     case USERS_TABLE:
       sprintf(stmt_buf, "SELECT u.login, u.unix_uid, u.shell, "
              "u.winconsoleshell, u.last, u.first, u.middle, u.status, "
-             "u.clearid, u.type, u.users_id FROM users u WHERE %s", qual);
+             "u.clearid, u.type, u.users_id, u.winhomedir, u.winprofiledir "
+             "FROM users u WHERE %s", qual);
       dosql(after);
-      afterc = 11;
+      afterc = 13;
       break;
     case MACHINE_TABLE:
       sprintf(stmt_buf, "SELECT m.name, m.vendor, m.mach_id FROM machine m "
index b832e8cbe19f5b495e963834c83b0c6207cd3f1c..c0c75e9c18f4cc9aeb37d931aa27011fe7b7c0c7 100644 (file)
@@ -76,6 +76,30 @@ int setup_ausr(struct query *q, char *argv[], client *cl)
        return MR_ARG_TOO_LONG;
     }
 
+  if (q->version > 10)
+    {
+      /* For both winhomedir and winprofiledir, we allow values of the
+       * following forms:
+       *
+       * [AFS] - Magic token for AFS home directory.
+       * [LOCAL] - Magic token for AD default local values, i.e. C:\<mumble>
+       * UNC pathname - \\<something>
+       * local pathname - <drive letter>:<something>
+       */
+
+      if ((strcasecmp(argv[row + 12], "[AFS]")) &&
+         (strcasecmp(argv[row + 12], "[LOCAL]")) &&
+         (!(argv[row + 12][0] == '\\' && argv[row + 12][1] == '\\')) &&
+         (!(isalpha(*argv[row + 12]) && (argv[row + 12][1] == ':'))))
+       return MR_BAD_CHAR;
+      
+      if ((strcasecmp(argv[row + 13], "[AFS]")) &&
+         (strcasecmp(argv[row + 13], "[LOCAL]")) &&
+         (!(argv[row + 13][0] == '\\' && argv[row + 13][1] == '\\')) &&
+         (!(isalpha(*argv[row + 13]) && (argv[row + 13][1] == ':'))))
+       return MR_BAD_CHAR;
+    }
+
   if (!strcmp(argv[row], UNIQUE_UID) || atoi(argv[row]) == -1)
     {
       if ((err = set_next_object_id("unix_uid", USERS_TABLE, 1)))
index 634a401ee4059f7bb13d174f455c685a7dbb82b1..821a7e11a6788dbe029987d60c93760c5da218dd 100644 (file)
@@ -86,11 +86,19 @@ static char *gual2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
+static char *gual3_fields[] = {
+  "login",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure", "modtime",
+  "modby", "modwith", "created", "creator",
+};
+
 static char *gual_fields[] = {
   "login",
-  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith", "created", "creator",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
 };
 
 static char *gubl2_fields[] = {
@@ -139,13 +147,21 @@ static char *guau2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guau_fields[] = {
+static char *guau3_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
   "modtime", "modby", "modwith", "created", "creator",
 };
 
+static char *guau_fields[] = {
+  "unix_uid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure", 
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
 static char *guan2_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -153,13 +169,21 @@ static char *guan2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guan_fields[] = {
+static char *guan3_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
   "modtime", "modby", "modwith", "created", "creator",
 };
 
+static char *guan_fields[] = {
+  "first", "last",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
 static struct validate guan2_validate =
 {
   0,
@@ -193,13 +217,21 @@ static char *guac2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guac_fields[] = {
+static char *guac3_fields[] = {
   "class",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
   "modtime", "modby", "modwith", "created", "creator",
 };
 
+static char *guac_fields[] = {
+  "class",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
 static char *guam2_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -207,13 +239,21 @@ static char *guam2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guam_fields[] = {
+static char *guam3_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
   "modtime", "modby", "modwith", "created", "creator", 
 };
 
+static char *guam_fields[] = {
+  "clearid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator", 
+};
+
 static char *gubu2_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -323,11 +363,17 @@ static char *auac2_fields[] = {
   "clearid", "class", "comments", "signature", "secure",
 };
 
-static char *auac_fields[] = {
+static char *auac3_fields[] = {
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "comments", "signature", "secure",
 };
 
+static char *auac_fields[] = {
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir",
+};
+
 static struct valobj auac2_valobj[] = {
   {V_CHAR, 0, USERS_TABLE, "login"},
   {V_NUM, 1},
@@ -342,6 +388,21 @@ static struct valobj auac2_valobj[] = {
   {V_NUM, 11},
 };
 
+static struct valobj auac3_valobj[] = {
+  {V_CHAR, 0, USERS_TABLE, "login"},
+  {V_NUM, 1},
+  {V_CHAR, 2, USERS_TABLE, "shell"},
+  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 4, USERS_TABLE, "last"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "middle"},
+  {V_NUM, 7},
+  {V_CHAR, 8, USERS_TABLE, "clearid"},
+  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 12},
+};
+
 static struct valobj auac_valobj[] = {
   {V_CHAR, 0, USERS_TABLE, "login"},
   {V_NUM, 1},
@@ -355,6 +416,8 @@ static struct valobj auac_valobj[] = {
   {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
   {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
   {V_NUM, 12},
+  {V_LEN, 13, USERS_TABLE, "winhomedir"},
+  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
 };
 
 static struct validate auac2_validate = {
@@ -369,9 +432,21 @@ static struct validate auac2_validate = {
   followup_ausr,
 };
 
+static struct validate auac3_validate = {
+  auac3_valobj,
+  12,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
 static struct validate auac_validate = {
   auac_valobj,
-  12,
+  14,
   "login",
   "login = '%s'",
   1,
@@ -393,9 +468,21 @@ static struct validate ausr2_validate = {
   followup_ausr,
 };
 
+static struct validate ausr3_validate = {
+  auac3_valobj,
+  10,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
 static struct validate ausr_validate = {
   auac_valobj,
-  10,
+  12,
   "login",
   "login = '%s'",
   1,
@@ -432,12 +519,19 @@ static char *uuac2_fields[] = {
   "clearid", "class", "comments", "signature", "secure",
 };
 
-static char *uuac_fields[] = {
+static char *uuac3_fields[] = {
   "login",
   "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "comments", "signature", "secure",
 };
 
+static char *uuac_fields[] = {
+  "login",
+  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
+  "middle", "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir",
+};
+
 static struct valobj uuac2_valobj[] = {
   {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
   {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
@@ -453,6 +547,22 @@ static struct valobj uuac2_valobj[] = {
   {V_NUM, 12},
 };
   
+static struct valobj uuac3_valobj[] = {
+  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
+  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_CHAR, 3, USERS_TABLE, "shell"},
+  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "last"},
+  {V_CHAR, 7, USERS_TABLE, "middle"},
+  {V_NUM, 8},
+  {V_CHAR, 9, USERS_TABLE, "clearid"},
+  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 13},
+};
+
 static struct valobj uuac_valobj[] = {
   {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
   {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
@@ -467,6 +577,8 @@ static struct valobj uuac_valobj[] = {
   {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
   {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
   {V_NUM, 13},
+  {V_LEN, 14, USERS_TABLE, "winhomedir"},
+  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
 };
 
 static struct validate uuac2_validate = {
@@ -481,9 +593,21 @@ static struct validate uuac2_validate = {
   set_modtime_by_id,
 };
 
+static struct validate uuac3_validate = {
+  uuac3_valobj,
+  13,
+  0,
+  0,
+  0,
+  "users_id",
+  0,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
 static struct validate uuac_validate = {
   uuac_valobj,
-  13,
+  15,
   0,
   0,
   0,
@@ -505,9 +629,21 @@ static struct validate uusr2_validate = {
   set_modtime_by_id,
 };
 
+static struct validate uusr3_validate = {
+  uuac3_valobj,
+  11,
+  0,
+  0,
+  0,
+  "users_id",
+  0,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
 static struct validate uusr_validate = {
   uuac_valobj,
-  11,
+  13,
   0,
   0,
   0,
@@ -3803,7 +3939,7 @@ struct query Queries[] = {
     "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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
-    gual_fields,
+    gual3_fields,
     18,
     "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
@@ -3811,6 +3947,23 @@ struct query Queries[] = {
     &gubl_validate,
   },
 
+  {
+    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v11 */
+    "get_user_account_by_login",
+    "gual",
+    11,
+    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, 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,
+    20,
+    "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",
@@ -3837,7 +3990,7 @@ struct query Queries[] = {
     "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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
-    guau_fields,
+    guau3_fields,
     18,
     "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
     1,
@@ -3845,6 +3998,23 @@ struct query Queries[] = {
     &gubu_validate,
   },
 
+  {
+    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v11 */
+    "get_user_account_by_uid",
+    "guau",
+    11,
+    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, 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,
+    20,
+    "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",
@@ -3871,7 +4041,7 @@ struct query Queries[] = {
     "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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
-    guan_fields,
+    guan3_fields,
     18,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
     2,
@@ -3879,6 +4049,23 @@ struct query Queries[] = {
     &guan_validate,
   },
 
+  {
+    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v11 */
+    "get_user_account_by_name",
+    "guan",
+    11,
+    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, 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,
+    20,
+    "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",
@@ -3905,7 +4092,7 @@ struct query Queries[] = {
     "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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
-    guac_fields,
+    guac3_fields,
     18,
     "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
     1,
@@ -3913,6 +4100,23 @@ struct query Queries[] = {
     &guan_validate,
   },
 
+  {
+    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v11 */
+    "get_user_account_by_class",
+    "guac",
+    11,
+    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, 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,
+    20,
+    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
   {
     /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */
     "get_user_account_by_id",
@@ -3947,6 +4151,23 @@ struct query Queries[] = {
     &guan_validate,
   },
 
+  {
+    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v11 */
+    "get_user_account_by_id",
+    "guai",
+    11,
+    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, 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,
+    20,
+    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
   {
     /* Q_GUBL - GET_USER_BY_LOGIN, v2 */
     "get_user_by_login",
@@ -4149,11 +4370,31 @@ struct query Queries[] = {
      * but using up one argv element.
      */
     "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, 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, %s, SYSDATE, %s)",
-    auac_fields,
+    auac3_fields,
     13,
     NULL,
     0,
     NULL,
+    &auac3_validate,
+  },
+
+  {
+    /* Q_AUAC - ADD_USER_ACCOUNT, v11 */  /* uses prefetch_value() for users_id */
+    "add_user_account",
+    "auac",
+    11,
+    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, winhomedir, winprofiledir, 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, SYSDATE, %s)",
+    auac_fields,
+    15,
+    NULL,
+    0,
+    NULL,
     &auac_validate,
   },
 
@@ -4183,11 +4424,28 @@ struct query Queries[] = {
     "u",
     USERS_TABLE,
     "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, 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, %s, SYSDATE, %s)",
-    auac_fields,
+    auac3_fields,
     10,
     0,
     0,
     NULL,
+    &ausr3_validate,
+  },
+
+  {
+    /* Q_AUSR - ADD_USER, v11 */  /* uses prefetch_value() for users_id */
+    "add_user",
+    "ausr",
+    11,
+    APPEND,
+    "u",
+    USERS_TABLE,
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, 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, SYSDATE, %s)",
+    auac_fields,
+    12,
+    0,
+    0,
+    NULL,
     &ausr_validate,
   },
 
@@ -4236,11 +4494,29 @@ struct query Queries[] = {
     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,
+    uuac3_fields,
     13,
     "users_id = %d",
     1,
     NULL,
+    &uuac3_validate,
+  },
+
+  {
+    /* Q_UUAC - UPDATE_USER_ACCOUNT, v11 */
+    "update_user_account",
+    "uuac",
+    11,
+    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, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0))",
+    uuac_fields,
+    15,
+    "users_id = %d",
+    1,
+    NULL,
     &uuac_validate,
   },
 
@@ -4270,11 +4546,28 @@ struct query Queries[] = {
     "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,
+    uuac3_fields,
     10,
     "users_id = %d",
     1,
     NULL,
+    &uusr3_validate,
+  },
+
+  {
+    /* Q_UUSR - UPDATE_USER, v11 */
+    "update_user",
+    "uusr",
+    11,
+    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)) ",
+    uuac_fields,
+    12,
+    "users_id = %d",
+    1,
+    NULL,
     &uusr_validate,
   },
 
This page took 0.410655 seconds and 5 git commands to generate.