]> andersk Git - moira.git/commitdiff
nuke `delete_user_by_uid' since it's never been used in all of the logs
authordanw <danw>
Fri, 20 Mar 1998 18:33:54 +0000 (18:33 +0000)
committerdanw <danw>
Fri, 20 Mar 1998 18:33:54 +0000 (18:33 +0000)
that we have, and it requires special hacks in qvalidate.
(also, fix a bug in rusr's valobj)

server/queries2.c
server/qvalidate.pc

index 30d7869a4ed562862d369c3f5038d1d272bbff3f..fb4025c65e33db923c4ea3ffd623ec1aaa7870d2 100644 (file)
@@ -250,7 +250,7 @@ static char *rusr_fields[] = {
 
 static struct valobj rusr_valobj[] = {
   {V_NUM, 0},
-  {V_CHAR, 1},
+  {V_CHAR, 1, USERS_TABLE, "login"},
   {V_NUM, 2},
 };
 
@@ -394,26 +394,6 @@ static struct validate dusr_validate = {
   0,
 };
 
-static char *dubu_fields[] = {
-  "unix_uid",
-};
-
-static struct valobj dubu_valobj[] = {
-  {V_ID, 0, USERS_TABLE, "unix_uid", "users_id", MR_USER}
-};
-
-static struct validate dubu_validate = {
-  dubu_valobj,
-  1,
-  0,
-  0,
-  0,
-  0,
-  0,
-  setup_dusr,
-  0,
-};
-
 static char *gkum_fields[] = { "login", "kerberos",
                                   "login", "kerberos" };
 
@@ -2656,22 +2636,6 @@ struct query Queries2[] = {
     &dusr_validate,
   },
 
-  {
-    /* Q_DUBU - DELETE_USER_BY_UID */
-    "delete_user_by_uid",
-    "dubu",
-    DELETE,
-    "u",
-    USERS_TABLE,
-    NULL,
-    dubu_fields,
-    0,
-    "users_id = %d",
-    1,
-    NULL,
-    &dubu_validate,
-  },
-
   {
     /* Q_GKUM - GET_KERBEROS_USER_MAP */
     "get_kerberos_user_map",
index 2152c3f8a58284b6229747809eed947e8b195968..83b6fb17d11c53d3d0d2018c49efb8680b25ddc1 100644 (file)
@@ -189,51 +189,32 @@ int validate_id(struct query *q, char *argv[], struct valobj *vo)
   namefield = vo->namefield;
   idfield = vo->idfield;
 
-  if ((tbl == USERS_TABLE && !strcmp(namefield, "login")) ||
-      tbl == MACHINE_TABLE || tbl == SUBNET_TABLE || tbl == FILESYS_TABLE ||
-      tbl == LIST_TABLE || tbl == CLUSTERS_TABLE || tbl == STRINGS_TABLE)
+  if (tbl == MACHINE_TABLE || tbl == SUBNET_TABLE)
     {
-      if (tbl == MACHINE_TABLE || tbl == SUBNET_TABLE)
-       {
-         for (c = name; *c; c++)
-           {
-             if (islower(*c))
-               *c = toupper(*c);
-           }
-       }
-      status = name_to_id(name, tbl, &id);
-      if (status == 0)
-       {
-         *(int *)argv[vo->index] = id;
-         return MR_EXISTS;
-       }
-      else if (status == MR_NO_MATCH && tbl == STRINGS_TABLE &&
-              (q->type == APPEND || q->type == UPDATE))
+      for (c = name; *c; c++)
        {
-         id = add_string(name);
-         cache_entry(name, STRINGS_TABLE, id);
-         *(int *)argv[vo->index] = id;
-         return MR_EXISTS;
+         if (islower(*c))
+           *c = toupper(*c);
        }
-      else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
-       return vo->error;
-      else
-       return status;
     }
-  else
+  status = name_to_id(name, tbl, &id);
+  if (status == 0)
     {
-      /* else, it's `dubu', which uses unix_uid from users */
-      EXEC SQL SELECT COUNT(*) INTO :rowcount FROM users
-       WHERE unix_uid = :name;
-      if (dbms_errno)
-       return mr_errcode;
-      if (rowcount != 1)
-       return vo->error;
-      EXEC SQL SELECT users_id INTO :id FROM users
-       WHERE unix_uid = :name;
       *(int *)argv[vo->index] = id;
       return MR_EXISTS;
     }
+  else if (status == MR_NO_MATCH && tbl == STRINGS_TABLE &&
+          (q->type == APPEND || q->type == UPDATE))
+    {
+      id = add_string(name);
+      cache_entry(name, STRINGS_TABLE, id);
+      *(int *)argv[vo->index] = id;
+      return MR_EXISTS;
+    }
+  else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
+    return vo->error;
+  else
+    return status;
 }
 
 int validate_name(char *argv[], struct valobj *vo)
This page took 0.056864 seconds and 5 git commands to generate.