client *cl;
##{
## int nuid, rowcount;
+## char *mit_id;
+
+#ifdef notdef
+ /* this is currently disabled because we need an index on ID's
+ * before it can run in finite time.
+ */
+ mit_id = argv[U_MITID];
+## retrieve (rowcount = any(u.#mit_id where u.#mit_id = mit_id))
+ if (ingres_errno) return(mr_errcode);
+ if (rowcount) return(MR_EXISTS);
+#endif notdef
if (!strcmp(argv[1], UNIQUE_UID) || atoi(argv[1]) == -1) {
if (set_next_object_id("uid", "users"))
## repeat retrieve (flag = any(printcap.mach_id where printcap.mach_id=@id))
if (flag)
return(MR_IN_USE);
+## repeat retrieve (flag = any(printcap.quotaserver where printcap.quotaserver=@id))
+ if (flag)
+ return(MR_IN_USE);
## repeat retrieve (flag = any(palladium.mach_id where palladium.mach_id=@id))
if (flag)
return(MR_IN_USE);
## servers.acl_type = "LIST"))
if (flag)
return(MR_IN_USE);
+## repeat retrieve (flag = any(quota.entity_id where quota.entity_id=@id and
+## quota.type = "GROUP"))
+ if (flag)
+ return(MR_IN_USE);
## repeat retrieve (flag=any(hostaccess.acl_id where hostaccess.acl_id=@id and
## hostaccess.acl_type = "LIST"))
if (flag)
setup_afil(q, argv)
struct query *q;
char *argv[];
-{
- char *type;
+##{
+ char *type, *name;
int mach_id;
- char *name;
- char *access;
+## int ok;
+## char ftype[32], *access;
type = argv[1];
mach_id = *(int *)argv[2];
access = argv[5];
var_phys_id = 0;
+ sprintf(ftype, "fs_access_%s", type);
+## retrieve (ok = any(alias.trans where alias.name = ftype and
+## alias.type = "TYPE" and alias.trans = access))
+ if (ingres_errno) return(mr_errcode);
+ if (ok == 0) return(MR_FILESYS_ACCESS);
+
if (!strcmp(type, "NFS"))
return (check_nfs(mach_id, name, access));
else
return(MR_SUCCESS);
-}
+##}
/* Verify the arguments, depending on the FStype. Also, if this is an
client *cl;
##{
int mach_id, status;
- char *type, *name, *access;
+ char *type, *name;
## int fid, total, who;
-## char *entity;
+## char *entity, ftype[32], *access;
type = argv[2];
mach_id = *(int *)argv[3];
who = cl->client_id;
entity = cl->entity;
+ sprintf(ftype, "fs_access_%s", type);
+## retrieve (total = any(alias.trans where alias.name = ftype and
+## alias.type = "TYPE" and alias.trans = access))
+ if (ingres_errno) return(mr_errcode);
+ if (total == 0) return(MR_FILESYS_ACCESS);
+
if (!strcmp(type, "NFS")) {
status = check_nfs(mach_id, name, access);
## replace quota (phys_id = var_phys_id) where quota.filsys_id = fid
return(status);
} else if (!strcmp(type, "AFS")) {
total = 0;
-## retrieve (total = sum(quota.quota where quota.filsys_id = fid))
+## retrieve (total = sum(quota.quota where quota.filsys_id = fid
+## and quota.phys_id != 0))
if (ingres_errno) return(mr_errcode);
if (total != 0) {
## append quota (quota = total, filsys_id = fid,
register char *cp1;
register char *cp2;
- caccess = (isupper(*access)) ? tolower(*access) : *access;
- if (caccess != 'r' && caccess != 'w' && caccess != 'n')
- return(MR_FILESYS_ACCESS);
-
status = MR_NFS;
## range of np is nfsphys
## repeat retrieve (var_phys_id = np.#nfsphys_id, dir = trim(np.#dir))
##}
+followup_gpce(q, sq, v, action, actarg, cl)
+ struct query *q;
+ register struct save_queue *sq;
+ struct validate *v;
+ register int (*action)();
+ register int actarg;
+ client *cl;
+{
+ register int i, j;
+ char **argv, *malloc();
+ int id, status;
+
+ i = q->vcnt - 2;
+ while (sq_get_data(sq, &argv)) {
+ id = atoi(argv[PCAP_QSERVER]);
+ status = id_to_name(id, "MACHINE", &argv[PCAP_QSERVER]);
+ if (status) return (status);
+ id = atoi(argv[i]);
+ if (id > 0)
+ status = id_to_name(id, "USER", &argv[i]);
+ else
+ status = id_to_name(-id, "STRING", &argv[i]);
+ if (status && status != MR_NO_MATCH)
+ return(status);
+ (*action)(q->vcnt, argv, actarg);
+ for (j = 0; j < q->vcnt; j++)
+ free(argv[j]);
+ free(argv);
+ }
+ sq_destroy(sq);
+ return(MR_SUCCESS);
+}
+
+
/* followup_gzcl:
*/
* how many different ancestors a member is allowed to have.
*/
-#define MAXLISTDEPTH 100
+#define MAXLISTDEPTH 1024
int add_member_to_list(q, argv, cl)
struct query *q;
/* find user */
## repeat retrieve (users_id = u.#users_id)
-## where u.#uid = @uid and (u.status = 0 or u.status = 5)
+## where u.#uid = @uid and (u.status = 0 or u.status = 5 or u.status = 6)
## inquire_equel(rowcount = "rowcount");
if (rowcount == 0)
return(MR_NO_MATCH);
if (rowcount != 1)
return(MR_INTERNAL);
aargv[0] = login;
- aargv[1] = login;
+ aargv[1] = "USER";
+ aargv[2] = login;
sprintf(buffer, "q.entity_id = %d and q.filsys_id = values.value and q.type = \"USER\" and values.name = \"filsys_id\"", users_id);
incremental_after("quota", buffer, aargv);
com_err(whoami, 0, "quota of %d assigned", quota);