]> andersk Git - moira.git/blobdiff - server/queries2.c
Allow hostname to start with a digit in hostname_check, but disallow it
[moira.git] / server / queries2.c
index f1d9009e9356689c5ca647226812846e8705d231..a71f7a7a5fbb9647baf6ed25eaa090ee33d7560f 100644 (file)
@@ -74,13 +74,14 @@ static char *galo_fields[] = {
 static char *gual_fields[] = {
   "login",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
+  "clearid", "class", "comments", "signature", "secure",
+  "modtime", "modby", "modwith",
 };
 
 static char *gubl_fields[] = {
   "login",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "modby", "modby", "modwith",
+  "clearid", "class", "modtime", "modby", "modwith",
 };
 
 static struct validate gubl_validate =
@@ -99,13 +100,15 @@ static struct validate gubl_validate =
 static char *guau_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
+  "clearid", "class", "comments", "signature", "secure",
+  "modtime", "modby", "modwith",
 };
 
 static char *guan_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
+  "clearid", "class", "comments", "signature", "secure",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate guan_validate =
@@ -124,19 +127,21 @@ static struct validate guan_validate =
 static char *guac_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
+  "clearid", "class", "comments", "signature", "secure",
+  "modtime", "modby", "modwith",
 };
 
 static char *guam_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
+  "clearid", "class", "comments", "signature", "secure",
+  "modtime", "modby", "modwith",
 };
 
 static char *gubu_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "modby", "modby", "modwith",
+  "clearid", "class", "modtime", "modby", "modwith",
 };
 
 static struct validate gubu_validate =
@@ -155,7 +160,7 @@ static struct validate gubu_validate =
 static char *gubn_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "modby", "modby", "modwith",
+  "clearid", "class", "modtime", "modby", "modwith",
 };
 
 static struct validate gubn_validate =
@@ -174,31 +179,13 @@ static struct validate gubn_validate =
 static char *gubc_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "modby", "modby", "modwith",
+  "clearid", "class", "modtime", "modby", "modwith",
 };
 
 static char *gubm_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
