Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c44453e5a2 | ||
|
|
295ac5e153 | ||
|
|
f77e6b5216 | ||
|
|
4632b63bdc | ||
|
|
eb25c7b633 | ||
|
|
173359e4cb |
@@ -1486,6 +1486,7 @@ AC_ARG_WITH(ldns,
|
|||||||
else
|
else
|
||||||
LIBS="$LIBS `$LDNSCONFIG --libs`"
|
LIBS="$LIBS `$LDNSCONFIG --libs`"
|
||||||
CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`"
|
CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`"
|
||||||
|
ldns=yes
|
||||||
fi
|
fi
|
||||||
elif test "x$withval" != "xno" ; then
|
elif test "x$withval" != "xno" ; then
|
||||||
CPPFLAGS="$CPPFLAGS -I${withval}/include"
|
CPPFLAGS="$CPPFLAGS -I${withval}/include"
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
|
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
|
#ifdef __s390__
|
||||||
|
#include <asm/zcrypt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -222,6 +225,7 @@ static const struct sock_filter preauth_insns[] = {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef __NR_socketcall
|
#ifdef __NR_socketcall
|
||||||
SC_ALLOW_ARG(__NR_socketcall, 0, SYS_SHUTDOWN),
|
SC_ALLOW_ARG(__NR_socketcall, 0, SYS_SHUTDOWN),
|
||||||
|
SC_DENY(__NR_socketcall, EACCES),
|
||||||
#endif
|
#endif
|
||||||
#if defined(__NR_ioctl) && defined(__s390__)
|
#if defined(__NR_ioctl) && defined(__s390__)
|
||||||
/* Allow ioctls for ICA crypto card on s390 */
|
/* Allow ioctls for ICA crypto card on s390 */
|
||||||
@@ -235,7 +239,7 @@ static const struct sock_filter preauth_insns[] = {
|
|||||||
* x86-64 syscall under some circumstances, e.g.
|
* x86-64 syscall under some circumstances, e.g.
|
||||||
* https://bugs.debian.org/849923
|
* https://bugs.debian.org/849923
|
||||||
*/
|
*/
|
||||||
SC_ALLOW(__NR_clock_gettime & ~__X32_SYSCALL_BIT);
|
SC_ALLOW(__NR_clock_gettime & ~__X32_SYSCALL_BIT),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Default deny */
|
/* Default deny */
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ int startup_pipe; /* in child */
|
|||||||
int use_privsep = -1;
|
int use_privsep = -1;
|
||||||
struct monitor *pmonitor = NULL;
|
struct monitor *pmonitor = NULL;
|
||||||
int privsep_is_preauth = 1;
|
int privsep_is_preauth = 1;
|
||||||
|
static int privsep_chroot = 1;
|
||||||
|
|
||||||
/* global authentication context */
|
/* global authentication context */
|
||||||
Authctxt *the_authctxt = NULL;
|
Authctxt *the_authctxt = NULL;
|
||||||
@@ -541,7 +542,7 @@ privsep_preauth_child(void)
|
|||||||
demote_sensitive_data();
|
demote_sensitive_data();
|
||||||
|
|
||||||
/* Demote the child */
|
/* Demote the child */
|
||||||
if (getuid() == 0 || geteuid() == 0) {
|
if (privsep_chroot) {
|
||||||
/* Change our root directory */
|
/* Change our root directory */
|
||||||
if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1)
|
if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1)
|
||||||
fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR,
|
fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR,
|
||||||
@@ -1640,8 +1641,9 @@ main(int ac, char **av)
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* Store privilege separation user for later use if required. */
|
/* Store privilege separation user for later use if required. */
|
||||||
|
privsep_chroot = use_privsep && (getuid() == 0 || geteuid() == 0);
|
||||||
if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
|
if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
|
||||||
if (use_privsep || options.kerberos_authentication)
|
if (privsep_chroot || options.kerberos_authentication)
|
||||||
fatal("Privilege separation user %s does not exist",
|
fatal("Privilege separation user %s does not exist",
|
||||||
SSH_PRIVSEP_USER);
|
SSH_PRIVSEP_USER);
|
||||||
} else {
|
} else {
|
||||||
@@ -1767,7 +1769,7 @@ main(int ac, char **av)
|
|||||||
key_type(key));
|
key_type(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_privsep) {
|
if (privsep_chroot) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if ((stat(_PATH_PRIVSEP_CHROOT_DIR, &st) == -1) ||
|
if ((stat(_PATH_PRIVSEP_CHROOT_DIR, &st) == -1) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user