* $Header$
*
* Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*/
+#include <mit-copyright.h>
#include "query.h"
#include "sms_et.h"
int setup_afil();
int setup_ufil();
int setup_dfil();
-int setup_ssif();
-int setup_sshi();
int setup_dnfp();
int setup_dnfq();
int followup_anfq();
int followup_gzcl();
int followup_gsha();
+int followup_gnfq();
int set_modtime();
int set_modtime_by_id();
int set_finger_modtime();
int set_pobox_modtime();
-int set_mach_modtime();
+int set_uppercase_modtime();
int set_mach_modtime_by_id();
int set_cluster_modtime_by_id();
int set_serverhost_modtime();
{V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
};
+static struct valobj VOfilsys0[] = {
+ {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+};
+
static struct valobj VOchar0[] = {
{V_CHAR, 0},
};
MACH_ID,
0,
0,
- set_mach_modtime,
+ set_uppercase_modtime,
};
static char *umac_fields[] = {
static struct valobj acld_valobj[] =
{
{V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
- {V_TYPE, 1, "slabel", 0, 0, SMS_TYPE},
{V_CHAR, 2},
};
static char *gsin_fields[] = {
SERVICE,
- SERVICE, "update_int", "target_file", "script", "dfgen",
+ SERVICE, "update_int", "target_file", "script", "dfgen", "dfcheck",
TYPE, "enable", "inprogress", "harderror", "errmsg",
ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
};
0,
0,
0,
- set_modtime,
+ set_uppercase_modtime,
};
static struct validate rsve_validate = {
0,
access_service,
0,
- set_modtime,
+ set_uppercase_modtime,
};
static char *ssif_fields[] = {
- SERVICE, "dfgen", "inprogress", "harderror", "errmsg",
+ SERVICE, "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
};
static struct validate ssif_validate = {
- VOdate1,
- 1,
+ 0,
+ 0,
NAME,
"s.name = uppercase(\"%s\")",
1,
0,
0,
- setup_ssif,
+ 0,
0,
};
static struct valobj sshi_valobj[] = {
{V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
{V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
- {V_DATE, 7, 0, 0, 0, SMS_DATE},
- {V_DATE, 8, 0, 0, 0, SMS_DATE},
};
static struct validate sshi_validate =
{
sshi_valobj,
- 4,
+ 2,
SERVICE,
- "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+ "s.service = uppercase(\"%s\") and s.mach_id = %d",
2,
0,
0,
- setup_sshi,
+ 0,
0,
};
0,
};
+static char *gfgm_fields[] = {
+ "fsgroup", FILESYS, "sortkey"
+};
+
+static struct valobj gfgm_valobj[] = {
+ {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+ {V_SORT, 1},
+ {V_SORT, 0},
+};
+
+static struct validate gfgm_validate = {
+ gfgm_valobj,
+ 3,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
+static struct valobj aftg_valobj[] = {
+ {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+ {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+};
+
+static struct validate aftg_validate = {
+ aftg_valobj,
+ 2,
+ "group_id",
+ "fg.group_id = %d and fg.filsys_id = %d",
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
static char *ganf_fields[] = {
MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
};
static char *gpcp_fields[] = {
"printer",
- "printer", "printcap", MOD1, MOD2, MOD3,
+ "printer", "spooling_host", "spool_directory", "rprinter", "comments",
+ MOD1, MOD2, MOD3,
};
static char *apcp_fields[] = {
- "printer", "printcap", MOD1, MOD2, MOD3,
+ "printer", "spooling_host", "spool_directory", "rprinter", "comments",
+ MOD1, MOD2, MOD3,
+};
+
+static struct valobj apcp_valobj[] = {
+ {V_CHAR, 0},
+ {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
};
static struct validate apcp_validate = {
- VOchar0,
- 1,
+ apcp_valobj,
+ 2,
NAME,
"p.name = \"%s\"",
1,
set_modtime,
};
+static struct validate dpcp_validate = {
+ 0,
+ 0,
+ NAME,
+ "p.name = \"%s\"",
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
static char *gali_fields[] = {
NAME, TYPE, "trans",
NAME, TYPE, "trans",
"%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
galo_fields,
6,
- "u.status != 0",
+ "u.status = 1",
0,
0,
},
RETRIEVE,
"s",
"servers",
- "%c = s.name, %c = text(s.update_int), %c = s.target_file, %c = s.script, %c = s.dfgen, %c = s.type, %c = text(s.enable), %c = text(s.inprogress), %c = text(s.harderror), %c = s.errmsg, %c = s.acl_type, %c = text(s.acl_id), %c = s.modtime, %c = text(s.modby), %c = s.modwith",
+ "%c = s.name, %c = text(s.update_int), %c = s.target_file, %c = s.script, %c = text(s.dfgen), %c = text(s.dfcheck), %c = s.type, %c = text(s.enable), %c = text(s.inprogress), %c = text(s.harderror), %c = s.errmsg, %c = s.acl_type, %c = text(s.acl_id), %c = s.modtime, %c = text(s.modby), %c = s.modwith",
gsin_fields,
- 15,
+ 16,
"s.name = uppercase(\"%s\")",
1,
&gsin_validate,
UPDATE,
"s",
"servers",
- "harderror = 0",
+ "harderror = 0, dfcheck = s.dfgen",
dsin_fields,
0,
"s.name = uppercase(\"%s\")",
UPDATE,
"s",
"servers",
- "dfgen = %c, inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
+ "dfgen = int4(%c), dfcheck = int4(%c), inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
ssif_fields,
- 4,
+ 5,
"s.name = uppercase(\"%s\")",
1,
&ssif_validate,
RETRIEVE,
"sh",
"serverhosts",
- "%c = sh.service, %c = machine.name, %c = text(sh.enable), %c = text(sh.override), %c = text(sh.success), %c = text(sh.inprogress), %c = text(sh.hosterror), %c = sh.hosterrmsg, %c = sh.ltt, %c = sh.lts, %c = text(sh.value1), %c = text(sh.value2), %c = sh.value3, %c = sh.modtime, %c = text(sh.modby), %c = sh.modwith",
+ "%c = sh.service, %c = machine.name, %c = text(sh.enable), %c = text(sh.override), %c = text(sh.success), %c = text(sh.inprogress), %c = text(sh.hosterror), %c = sh.hosterrmsg, %c = text(sh.ltt), %c = text(sh.lts), %c = text(sh.value1), %c = text(sh.value2), %c = sh.value3, %c = sh.modtime, %c = text(sh.modby), %c = sh.modwith",
gshi_fields,
16,
"sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id",
"set_server_host_internal",
"sshi",
UPDATE,
- "sh",
+ "s",
"serverhosts",
- "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = %c, lts = %c",
+ "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = int4(%c), lts = int4(%c)",
sshi_fields,
7,
- "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+ "s.service = uppercase(\"%s\") and s.mach_id = %d",
2,
&sshi_validate,
},
&dfil_validate,
},
+ {
+ /* Q_GFGM - GET_FSGROUOP_MEMBERS */
+ "get_fsgroup_members",
+ "gfgm",
+ RETRIEVE,
+ "fg",
+ "fsgroup",
+ "%c = filesys.label, %c = fg.key",
+ gfgm_fields,
+ 2,
+ "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
+ 1,
+ &gfgm_validate,
+ },
+
+ {
+ /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
+ "add_filesys_to_fsgroup",
+ "aftg",
+ APPEND,
+ "fg",
+ "fsgroup",
+ "group_id = filesys.filsys_id, filsys_id = %i4, key = %c",
+ gfgm_fields,
+ 2,
+ "filesys.filsys_id = %d and filesys.type = \"FSGROUP\"",
+ 1,
+ &aftg_validate,
+ },
+
+ {
+ /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
+ "remove_filesys_from_fsgroup",
+ "rffg",
+ DELETE,
+ "fg",
+ "fsgroup",
+ (char *)0,
+ gfgm_fields,
+ 0,
+ "fg.group_id = %d and fg.filsys_id = %d",
+ 2,
+ &aftg_validate,
+ },
+
{
/* Q_GANF - GET_ALL_NFSPHYS */
"get_all_nfsphys",
"%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
gnfq_fields,
8,
- "filesys.label = \"%s\" and users.users_id = %d and filesys.phys_id = nfsphys.nfsphys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id and filesys.filsys_id = nq.filsys_id",
+ "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and nfsphys.nfsphys_id = nq.phys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
2,
&gnfq_validate,
},
"%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
gnqp_fields,
5,
- "filesys.mach_id = %d and nfsphys.dir = \"%s\" and nq.filsys_id = filesys.filsys_id and nfsphys.nfsphys_id = filesys.phys_id and users.users_id = nq.users_id and machine.mach_id = filesys.mach_id",
+ "nfsphys.mach_id = %d and nfsphys.dir = \"%s\" and nq.phys_id = nfsphys.nfsphys_id and filesys.filsys_id = nq.filsys_id and users.users_id = nq.users_id and machine.mach_id = nfsphys.mach_id",
2,
&VDmach,
},
APPEND,
"nq",
"nfsquota",
- "filsys_id = %i4, users_id = %i4, quota = int4(%c)",
+ "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
anfq_fields,
- 3,
- (char *)0,
- 0,
+ 2,
+ "filesys.filsys_id = %d",
+ 1,
&anfq_validate,
},
1,
&cmol_validate,
},
-
+#ifdef notdef
{
/* Q_AUGR - ADD_USER_GROUP */
"add_user_group",
0,
&augr_validate,
},
-
+#endif
{
/* Q_GZCL - GET_ZEPHYR_CLASS */
"get_zephyr_class",
RETRIEVE,
"p",
"printcap",
- "%c = p.name, %c = p.pcap, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
+ "%c = p.name, %c = machine.name, %c = p.dir, %c = p.rp, %c = p.comments, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
gpcp_fields,
- 5,
- "p.name = \"%s\"",
+ 8,
+ "p.name = \"%s\" and machine.mach_id = p.mach_id",
1,
&VDsortf,
},
APPEND,
"p",
"printcap",
- "name = %c, pcap = %c",
+ "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
apcp_fields,
- 2,
+ 5,
0,
0,
&apcp_validate,
0,
"p.name = \"%s\"",
1,
- &apcp_validate,
+ &dpcp_validate,
},
{