1N/A * Copyright (c) 1998-2004, 2006 Sendmail, Inc. and its suppliers. 1N/A * All rights reserved. 1N/A * By using this file, you agree to the terms and conditions set 1N/A * forth in the LICENSE file which can be found at the top level of 1N/A * the sendmail distribution. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A/* values for cmd_code */ 1N/A#
define CMDMSTAT 6 /* daemon status, more info, tagged data */ 1N/A** OPENCONTROLSOCKET -- create/open the daemon control named socket 1N/A** Creates and opens a named socket for external control over 1N/A** the sendmail daemon. 1N/A** 0 if successful, -1 otherwise 1N/A /* if not safe, don't create */ 1N/A "ownership change on %s to uid %d failed: %s",
1N/A message(
"050 ownership change on %s to uid %d failed: %s",
1N/A#
endif /* NETUNIX */ 1N/A** CLOSECONTROLSOCKET -- close the daemon control named socket 1N/A** Close a named socket. 1N/A** fullclose -- if set, close the socket and remove it; 1N/A** otherwise, just remove it 1N/A /* if not safe, don't unlink */ 1N/A "Could not remove control socket: %s",
1N/A#
endif /* NETUNIX */ 1N/A** CLRCONTROL -- reset the control connection 1N/A** releases any resources used by the control interface. 1N/A#
endif /* NETUNIX */ 1N/A** CONTROL_COMMAND -- read and process command from named socket 1N/A** Read and process the command from the opened socket. 1N/A** Exits when done since it is running in a forked child. 1N/A** sock -- the opened socket from getrequests() 1N/A** e -- the current envelope 1N/A ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD 1N/A ** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE 1N/A /* handle possible input timeout */ 1N/A "timeout waiting for input during control command");
1N/A /* clean up end of line */ 1N/A /* break off command */ 1N/A while (*p !=
'\0' &&
1N/A /* throw away leading whitespace */ 1N/A /* decode command */ 1N/A /* XXX need to deal with different partitions */ 1N/A ** Prevent overflow and don't lose 1N/A ** precision (if bsize == 512) 1N/A case CMDMSTAT:
/* daemon status, extended, tagged format */ 1N/A "C:%d\r\nM:%d\r\nL:%d\r\n",
1N/A /* dump the heap, if we are checking for memory leaks */ 1N/A "Memory dump unavailable.\r\n");
1N/A "To fix, run sendmail with -dsm_check_heap.4\r\n");
1N/A#
else /* SM_HEAP_CHECK */ 1N/A "Memory dump unavailable.\r\n");
1N/A "To fix, rebuild with -DSM_HEAP_CHECK\r\n");
1N/A#
endif /* SM_HEAP_CHECK */