#include <sys/socket.h>
#include <syslog.h>
#include <sys/syslog.h>
+/*
+#include <sys/syscall.h>
+*/
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
if (session_num == ccptr->cs_pid) {
ret |= TERM_FOUND;
if ((ccptr->user.usernum == CC->user.usernum)
- || (CC->user.axlevel >= 6)) {
+ || (CC->user.axlevel >= AxAideU)) {
ret |= TERM_ALLOWED;
ccptr->kill_me = 1;
}
return NULL;
}
memset(me, 0, sizeof(CitContext));
-
/* Give the contaxt a name. Hopefully makes it easier to track */
strcpy (me->user.fullname, "SYS_notauth");
*/
void CtdlFillSystemContext(CitContext *context, char *name)
{
- char sysname[USERNAME_SIZE];
+ char sysname[SIZ];
+ long len;
memset(context, 0, sizeof(CitContext));
context->internal_pgm = 1;
context->cs_pid = 0;
strcpy (sysname, "SYS_");
strcat (sysname, name);
+ len = cutuserkey(sysname);
+ memcpy(context->curr_user, sysname, len + 1);
+
/* internal_create_user has the side effect of loading the user regardless of wether they
* already existed or needed to be created
*/
- internal_create_user (sysname, &(context->user), -1) ;
+ internal_create_user (sysname, len, &(context->user), -1) ;
/* Check to see if the system user needs upgrading */
if (context->user.usernum == 0)
}
}
+/*
+ * flush it again...
+ */
+void CtdlClearSystemContext(void)
+{
+ CitContext *CCC = CC;
+
+ memset(CCC, 0, sizeof(CitContext));
+ citthread_setspecific(MyConKey, NULL);
+}
+
/*
* Cleanup any contexts that are left lying around
*/
-/*
- * Bind a thread to a context. (It's inline merely to speed things up.)
- */
-INLINE void become_session(CitContext *which_con) {
- citthread_setspecific(MyConKey, (void *)which_con );
-}
-
/*
* Set the "async waiting" flag for a session, if applicable