]> code.citadel.org Git - citadel.git/commitdiff
* Allow non-Aides to terminate sessions belonging to them
authorArt Cancro <ajc@citadel.org>
Tue, 2 Oct 2001 03:04:30 +0000 (03:04 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 2 Oct 2001 03:04:30 +0000 (03:04 +0000)
citadel/ChangeLog
citadel/citserver.c

index 44e058eae30fc70abd8160a1018b383fda19d1eb..11f9062863cd601291e008324fc94f3463e49ead 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.48  2001/10/02 03:04:30  ajc
+ * Allow non-Aides to terminate sessions belonging to them
+
  Revision 580.47  2001/09/24 18:55:13  ajc
  * Completed migrating the "netpoll" utility into the serv_network module.
    Removed this utility.
@@ -2762,3 +2765,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 00d08695663e3056196ec4a18a9a1822937c737a..57fe8e98bb4b8bb9dc962dfea5f1fb83de028d4f 100644 (file)
@@ -644,32 +644,44 @@ void cmd_term(char *cmdbuf)
        int session_num;
        struct CitContext *ccptr;
        int found_it = 0;
-
-       if (CtdlAccessCheck(ac_aide)) return;
+       int allowed = 0;
 
        session_num = extract_int(cmdbuf, 0);
        if (session_num == CC->cs_pid) {
                cprintf("%d You can't kill your own session.\n", ERROR);
                return;
-               }
+       }
 
        lprintf(9, "Locating session to kill\n");
        begin_critical_section(S_SESSION_TABLE);
        for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
                if (session_num == ccptr->cs_pid) {
-                       ccptr->kill_me = 1;
                        found_it = 1;
+                       if ((ccptr->usersupp.usernum == CC->usersupp.usernum)
+                          || (CC->usersupp.axlevel >= 6)) {
+                               allowed = 1;
+                               ccptr->kill_me = 1;
+                       }
+                       else {
+                               allowed = 0;
                        }
                }
+       }
        end_critical_section(S_SESSION_TABLE);
 
        if (found_it) {
-               cprintf("%d Session terminated.\n", OK);
+               if (allowed) {
+                       cprintf("%d Session terminated.\n", OK);
+               }
+               else {
+                       cprintf("%d You are not allowed to do that.\n",
+                               ERROR + HIGHER_ACCESS_REQUIRED);
                }
+       }
        else {
                cprintf("%d No such session.\n", ERROR);
-               }
        }
+}