]> andersk Git - moira.git/commitdiff
Remove `delete_user_by_uid' since it's never been used in any logs we have, qvalidate
authordanw <danw>
Tue, 11 Nov 1997 23:04:18 +0000 (23:04 +0000)
committerdanw <danw>
Tue, 11 Nov 1997 23:04:18 +0000 (23:04 +0000)
and it requires special handling.
A few sanity fixes to queries2.c

server/qsupport.pc
server/queries2.c
server/qvalidate.pc

index dbae9311a4d8701dfa68477e0a91316cf7bd8506..e443b8499c976b928ae36f15d5d488535fae6f10 100644 (file)
@@ -69,9 +69,7 @@ int set_pobox(q, argv, cl)
 
     if (!strcmp(argv[1], "POP")) {
        status = name_to_id(box, MACHINE_TABLE, &id);
-       if (status == MR_NO_MATCH)
-         return(MR_MACHINE);
-       else if (status)
+       if (status)
          return(status);
        EXEC SQL UPDATE users SET potype = 'POP', pop_id = :id
          WHERE users_id = :user;
index 1961e294f581b68b35c487bc0d54c9c02f40f67b..90ffd527f6ac9207cf86538d0662cf03cd3a005d 100644 (file)
@@ -128,7 +128,7 @@ static struct valobj VOclu0[] = {
 };
 
 static struct valobj VOsnet0[] = {
-  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_CLUSTER},
+  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
 };
 
 static struct valobj VOlist0[] = {
@@ -139,10 +139,6 @@ static struct valobj VOfilsys0[] = {
   {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
 };
 
-static struct valobj VOchar0[] = {
-  {V_CHAR, 0},
-};
-
 
 /* Validations
  * Commonly used validation records defined here so that they may
@@ -352,7 +348,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},
 };
 
@@ -496,26 +492,6 @@ static struct validate dusr_validate = {
   0,
 };
 
-static char *dubu_fields[] = {
-  "uid",
-};
-
-static struct valobj dubu_valobj[] = {
-  {V_ID, 0, USERS_TABLE, "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" };
 
@@ -2765,22 +2741,6 @@ struct query Queries2[] = {
     &dusr_validate,
   },
 
-  {
-    /* Q_DUBU - DELETE_USER_BY_UID */
-    "delete_user_by_uid",
-    "dubu",
-    DELETE,
-    "u",
-    USERS_TABLE,
-    (char *)0,
-    dubu_fields,
-    0,
-    "users_id = %d",
-    1,
-    0,
-    &dubu_validate,
-  },
-
   {
     /* Q_GKUM - GET_KERBEROS_USER_MAP */ 
     "get_kerberos_user_map",
index 3372e5d736ff0fa3e9756a29e55fe6a8d5d2d8e5..70309450b89e20c66e8a590aca3f99b79babfb56 100644 (file)
@@ -206,7 +206,7 @@ int validate_id(q, argv, vo)
     register struct valobj *vo;
 {
     EXEC SQL BEGIN DECLARE SECTION;
-    char *name, *namefield, *idfield;
+    char *name;
     int id, rowcount, tbl;
     EXEC SQL END DECLARE SECTION;
     int status;
@@ -214,39 +214,23 @@ int validate_id(q, argv, vo)
 
     name = argv[vo->index];
     tbl = vo->table;
-    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==CLUSTER_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) {
+    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)) {
+    } 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)
+    } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
        return(vo->error);
-      else
+    else
        return(status);
-    } else {
-      /* 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);
-    }
 }
 
 int validate_name(argv, vo)
This page took 0.216298 seconds and 5 git commands to generate.