From 596273516c67cfded71acee848de6db4daa41a1a Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 27 Jun 2002 18:02:21 +0000 Subject: - (bal) Cygwin uid0 fix by vinschen@redhat.com --- sshd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sshd.c') diff --git a/sshd.c b/sshd.c index 851fad4be..d2524c4bc 100644 --- a/sshd.c +++ b/sshd.c @@ -1035,7 +1035,14 @@ main(int ac, char **av) (S_ISDIR(st.st_mode) == 0)) fatal("Missing privilege separation directory: %s", _PATH_PRIVSEP_CHROOT_DIR); + +#ifdef HAVE_CYGWIN + if (check_ntsec(_PATH_PRIVSEP_CHROOT_DIR) && + (st.st_uid != getuid () || + (st.st_mode & (S_IWGRP|S_IWOTH)) != 0)) +#else if (st.st_uid != 0 || (st.st_mode & (S_IWGRP|S_IWOTH)) != 0) +#endif fatal("Bad owner or mode for %s", _PATH_PRIVSEP_CHROOT_DIR); } -- cgit v1.2.3