mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
Use Solaris setpflags(__PROC_PROTECT, ...).
Where possible, use Solaris setpflags to disable process tracing on ssh-agent and sftp-server. bz#2584, based on a patch from huieying.lee at oracle.com, ok djm.
This commit is contained in:
parent
0f916d39b0
commit
a86ec4d073
@ -898,6 +898,7 @@ mips-sony-bsd|mips-sony-newsos4)
|
|||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
|
AC_CHECK_FUNCS([setpflags])
|
||||||
AC_CHECK_FUNCS([setppriv])
|
AC_CHECK_FUNCS([setppriv])
|
||||||
AC_CHECK_FUNCS([priv_basicset])
|
AC_CHECK_FUNCS([priv_basicset])
|
||||||
AC_CHECK_HEADERS([priv.h])
|
AC_CHECK_HEADERS([priv.h])
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#if defined(HAVE_SYS_PRCTL_H)
|
#if defined(HAVE_SYS_PRCTL_H)
|
||||||
#include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */
|
#include <sys/prctl.h> /* For prctl() and PR_SET_DUMPABLE */
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_PRIV_H
|
||||||
|
#include <priv.h> /* For setpflags() and __PROC_PROTECT */
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -229,4 +232,9 @@ platform_disable_tracing(int strict)
|
|||||||
if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
|
if (prctl(PR_SET_DUMPABLE, 0) != 0 && strict)
|
||||||
fatal("unable to make the process undumpable");
|
fatal("unable to make the process undumpable");
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_SETPFLAGS) && defined(__PROC_PROTECT)
|
||||||
|
/* On Solaris, we should make this process untraceable */
|
||||||
|
if (setpflags(__PROC_PROTECT, 1) != 0 && strict)
|
||||||
|
fatal("unable to make the process untraceable");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user