control.c (42575) | control.c (43730) |
---|---|
1/* 2 * Copyright (c) 1998 Sendmail, Inc. All rights reserved. 3 * 4 * By using this file, you agree to the terms and conditions set 5 * forth in the LICENSE file which can be found at the top level of 6 * the sendmail distribution. 7 * 8 */ 9 10#ifndef lint | 1/* 2 * Copyright (c) 1998 Sendmail, Inc. All rights reserved. 3 * 4 * By using this file, you agree to the terms and conditions set 5 * forth in the LICENSE file which can be found at the top level of 6 * the sendmail distribution. 7 * 8 */ 9 10#ifndef lint |
11static char sccsid[] = "@(#)control.c 8.17 (Berkeley) 12/1/1998"; | 11static char sccsid[] = "@(#)control.c 8.18 (Berkeley) 1/17/1999"; |
12#endif /* not lint */ 13 14#include "sendmail.h" 15 16int ControlSocket = -1; 17 18/* 19** OPENCONTROLSOCKET -- create/open the daemon control named socket --- 45 unchanged lines hidden (view full) --- 65 controladdr.sun_family = AF_UNIX; 66 strcpy(controladdr.sun_path, ControlSocketName); 67 68 if (bind(ControlSocket, (struct sockaddr *) &controladdr, 69 sizeof controladdr) < 0) 70 { 71 int save_errno = errno; 72 | 12#endif /* not lint */ 13 14#include "sendmail.h" 15 16int ControlSocket = -1; 17 18/* 19** OPENCONTROLSOCKET -- create/open the daemon control named socket --- 45 unchanged lines hidden (view full) --- 65 controladdr.sun_family = AF_UNIX; 66 strcpy(controladdr.sun_path, ControlSocketName); 67 68 if (bind(ControlSocket, (struct sockaddr *) &controladdr, 69 sizeof controladdr) < 0) 70 { 71 int save_errno = errno; 72 |
73 (void) close(ControlSocket); 74 ControlSocket = -1; | 73 clrcontrol(); |
75 errno = save_errno; 76 return -1; 77 } 78 79# if _FFR_TRUSTED_USER 80 if (geteuid() == 0 && TrustedUid != 0) 81 { 82 if (chown(ControlSocketName, TrustedUid, -1) < 0) 83 { 84 int save_errno = errno; 85 86 sm_syslog(LOG_ALERT, NOQID, 87 "ownership change on %s failed: %s", 88 ControlSocketName, errstring(save_errno)); 89 message("050 ownership change on %s failed: %s", 90 ControlSocketName, errstring(save_errno)); | 74 errno = save_errno; 75 return -1; 76 } 77 78# if _FFR_TRUSTED_USER 79 if (geteuid() == 0 && TrustedUid != 0) 80 { 81 if (chown(ControlSocketName, TrustedUid, -1) < 0) 82 { 83 int save_errno = errno; 84 85 sm_syslog(LOG_ALERT, NOQID, 86 "ownership change on %s failed: %s", 87 ControlSocketName, errstring(save_errno)); 88 message("050 ownership change on %s failed: %s", 89 ControlSocketName, errstring(save_errno)); |
90 closecontrolsocket(TRUE); |
|
91 errno = save_errno; 92 return -1; 93 } 94 } 95# endif 96 97 if (chmod(ControlSocketName, S_IRUSR|S_IWUSR) < 0) 98 { --- 258 unchanged lines hidden --- | 91 errno = save_errno; 92 return -1; 93 } 94 } 95# endif 96 97 if (chmod(ControlSocketName, S_IRUSR|S_IWUSR) < 0) 98 { --- 258 unchanged lines hidden --- |