|
Lines 89-94
__FBSDID("$FreeBSD: stable/10/usr.sbin/s
Link Here
|
| 89 |
#include <sys/resource.h> |
89 |
#include <sys/resource.h> |
| 90 |
#include <sys/syslimits.h> |
90 |
#include <sys/syslimits.h> |
| 91 |
#include <sys/types.h> |
91 |
#include <sys/types.h> |
|
|
92 |
#include <sys/procctl.h> |
| 92 |
|
93 |
|
| 93 |
#include <netinet/in.h> |
94 |
#include <netinet/in.h> |
| 94 |
#include <netdb.h> |
95 |
#include <netdb.h> |
|
Lines 280-285
static int Initialized; /* set when we h
Link Here
|
| 280 |
static int MarkInterval = 20 * 60; /* interval between marks in seconds */ |
281 |
static int MarkInterval = 20 * 60; /* interval between marks in seconds */ |
| 281 |
static int MarkSeq; /* mark sequence number */ |
282 |
static int MarkSeq; /* mark sequence number */ |
| 282 |
static int NoBind; /* don't bind() as suggested by RFC 3164 */ |
283 |
static int NoBind; /* don't bind() as suggested by RFC 3164 */ |
|
|
284 |
static int ProtectMode = 0; /* when true, protect from OOM killer */ |
| 283 |
static int SecureMode; /* when true, receive only unix domain socks */ |
285 |
static int SecureMode; /* when true, receive only unix domain socks */ |
| 284 |
#ifdef INET6 |
286 |
#ifdef INET6 |
| 285 |
static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ |
287 |
static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ |
|
Lines 372-378
main(int argc, char *argv[])
Link Here
|
| 372 |
dprintf("madvise() failed: %s\n", strerror(errno)); |
374 |
dprintf("madvise() failed: %s\n", strerror(errno)); |
| 373 |
|
375 |
|
| 374 |
bindhostname = NULL; |
376 |
bindhostname = NULL; |
| 375 |
while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv")) |
377 |
while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNoOp:P:sS:Tuv")) |
| 376 |
!= -1) |
378 |
!= -1) |
| 377 |
switch (ch) { |
379 |
switch (ch) { |
| 378 |
case '4': |
380 |
case '4': |
|
Lines 461-466
main(int argc, char *argv[])
Link Here
|
| 461 |
case 'o': |
463 |
case 'o': |
| 462 |
use_bootfile = 1; |
464 |
use_bootfile = 1; |
| 463 |
break; |
465 |
break; |
|
|
466 |
/* |
| 467 |
* Protect itself from being killed |
| 468 |
* when swap space is exhausted. |
| 469 |
*/ |
| 470 |
case 'O': |
| 471 |
ProtectMode++; |
| 472 |
break; |
| 464 |
case 'p': /* path */ |
473 |
case 'p': /* path */ |
| 465 |
if (strlen(optarg) >= sizeof(sunx.sun_path)) |
474 |
if (strlen(optarg) >= sizeof(sunx.sun_path)) |
| 466 |
errx(1, "%s path too long, exiting", optarg); |
475 |
errx(1, "%s path too long, exiting", optarg); |
|
Lines 591-596
main(int argc, char *argv[])
Link Here
|
| 591 |
/* tuck my process id away */ |
600 |
/* tuck my process id away */ |
| 592 |
pidfile_write(pfh); |
601 |
pidfile_write(pfh); |
| 593 |
|
602 |
|
|
|
603 |
if (ProtectMode) { |
| 604 |
int p_flags = PPROT_SET; |
| 605 |
procctl(P_PID, getpid(), PROC_SPROTECT, &p_flags); |
| 606 |
} |
| 607 |
|
| 594 |
dprintf("off & running....\n"); |
608 |
dprintf("off & running....\n"); |
| 595 |
|
609 |
|
| 596 |
init(0); |
610 |
init(0); |