-  "clearid", "class", "modby", "modby", "modwith",
-};
-
-static char *gudf_fields[] = {
-  "login",
-  "dirsuppress", "dirmailhide"
-};
-
-static struct validate gudf_validate =
-{
-  VOuser0,
-  1,
-  0,
-  0,
-  0,
-  0,
-  access_user,
-  0,
-  0,
+  "clearid", "class", "modtime", "modby", "modwith",
 };
 
 static char *auac_fields[] = {
@@ -217,7 +204,7 @@ static struct valobj auac_valobj[] = {
   {V_CHAR, 7, USERS_TABLE, "clearid"},
   {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
   {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
-  {V_NUM, 10},
+  {V_NUM, 11},
 };
 
 static struct validate auac_validate = {
@@ -330,7 +317,7 @@ static struct validate uush_validate = {
   "users_id",
   access_user,
   0,
-  set_modtime_by_id,
+  set_finger_modtime,
 };
 
 static char *uust_fields[] = {
@@ -361,23 +348,6 @@ static struct validate uust_validate = {
   set_modtime_by_id,
 };
 
-static char *uudf_fields[] = {
-  "login",
-  "dirsuppress", "dirhide"
-};
-
-static struct validate uudf_validate = {
-  uust_valobj,
-  3,
-  0,
-  0,
-  0,
-  "users_id",
-  access_user,
-  0,
-  set_modtime_by_id,
-};
-
 static char *dusr_fields[] = {
   "login",
 };
@@ -435,7 +405,7 @@ static char *gfbl_fields[] = {
   "login",
   "login", "fullname", "nickname", "home_addr",
   "home_phone", "office_addr", "office_phone", "department",
-  "affiliation", "modby", "modby", "modwith",
+  "affiliation", "modtime", "modby", "modwith",
 };
 
 static struct validate gfbl_validate = {
@@ -483,7 +453,7 @@ static struct validate ufbl_validate = {
 
 static char *gpob_fields[] = {
   "login",
-  "login", "type", "box", "modby", "modby", "modwith",
+  "login", "type", "box", "modtime", "modby", "modwith",
 };
 
 static struct validate gpob_validate = {
@@ -564,12 +534,15 @@ static struct validate dpob_validate =    /* DELETE_POBOX */
 
 static char *gmac_fields[] = {
   "name",
-  "name", "type", "modby", "modby", "modwith",
+  "name", "type", "modtime", "modby", "modwith",
 };
 
 static char *ghst_fields[] = {
   "name", "address", "location", "network",
-  "name", "vendor", "model", "os", "location", "contact", "use", "status", "status_change", "network", "address", "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", "inuse", "modby", "modby", "modwith",
+  "name", "vendor", "model", "os", "location", "contact", "use",
+  "status", "status_change", "network", "address", "ace_type",
+  "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
 };
 
 static struct validate ghst_validate = {
@@ -585,7 +558,9 @@ static struct validate ghst_validate = {
 };
 
 static char *ahst_fields[] = {
-  "name", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
+  "name", "vendor", "model", "os", "location", "contact", "use",
+  "status", "subnet", "address", "ace_type", "ace_name",
+  "admin_comment", "ops_comment",
 };
 
 static struct valobj ahst_valobj[] = {
@@ -618,7 +593,9 @@ static struct validate ahst_validate = {
 
 static char *uhst_fields[] = {
   "name",
-  "newname", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
+  "newname", "vendor", "model", "os", "location", "contact", "use",
+  "status", "subnet", "address", "ace_type", "ace_name",
+  "admin_comment", "ops_comment",
 };
 
 static struct valobj uhst_valobj[] = {
@@ -719,8 +696,8 @@ static struct validate dhal_validate = {
 
 static char *gsnt_fields[] = {
   "name",
-  "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
-  "modby", "modby", "modwith"
+  "name", "description", "address", "mask", "low", "high", "prefix",
+  "ace_type", "ace_name", "modtime", "modby", "modwith"
 };
 
 static struct validate gsnt_validate = {
@@ -736,7 +713,8 @@ static struct validate gsnt_validate = {
 };
 
 static char *asnt_fields[] = {
-  "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
+  "name", "description", "address", "mask", "low", "high", "prefix",
+  "ace_type", "ace_name",
 };
 
 static struct valobj asnt_valobj[] = {
@@ -766,7 +744,8 @@ static struct validate asnt_validate =
 
 static char *usnt_fields[] = {
   "name",
-  "newname", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
+  "newname", "description", "address", "mask", "low", "high", "prefix",
+  "ace_type", "ace_name",
 };
 
 static struct valobj usnt_valobj[] = {
@@ -813,7 +792,7 @@ static struct validate dsnt_validate = {
 
 static char *gclu_fields[] = {
   "name",
-  "name", "description", "location", "modby", "modby", "modwith",
+  "name", "description", "location", "modtime", "modby", "modwith",
 };
 
 static char *aclu_fields[] = {
@@ -948,7 +927,7 @@ static struct validate dcld_validate =
 static char *glin_fields[] = {
   "name",
   "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
-  "ace_type", "ace_name", "description", "modby", "modby", "modwith",
+  "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
 };
 
 static struct validate glin_validate = {
@@ -1196,7 +1175,7 @@ static char *gsin_fields[] = {
   "service",
   "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
   "type", "enable", "inprogress", "harderror", "errmsg",
-  "ace_type", "ace_name", "modby", "modby", "modwith",
+  "ace_type", "ace_name", "modtime", "modby", "modwith",
 };
 
 static struct validate gsin_validate =
@@ -1321,7 +1300,7 @@ static char *gshi_fields[] = {
   "service", "machine",
   "service", "machine", "enable", "override", "success", "inprogress",
   "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
-  "value3", "modby", "modby", "modwith",
+  "value3", "modtime", "modby", "modwith",
 };
 
 static struct validate gshi_validate = {
@@ -1467,14 +1446,14 @@ static char *gslo_fields[] = {
 
 static char *gfsl_fields[] = {
   "label",
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype", "modby", "modby", "modwith",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
 };
 
 static char *gfsm_fields[] = {
   "machine",
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype", "modby", "modby", "modwith",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
 };
 
 static struct validate gfsm_validate = {
@@ -1491,8 +1470,8 @@ static struct validate gfsm_validate = {
 
 static char *gfsn_fields[] = {
   "machine", "parition",
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype", "modby", "modby", "modwith",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
 };
 
 static struct validate gfsn_validate = {
@@ -1509,14 +1488,14 @@ static struct validate gfsn_validate = {
 
 static char *gfsp_fields[] = {
   "path",
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype", "modby", "modby", "modwith",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
 };
 
 static char *gfsg_fields[] = {
   "list",
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype", "modby", "modby", "modwith",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
 };
 
 static struct validate gfsg_validate = {
@@ -1532,8 +1511,8 @@ static struct validate gfsg_validate = {
 };
 
 static char *afil_fields[] = {
-  "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
-  "create", "lockertype",
+  "label", "type", "machine", "name", "mount", "access", "comments",
+  "owner", "owners", "create", "lockertype",
 };
 
 static struct valobj afil_valobj[] = {
@@ -1563,8 +1542,8 @@ static struct validate afil_validate = {
 };
 
 static char *ufil_fields[] = {
-  "label", "newlabel", "type", "machine", "name", "mount", "access", "comments",
-  "owner", "owners", "create", "lockertype",
+  "label", "newlabel", "type", "machine", "name", "mount", "access",
+  "comments", "owner", "owners", "create", "lockertype",
 };
 
 static struct valobj ufil_valobj[] = {
@@ -1644,12 +1623,14 @@ static struct validate aftg_validate = {
 };
 
 static char *ganf_fields[] = {
-  "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
+  "machine", "dir", "device", "status", "allocated", "size",
+  "modtime", "modby", "modwith",
 };
 
 static char *gnfp_fields[] = {
   "machine", "dir",
-  "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
+  "machine", "dir", "device", "status", "allocated", "size",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate gnfp_validate = {
@@ -1737,7 +1718,8 @@ static struct validate dnfp_validate = {
 
 static char *gqot_fields[] = {
   "filesys", "type", "name",
-  "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
+  "filesys", "type", "name", "quota", "dir", "machine",
+  "modtime", "modby", "modwith",
 };
 
 static struct valobj gqot_valobj[] = {
@@ -1759,7 +1741,8 @@ static struct validate gqot_validate = {
 
 static char *gqbf_fields[] = {
   "filesys",
-  "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
+  "filesys", "type", "name", "quota", "dir", "machine",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate gqbf_validate = {
@@ -1823,7 +1806,8 @@ static struct validate dqot_validate = {
 
 static char *gnfq_fields[] = {
   "filesys", "login",
-  "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
+  "filesys", "login", "quota", "dir", "machine",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate gnfq_validate = {
@@ -1840,7 +1824,8 @@ static struct validate gnfq_validate = {
 
 static char *gnqp_fields[] = {
   "machine", "dir",
-  "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
+  "filesys", "login", "quota", "dir", "machine",
+  "modtime", "modby", "modwith",
 };
 
 static char *anfq_fields[] = {
@@ -1892,7 +1877,8 @@ static struct validate dnfq_validate = {
 static char *gzcl_fields[] = {
   "class",
   "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
-  "iws_type", "iws_name", "iui_type", "iui_name", "modby", "modby", "modwith",
+  "iws_type", "iws_name", "iui_type", "iui_name",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate gzcl_validate = {
@@ -1980,7 +1966,7 @@ static struct validate dzcl_validate = {
 
 static char *gsha_fields[] = {
   "machine",
-  "machine", "ace_type", "ace_name", "modby", "modby", "modwith",
+  "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
 };
 
 static struct validate gsha_validate =
@@ -2021,7 +2007,7 @@ static struct validate asha_validate =
 
 static char *gsvc_fields[] = {
   "service",
-  "service", "protocol", "port", "description", "modby", "modby", "modwith",
+  "service", "protocol", "port", "description", "modtime", "modby", "modwith",
 };
 
 static char *asvc_fields[] = {
@@ -2051,7 +2037,7 @@ static char *gpce_fields[] = {
   "printer",
   "printer", "spooling_host", "spool_directory", "rprinter",
   "quotaserver", "authenticate", "price", "comments",
-  "modby", "modby", "modwith",
+  "modtime", "modby", "modwith",
 };
 
 static struct validate gpce_validate = {
@@ -2069,7 +2055,7 @@ static struct validate gpce_validate = {
 static char *apce_fields[] = {
   "printer", "spooling_host", "spool_directory", "rprinter",
   "quotaserver", "authenticate", "price", "comments",
-  "modby", "modby", "modwith",
+  "modtime", "modby", "modwith",
 };
 
 static struct valobj apce_valobj[] = {
@@ -2110,12 +2096,12 @@ static struct validate dpce_validate = {
 static char *gpcp_fields[] = {
   "printer",
   "printer", "spooling_host", "spool_directory", "rprinter", "comments",
-  "modby", "modby", "modwith",
+  "modtime", "modby", "modwith",
 };
 
 static char *gpdm_fields[] = {
   "name",
-  "name", "rpcnum", "host", "modby", "modby", "modwith",
+  "name", "rpcnum", "host", "modtime", "modby", "modwith",
 };
 
 static char *apdm_fields[] = {
@@ -2239,7 +2225,8 @@ static char *dval_fields[] = {
 };
 
 static char *gats_fields[] = {
-  "table_name", "appends", "updates", "deletes", "modby", "modby", "modwith",
+  "table_name", "appends", "updates", "deletes",
+  "modtime", "modby", "modwith",
 };
 
 static char *_sdl_fields[] = {
@@ -2460,22 +2447,6 @@ struct query Queries2[] = {
     &VDfix_modby,
   },
 
-  {
-    /* Q_GUDF - GET_USER_DIRECTORY_FLAGS */
-    "get_user_directory_flags",
-    "gudf",
-    RETRIEVE,
-    "u",
-    USERS_TABLE,
-    "u.dirsuppress, u.dirmailhide FROM users u",
-    gudf_fields,
-    2,
-    "u.users_id = %d",
-    1,
-    NULL,
-    &gudf_validate,
-  },
-
   {
     /* Q_AUAC - ADD_USER_ACCOUNT */  /* uses prefetch_value() for users_id */
     "add_user_account",
@@ -2604,22 +2575,6 @@ struct query Queries2[] = {
     &uust_validate,
   },
 
-  {
-    /* Q_UUDF - UPDATE_USER_DIRECTORY_FLAGS */
-    "update_user_directory_flags",
-    "uudf",
-    UPDATE,
-    "u",
-    USERS_TABLE,
-    "users SET dirsuppress = %s, dirmailhide = %s",
-    uudf_fields,
-    2,
-    "users_id = %d",
-    1,
-    NULL,
-    &uudf_validate,
-  },
-
   {
     /* Q_DUSR - DELETE_USER */
     "delete_user",
This page took 0.729512 seconds and 4 git commands to generate.