I am enclosing a context diff of the changes that I made to get openssh working on UWIN. UWIN is a UNIX operating system layer that runs on Win32 systems. For more information on UWIN go to http://www.research.att.com/sw/tools/uwin/. I also ran configure using -with-cppflags=-D_BSDCOMP=2. I don't know where that information would go with the source code. Let me know if you need more information. =====================cut here=================*** auth-passwd.c.orig Mon Mar 04 20:45:57 2002 --- auth-passwd.c Fri Jun 07 10:37:59 2002 *************** *** 44,49 **** --- 44,52 ---- #include "log.h" #include "servconf.h" #include "auth.h" + #ifdef _UWIN + # include <uwin.h> + #endif #ifdef HAVE_CRYPT_H # include <crypt.h> *************** *** 114,119 **** --- 117,125 ---- /* deny if no user. */ if (pw == NULL) return 0; + #ifdef _UWIN + return(uwin_mktoken(pw->pw_name,password,UWIN_TOKCLOSE)!=0); + #endif #ifndef HAVE_CYGWIN if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) return 0; *** readconf.c.orig Mon Feb 04 20:26:35 2002 --- readconf.c Thu May 30 16:55:00 2002 *************** *** 200,206 **** u_short host_port) { Forward *fwd; ! #ifndef HAVE_CYGWIN extern uid_t original_real_uid; if (port < IPPORT_RESERVED && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); --- 200,206 ---- u_short host_port) { Forward *fwd; ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) extern uid_t original_real_uid; if (port < IPPORT_RESERVED && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); *** ssh.c.orig Mon Feb 18 23:20:58 2002 --- ssh.c Thu May 30 16:40:07 2002 *************** *** 640,646 **** host = options.hostname; /* Disable rhosts authentication if not running as root. */ ! #ifdef HAVE_CYGWIN /* Ignore uid if running under Windows */ if (!options.use_privileged_port) { #else --- 640,646 ---- host = options.hostname; /* Disable rhosts authentication if not running as root. */ ! #if define(HAVE_CYGWIN) || defined(_UWIN) /* Ignore uid if running under Windows */ if (!options.use_privileged_port) { #else *** sshpty.c.orig Thu Dec 20 22:45:52 2001 --- sshpty.c Thu May 30 16:37:50 2002 *************** *** 124,130 **** close(*ptyfd); return 0; } ! #ifndef HAVE_CYGWIN /* * Push the appropriate streams modules, as described in Solaris pts(7). * HP-UX pts(7) doesn't have ttcompat module. --- 124,130 ---- close(*ptyfd); return 0; } ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) /* * Push the appropriate streams modules, as described in Solaris pts(7). * HP-UX pts(7) doesn't have ttcompat module. *** uidswap.c.orig Thu Dec 20 22:45:52 2001 --- uidswap.c Thu May 30 16:36:30 2002 *************** *** 80,86 **** if (user_groupslen < 0) fatal("getgroups: %.100s", strerror(errno)); } ! #ifndef HAVE_CYGWIN /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); --- 80,86 ---- if (user_groupslen < 0) fatal("getgroups: %.100s", strerror(errno)); } ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); *************** *** 131,137 **** setgid(getgid()); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ ! #ifndef HAVE_CYGWIN if (setgroups(saved_egroupslen, saved_egroups) < 0) fatal("setgroups: %.100s", strerror(errno)); #endif /* !HAVE_CYGWIN */ --- 131,137 ---- setgid(getgid()); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) if (setgroups(saved_egroupslen, saved_egroups) < 0) fatal("setgroups: %.100s", strerror(errno)); #endif /* !HAVE_CYGWIN */ =====================cut here================= David Korn research!dgk dgk at research.att.com
I am enclosing a context diff of the changes that I made to get openssh working on UWIN. UWIN is a UNIX operating system layer that runs on Win32 systems. For more information on UWIN go to http://www.research.att.com/sw/tools/uwin/. Let me know if you need more information. +++++++++++++++++cut here+++++++++++++++++++++ *** auth-passwd.c.orig Mon Mar 04 20:45:57 2002 --- auth-passwd.c Fri Jun 07 10:37:59 2002 *************** *** 44,49 **** --- 44,52 ---- #include "log.h" #include "servconf.h" #include "auth.h" + #ifdef _UWIN + # include <uwin.h> + #endif #ifdef HAVE_CRYPT_H # include <crypt.h> *************** *** 114,119 **** --- 117,125 ---- /* deny if no user. */ if (pw == NULL) return 0; + #ifdef _UWIN + return(uwin_mktoken(pw->pw_name,password,UWIN_TOKCLOSE)!=0); + #endif #ifndef HAVE_CYGWIN if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) return 0; *** readconf.c.orig Mon Feb 04 20:26:35 2002 --- readconf.c Thu May 30 16:55:00 2002 *************** *** 200,206 **** u_short host_port) { Forward *fwd; ! #ifndef HAVE_CYGWIN extern uid_t original_real_uid; if (port < IPPORT_RESERVED && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); --- 200,206 ---- u_short host_port) { Forward *fwd; ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) extern uid_t original_real_uid; if (port < IPPORT_RESERVED && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); *** ssh.c.orig Mon Feb 18 23:20:58 2002 --- ssh.c Thu May 30 16:40:07 2002 *************** *** 640,646 **** host = options.hostname; /* Disable rhosts authentication if not running as root. */ ! #ifdef HAVE_CYGWIN /* Ignore uid if running under Windows */ if (!options.use_privileged_port) { #else --- 640,646 ---- host = options.hostname; /* Disable rhosts authentication if not running as root. */ ! #if define(HAVE_CYGWIN) || defined(_UWIN) /* Ignore uid if running under Windows */ if (!options.use_privileged_port) { #else *** sshpty.c.orig Thu Dec 20 22:45:52 2001 --- sshpty.c Thu May 30 16:37:50 2002 *************** *** 124,130 **** close(*ptyfd); return 0; } ! #ifndef HAVE_CYGWIN /* * Push the appropriate streams modules, as described in Solaris pts(7). * HP-UX pts(7) doesn't have ttcompat module. --- 124,130 ---- close(*ptyfd); return 0; } ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) /* * Push the appropriate streams modules, as described in Solaris pts(7). * HP-UX pts(7) doesn't have ttcompat module. *** uidswap.c.orig Thu Dec 20 22:45:52 2001 --- uidswap.c Thu May 30 16:36:30 2002 *************** *** 80,86 **** if (user_groupslen < 0) fatal("getgroups: %.100s", strerror(errno)); } ! #ifndef HAVE_CYGWIN /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); --- 80,86 ---- if (user_groupslen < 0) fatal("getgroups: %.100s", strerror(errno)); } ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); *************** *** 131,137 **** setgid(getgid()); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ ! #ifndef HAVE_CYGWIN if (setgroups(saved_egroupslen, saved_egroups) < 0) fatal("setgroups: %.100s", strerror(errno)); #endif /* !HAVE_CYGWIN */ --- 131,137 ---- setgid(getgid()); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) if (setgroups(saved_egroupslen, saved_egroups) < 0) fatal("setgroups: %.100s", strerror(errno)); #endif /* !HAVE_CYGWIN */ +++++++++++++++++cut here+++++++++++++++++++++ David Korn research!dgk dgk at research.att.com
On Fri, Jun 07, 2002 at 11:09:39AM -0400, David Korn wrote:> I also ran configure using -with-cppflags=-D_BSDCOMP=2. I don't > know where that information would go with the source code.AFAICS, this should go into configure.ac. Line 55 contains the `case $host' statement. The first entry (for AIX) already contains the example how to set the preprocessor flags: *-*-aix*) AFS_LIBS="-lld" CPPFLAGS="$CPPFLAGS -I/usr/local/include" [...] Hope that helps, Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen at redhat.com
On Fri, Jun 07, 2002 at 11:09:39AM -0400, David Korn wrote:> ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) > extern uid_t original_real_uid; > if (port < IPPORT_RESERVED && original_real_uid != 0)i think these should be turned into a #ifndef HAVE_IPPORT_RESERVED_CONCEPT ... #endif
On Fri, Jun 07, 2002 at 10:52:48PM +0200, Markus Friedl wrote:> On Fri, Jun 07, 2002 at 11:09:39AM -0400, David Korn wrote: > > ! #if !defined(HAVE_CYGWIN) && !defined(_UWIN) > > extern uid_t original_real_uid; > > if (port < IPPORT_RESERVED && original_real_uid != 0) > > i think these should be turned into a > > #ifndef HAVE_IPPORT_RESERVED_CONCEPT > ... > #endifAhem, do you mean #ifndef NO_IPPORT_RESERVED_CONCEPT ? Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen at redhat.com