|
Lines 32-37
Link Here
|
| 32 |
#ifdef HAVE_SYS_PRCTL_H |
32 |
#ifdef HAVE_SYS_PRCTL_H |
| 33 |
#include <sys/prctl.h> |
33 |
#include <sys/prctl.h> |
| 34 |
#endif |
34 |
#endif |
|
|
35 |
#ifdef HAVE_PRIV_H |
| 36 |
#include <priv.h> /* For setpflags() and __PROC_PROTECT */ |
| 37 |
#endif |
| 35 |
|
38 |
|
| 36 |
#include <dirent.h> |
39 |
#include <dirent.h> |
| 37 |
#include <errno.h> |
40 |
#include <errno.h> |
|
Lines 1588-1593
Link Here
|
| 1588 |
|
1591 |
|
| 1589 |
log_init(__progname, log_level, log_facility, log_stderr); |
1592 |
log_init(__progname, log_level, log_facility, log_stderr); |
| 1590 |
|
1593 |
|
|
|
1594 |
#if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT) |
| 1595 |
/* On Solaris, we should make this process untraceable */ |
| 1596 |
if (setpflags(__PROC_PROTECT, 1) != 0) |
| 1597 |
fatal("unable to make the process untraceable"); |
| 1598 |
#else |
| 1591 |
#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) |
1599 |
#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) |
| 1592 |
/* |
1600 |
/* |
| 1593 |
* On Linux, we should try to avoid making /proc/self/{mem,maps} |
1601 |
* On Linux, we should try to avoid making /proc/self/{mem,maps} |
|
Lines 1598-1603
Link Here
|
| 1598 |
if (prctl(PR_SET_DUMPABLE, 0) != 0) |
1606 |
if (prctl(PR_SET_DUMPABLE, 0) != 0) |
| 1599 |
fatal("unable to make the process undumpable"); |
1607 |
fatal("unable to make the process undumpable"); |
| 1600 |
#endif /* defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) */ |
1608 |
#endif /* defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) */ |
|
|
1609 |
#endif |
| 1601 |
|
1610 |
|
| 1602 |
/* Drop any fine-grained privileges we don't need */ |
1611 |
/* Drop any fine-grained privileges we don't need */ |
| 1603 |
platform_pledge_sftp_server(); |
1612 |
platform_pledge_sftp_server(); |