Commit cda6e6e0 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(shutdown_kom): Log who is shutting down the server.

parent 021ce2c1
/*
* $Id: admin.c,v 0.13 1994/02/19 04:27:21 ceder Exp $
* $Id: admin.c,v 0.14 1994/03/05 22:14:36 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Administrative calls.
*/
static char *rcsid = "$Id: admin.c,v 0.13 1994/02/19 04:27:21 ceder Exp $";
static char *rcsid = "$Id: admin.c,v 0.14 1994/03/05 22:14:36 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -52,6 +52,7 @@ USE(rcsid);
#include "log.h"
#include "send-async.h"
#include "param.h"
#include "string-malloc.h"
/* All of the fields in this structure except the version number
is set from the configuration file at startup (see ramkomd.c).
......@@ -199,6 +200,10 @@ sync_kom (void)
extern Success
shutdown_kom (int exit_val)
{
char *name;
char *user;
char *host;
CHK_LOGIN(FAILURE);
if ( !ENA(admin, 1) )
{
......@@ -206,6 +211,15 @@ shutdown_kom (int exit_val)
return FAILURE;
}
name = s_crea_c_str (active_connection->username);
user = s_crea_c_str (active_connection->ident_user);
host = s_crea_c_str (active_connection->hostname);
log ("shutdown initiated by person %d (%s) via %s@%s.\n",
ACTPERS, name, user, host);
string_free(host);
string_free(user);
string_free(name);
go_and_die = TRUE;
return OK;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment