control.c (98121) | control.c (110560) |
---|---|
1/* 2 * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * 5 * By using this file, you agree to the terms and conditions set 6 * forth in the LICENSE file which can be found at the top level of 7 * the sendmail distribution. 8 * 9 */ 10 11#include <sendmail.h> 12 | 1/* 2 * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * 5 * By using this file, you agree to the terms and conditions set 6 * forth in the LICENSE file which can be found at the top level of 7 * the sendmail distribution. 8 * 9 */ 10 11#include <sendmail.h> 12 |
13SM_RCSID("@(#)$Id: control.c,v 8.118 2002/03/19 00:23:27 gshapiro Exp $") | 13SM_RCSID("@(#)$Id: control.c,v 8.118.4.3 2002/11/14 00:15:56 ca Exp $") |
14 | 14 |
15#include <sm/fdset.h> 16 |
|
15/* values for cmd_code */ 16#define CMDERROR 0 /* bad command */ 17#define CMDRESTART 1 /* restart daemon */ 18#define CMDSHUTDOWN 2 /* end daemon */ 19#define CMDHELP 3 /* help */ 20#define CMDSTATUS 4 /* daemon status */ 21#define CMDMEMDUMP 5 /* dump memory, to find memory leaks */ 22#if _FFR_CONTROL_MSTAT --- 62 unchanged lines hidden (view full) --- 85 { 86 errno = rval; 87 return -1; 88 } 89 90 ControlSocket = socket(AF_UNIX, SOCK_STREAM, 0); 91 if (ControlSocket < 0) 92 return -1; | 17/* values for cmd_code */ 18#define CMDERROR 0 /* bad command */ 19#define CMDRESTART 1 /* restart daemon */ 20#define CMDSHUTDOWN 2 /* end daemon */ 21#define CMDHELP 3 /* help */ 22#define CMDSTATUS 4 /* daemon status */ 23#define CMDMEMDUMP 5 /* dump memory, to find memory leaks */ 24#if _FFR_CONTROL_MSTAT --- 62 unchanged lines hidden (view full) --- 87 { 88 errno = rval; 89 return -1; 90 } 91 92 ControlSocket = socket(AF_UNIX, SOCK_STREAM, 0); 93 if (ControlSocket < 0) 94 return -1; |
95 if (SM_FD_SETSIZE > 0 && ControlSocket >= SM_FD_SETSIZE) 96 { 97 clrcontrol(); 98 errno = EINVAL; 99 return -1; 100 } |
|
93 94 (void) unlink(ControlSocketName); 95 memset(&controladdr, '\0', sizeof controladdr); 96 controladdr.sun_family = AF_UNIX; 97 (void) sm_strlcpy(controladdr.sun_path, ControlSocketName, 98 sizeof controladdr.sun_path); 99 100 if (bind(ControlSocket, (struct sockaddr *) &controladdr, --- 328 unchanged lines hidden --- | 101 102 (void) unlink(ControlSocketName); 103 memset(&controladdr, '\0', sizeof controladdr); 104 controladdr.sun_family = AF_UNIX; 105 (void) sm_strlcpy(controladdr.sun_path, ControlSocketName, 106 sizeof controladdr.sun_path); 107 108 if (bind(ControlSocket, (struct sockaddr *) &controladdr, --- 328 unchanged lines hidden --- |