random boilerplate
[citadel.git] / citadel / context.c
index 6593870a4f9038ffa361d5ed7fc1d5cea3982f58..1a2816f5491aaa555b7e858862fb3066e27e9bdb 100644 (file)
@@ -1,17 +1,12 @@
-/*
- * Citadel context management stuff.
- * Here's where we (hopefully) have all the code that manipulates contexts.
- *
- * Copyright (c) 1987-2019 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+//
+// Citadel context management stuff.
+// Here's where we (hopefully) have all the code that manipulates contexts.
+//
+// Copyright (c) 1987-2020 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License, version 3.
+// The program is distributed without any warranty, expressed or implied.
 
 #include "ctdl_module.h"
 #include "serv_extensions.h"
@@ -495,7 +490,7 @@ void begin_session(CitContext *con)
        safestrncpy(con->cs_addr, "", sizeof con->cs_addr);
        con->cs_UDSclientUID = -1;
        con->cs_host[sizeof con->cs_host - 1] = 0;
-       if (!CC->is_local_socket) {
+       if (!CC->is_local_client) {
                locate_host(con->cs_host, sizeof con->cs_host,
                        con->cs_addr, sizeof con->cs_addr,
                        con->client_socket
@@ -545,12 +540,9 @@ void begin_session(CitContext *con)
                con->nologin = 1;
        }
 
-       if (!CC->is_local_socket) {
-               syslog(LOG_INFO, "context: session (%s) started from %s (%s)", con->ServiceName, con->cs_host, con->cs_addr);
-       }
-       else {
-               syslog(LOG_INFO, "context: session (%s) started via local socket with uid=%d", con->ServiceName, con->cs_UDSclientUID);
-       }
+       syslog(LOG_INFO, "context: session (%s) started from %s (%s) uid=%d",
+               con->ServiceName, con->cs_host, con->cs_addr, con->cs_UDSclientUID
+       );
 
        /* Run any session startup routines registered by loadable modules */
        PerformSessionHooks(EVT_START);
@@ -571,7 +563,7 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        context->cs_pid = 0;
        strcpy (sysname, "SYS_");
        strcat (sysname, name);
-       len = cutuserkey(sysname);
+       len = strlen(sysname);
        memcpy(context->curr_user, sysname, len + 1);
        context->client_socket = (-1);
        context->state = CON_SYS;