From 331b982e104ecb7e754a4060a8c98fbd8028cea0 Mon Sep 17 00:00:00 2001 From: mar Date: Wed, 3 Aug 1988 18:36:13 +0000 Subject: [PATCH] don't allow a user with non-zero status to be deleted; don't allow a machine which is a printer-spooler to be deleted; don't allow backslashes in names; don't reset the DCM inprogress bits --- server/qsupport.qc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/server/qsupport.qc b/server/qsupport.qc index 62e3728a..ebaa1d8f 100644 --- a/server/qsupport.qc +++ b/server/qsupport.qc @@ -345,6 +345,12 @@ int setup_dusr(q, argv) ## 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")) @@ -438,6 +444,9 @@ int setup_dmac(q, argv) ## 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); @@ -2396,7 +2405,7 @@ validate_fields(q, argv, vo, n) /* 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 */ @@ -2404,7 +2413,7 @@ static int illegalchars[] = { 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, @@ -2675,6 +2684,4 @@ char *name; sanity_check_database() ##{ -## replace servers (inprogress = 0) -## replace serverhosts (inprogress = 0) ##} -- 2.45.2