## int flag, id;
id = *(int *)argv[0];
+
+ /* For now, only allow users to be deleted if their status is 0 */
+## repeat retrieve (flag = u.status) where u.users_id = @id
+ if (flag != 0)
+ return(SMS_IN_USE);
+
## repeat delete nfsquota where nfsquota.users_id = @id
## repeat retrieve (flag = any(members.member_id where members.member_id=@id
## and members.member_type = "USER"))
## where machine.mach_id = u.pop_id
## and u.pop_id != 0
## and u.users_id = @id))
+## where u.users_id = @id
if (!flag)
return(SMS_MACHINE);
if (strcmp(type, "POP"))
## repeat retrieve (flag = any(hostaccess.mach_id where hostaccess.mach_id=@id))
if (flag)
return(SMS_IN_USE);
+## repeat retrieve (flag = any(pcap.mach_id where pcap.mach_id=@id))
+ if (flag)
+ return(SMS_IN_USE);
## repeat delete mcmap where mcmap.mach_id = @id
return(SMS_SUCCESS);
if (flag)
return(SMS_IN_USE);
## repeat retrieve (flag = any(list.name where list.acl_id=@id and
-## list.acl_type = "LIST"))
+## list.acl_type = "LIST" and list.list_id != @id))
if (flag)
return(SMS_IN_USE);
## repeat retrieve (flag = any(servers.name where servers.acl_id=@id and
idx = 8;
if (!strcmp(q->shortname, "gsin"))
- idx = 11;
+ idx = 12;
while (sq_get_data(sq, &argv)) {
sms_trim_args(q->vcnt, argv);
## repeat retrieve (flag = any(u.#login where u.#login = @login))
if (flag)
return(SMS_IN_USE);
-## repeat retrieve (flag = any(l.name where l.name = @login))
+## repeat retrieve (flag = any(l.#name where l.#name = @login))
if (flag)
return(SMS_IN_USE);
## repeat retrieve (flag = any(filesys.#name where filesys.#name = @login))
return(SMS_NO_ID);
## repeat append filesys (filsys_id = values.value, phys_id = @pid,
## label = @login, type = "NFS", mach_id = @m_id,
-## name = @directory + @login, mount = "/mit/" + @login,
+## name = @directory + "/" + @login,
+## mount = "/mit/" + @login,
## access = "w", comments = "User Locker",
## owner = @users_id, owners = @list_id, createflg = 1,
## lockertype = "HOMEDIR", modtime = "now",
if (rowcount != 1)
return(SMS_INTERNAL);
com_err(whoami, 0, "filesys created on mach %d in %s/%s", m_id,
- trim(directory), login);
+ directory, login);
/* set quota */
## repeat retrieve (quota = values.value) where values.name = "def_quota"
return(SMS_INTERNAL);
com_err(whoami, 0, "quota of %d assigned", quota);
+## repeat replace tblstats (updates = tblstats.updates + 1, modtime = "now")
+## where tblstats.table = "users"
+## repeat replace tblstats (appends = tblstats.appends + 1, modtime = "now")
+## where tblstats.table = "list" or tblstats.table = "filesys" or
+## tblstats.table = "nfsquota"
return(SMS_SUCCESS);
##}
/* validate_chars: verify that there are no illegal characters in
* the string. Legal characters are printing chars other than
- * ", *, ?, [ and ].
+ * ", *, ?, \, [ and ].
*/
static int illegalchars[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* ^@ - ^O */
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, /* SPACE - / */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 0 - ? */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ - O */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, /* P - _ */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, /* P - _ */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ` - o */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* p - ^? */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
* values.[idfield] for the id.
*/
if (vo->idfield && !strcmp(argv[0], argv[vo->index])) {
+ set_next_object_id(q->validate->object_id, q->rtable);
name = vo->idfield;
-## repeat retrieve (id = values.value+1) where values.#name = @name
+## repeat retrieve (id = values.value) where values.#name = @name
## inquire_equel(rowcount = "rowcount")
if (rowcount != 1) return(SMS_LIST);
} else
sanity_check_database()
##{
-## replace servers (inprogress = 0)
-## replace serverhosts (inprogress = 0)
##}