From 3bd98c6ee56e32e4add6082eb58fdf7a70bfab3f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 12 Mar 2002 19:59:41 +0000 Subject: [PATCH] * Access control change: do not treat mailboxes as guessname rooms for Aides. Open up INVT/KICK commands to non-Aides for their mailboxes. --- citadel/ChangeLog | 5 ++++- citadel/citadel.rc | 4 ++-- citadel/room_ops.c | 9 ++------- citadel/user_ops.c | 16 ++++++++++++++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index baa76db74..37f893954 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 590.145 2002/03/12 19:59:40 ajc + * Access control change: do not treat mailboxes as guessname rooms for Aides. + Open up INVT/KICK commands to non-Aides for their mailboxes. + Revision 590.144 2002/03/12 04:30:52 nbryant if a filesystem node exists at /var/run/egd-pool, try to connect to it as the EGD (Entropy Gathering Daemon) or PRNGD (pseudorandom number @@ -3457,4 +3461,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.rc b/citadel/citadel.rc index b64952f25..0f92c69de 100644 --- a/citadel/citadel.rc +++ b/citadel/citadel.rc @@ -213,8 +213,8 @@ cmd=24,1,&.,&Aide,&Who knows room cmd=25,2,&.,&Aide,edit &User cmd=26,2,&.,&Aide,&Validate new users cmd=48,1,&.,&Aide,enter &Info file -cmd=27,1,&.,&Aide,&Room,&Invite user -cmd=28,1,&.,&Aide,&Room,&Kick out user +cmd=27,0,&.,&Aide,&Room,&Invite user +cmd=28,0,&.,&Aide,&Room,&Kick out user cmd=51,1,&.,&Aide,&File,&Delete cmd=53,1,&.,&Aide,&File,&Send over net cmd=54,1,&.,&Aide,&File,&Move diff --git a/citadel/room_ops.c b/citadel/room_ops.c index ba41b87bd..59eb43f17 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -129,16 +129,11 @@ int CtdlRoomAccess(struct quickroom *roombuf, struct usersupp *userbuf) } /* Aides get access to everything */ - if (userbuf->axlevel >= 6) { + if ( (userbuf->axlevel >= 6) + && ((roombuf->QRflags & QR_MAILBOX) == 0) ) { if (vbuf.v_flags & V_FORGET) { retval = retval | UA_GOTOALLOWED; } - else { - retval = retval | UA_GOTOALLOWED; - if ((roombuf->QRflags & QR_MAILBOX) == 0) { - retval = retval | UA_KNOWN; - } - } } NEWMSG: /* By the way, we also check for the presence of new messages */ diff --git a/citadel/user_ops.c b/citadel/user_ops.c index b5f6e8f20..cf7c9982b 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -1006,8 +1006,20 @@ void cmd_invt_kick(char *iuser, int op) char bbb[SIZ]; struct visit vbuf; - if (CtdlAccessCheck(ac_room_aide)) - return; + /* + * These commands are only allowed by aides, room aides, + * and room namespace owners + */ + if (is_room_aide() + || (atol(CC->quickroom.QRname) == CC->usersupp.usernum) ) { + /* access granted */ + } + else { + /* access denied */ + cprintf("%d Higher access or room ownership required.\n", + ERROR + HIGHER_ACCESS_REQUIRED); + return; + } if (lgetuser(&USscratch, iuser) != 0) { cprintf("%d No such user.\n", ERROR); -- 2.39.2